Upstream tarball 9635
[amule.git] / autogen.sh
blob27fbfe4d67fc726be0542ffda4e37129abb62907
1 #!/bin/sh
2 # Helps bootstrapping 'aMule' when checked out from the source control system.
3 # Requires GNU autoconf, GNU automake and GNU which.
5 WANT_AUTOMAKE="1.7"
6 export WANT_AUTOMAKE
7 (autoconf --version) >/dev/null 2>/dev/null || (echo "You need GNU autoconf to install from sources (ftp://ftp.gnu.org/gnu/autoconf/)"; exit 1) || exit 1
8 (automake --version) >/dev/null 2>/dev/null || (echo "You need GNU automake 1.7 to install from sources (ftp://ftp.gnu.org/gnu/automake/)"; exit 1) || exit 1
10 # Do sanity checks.
11 # Directory check.
12 if [ ! -e src/SharedFileList.h ]; then
13 echo "Run ./autogen.sh from the base directory of aMule."
14 exit 1
17 # Determine the version of automake.
18 automake_version=`automake --version | head -n 1 | sed -e 's/[^12]*\([12]\.[0-9]+[^ ]*\).*/\1/'`
20 # Require automake 1.7.
21 if expr "1.7" \> "$automake_version" >/dev/null; then
22 automake --version | head -n 1
23 echo "Fatal error: automake version 1.7 or higher is required."
24 exit 1
27 # Determine version of gettext.
28 gettext_version=`gettext --version | head -n 1 | sed -e 's/[^0]*\(0\.[0-9][^ ]*\).*/\1/'`
29 confver=`cat configure.in | grep '^AM_GNU_GETTEXT_VERSION(' | sed -e 's/^AM_GNU_GETTEXT_VERSION(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
31 # Require version as specified in configure.in.
32 if expr "$confver" \> "$gettext_version" >/dev/null; then
33 gettext --version | head -n 1
34 echo "Fatal error: gettext version "$confver" or higher is required."
35 exit 1
38 # Force intl regenration to get last update from installed gettext templates
39 rm -rf intl/*
40 #if [ ! -d intl ]; then
41 echo "Setting up internationalization files."
42 autopoint --force
43 if grep -q datarootdir po/Makefile.in.in; then
44 echo autopoint honors dataroot variable, not patching.
45 else
46 echo autopoint does not honor dataroot variable, patching.
47 sed -e '/^datadir *=/a\
48 datarootdir = @datarootdir@' po/Makefile.in.in > po/Makefile.in.in.tmp && mv -f po/Makefile.in.in.tmp po/Makefile.in.in
49 sed -e '/^datadir *=/a\
50 datarootdir = @datarootdir@' intl/Makefile.in > intl/Makefile.in.tmp && mv -f intl/Makefile.in.tmp intl/Makefile.in
52 sed -e '/^clean:/a\
53 rm -f *.gmo' po/Makefile.in.in > po/Makefile.in.in.tmp && mv -f po/Makefile.in.in.tmp po/Makefile.in.in
54 # if [ -f Makefile -a -x config.status ]; then
55 # CONFIG_FILES=intl/Makefile CONFIG_HEADERS= /bin/sh ./config.status
56 # fi
57 # gettextize --intl -f --no-changelog
58 # echo "restoring Makefile.am and configure.in"
59 # cp -f Makefile.am~ Makefile.am
60 # cp -f configure.in~ configure.in
61 #fi
63 echo "Running aclocal -I m4"
64 aclocal -I m4
66 echo "Running autoheader"
67 autoheader
69 echo "Running autoconf"
70 autoconf
72 echo "Creating pixmaps Makefile.am"
73 OLDPWD="`pwd`"
74 cd src/pixmaps/flags_xpm
75 ./makeflags.sh
76 cd "$OLDPWD"
78 echo "Running automake --foreign -a -c -f"
79 automake --foreign -a -c -f