Upstream tarball 20080929
[amule.git] / autogen.sh
blob0cc89c519358344cce479004dd67fe6571d1ffe4
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 export WANT_AUTOMAKE="1.7"
6 (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
7 (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
9 # Do sanity checks.
10 # Directory check.
11 if [ ! -e src/SharedFileList.h ]; then
12 echo "Run ./autogen.sh from the base directory of aMule."
13 exit 1
16 # Determine the version of automake.
17 automake_version=`automake --version | head -n 1 | sed -e 's/[^12]*\([12]\.[0-9]+[^ ]*\).*/\1/'`
19 # Require automake 1.7.
20 if expr "1.7" \> "$automake_version" >/dev/null; then
21 automake --version | head -n 1
22 echo "Fatal error: automake version 1.7 or higher is required."
23 exit 1
26 # Determine version of gettext.
27 gettext_version=`gettext --version | head -n 1 | sed -e 's/[^0]*\(0\.[0-9][^ ]*\).*/\1/'`
28 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`
30 # Require version as specified in configure.in.
31 if expr "$confver" \> "$gettext_version" >/dev/null; then
32 gettext --version | head -n 1
33 echo "Fatal error: gettext version "$confver" or higher is required."
34 exit 1
37 # Force intl regenration to get last update from installed gettext templates
38 rm -rf intl/*
39 #if [ ! -d intl ]; then
40 echo "Setting up internationalization files."
41 autopoint --force
42 if grep -q datarootdir po/Makefile.in.in; then
43 echo autopoint honors dataroot variable, not patching.
44 else
45 echo autopoint does not honor dataroot variable, patching.
46 sed -e '/^datadir *=/a\
47 datarootdir = @datarootdir@' po/Makefile.in.in > po/Makefile.in.in.tmp && mv -f po/Makefile.in.in.tmp po/Makefile.in.in
48 sed -e '/^datadir *=/a\
49 datarootdir = @datarootdir@' intl/Makefile.in > intl/Makefile.in.tmp && mv -f intl/Makefile.in.tmp intl/Makefile.in
51 sed -e '/^clean:/a\
52 rm -f *.gmo' po/Makefile.in.in > po/Makefile.in.in.tmp && mv -f po/Makefile.in.in.tmp po/Makefile.in.in
53 # if [ -f Makefile -a -x config.status ]; then
54 # CONFIG_FILES=intl/Makefile CONFIG_HEADERS= /bin/sh ./config.status
55 # fi
56 # gettextize --intl -f --no-changelog
57 # echo "restoring Makefile.am and configure.in"
58 # cp -f Makefile.am~ Makefile.am
59 # cp -f configure.in~ configure.in
60 #fi
62 echo "Running aclocal -I m4"
63 aclocal -I m4
65 echo "Running autoheader"
66 autoheader
68 echo "Running autoconf"
69 autoconf
71 echo "Creating pixmaps Makefile.am"
72 pushd $(pwd) > /dev/null
73 cd src/pixmaps/flags_xpm
74 ./makeflags.sh
75 popd > /dev/null
77 echo "Running automake --foreign -a -c -f"
78 automake --foreign -a -c -f