Upstream tarball 20080604
[amule.git] / autogen.sh
blob206cf584061ba2431b298696a79268259ad1975f
1 #!/bin/sh
2 # Helps bootstrapping 'aMule' when checked out from CVS.
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 CVS (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 CVS (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 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\
47 datadir = @datadir@/g' po/Makefile.in.in > po/Makefile.in.in.tmp && mv -f po/Makefile.in.in.tmp po/Makefile.in.in
48 sed -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\
49 datadir = @datadir@/g' intl/Makefile.in > intl/Makefile.in.tmp && mv -f intl/Makefile.in.tmp intl/Makefile.in
51 # if [ -f Makefile -a -x config.status ]; then
52 # CONFIG_FILES=intl/Makefile CONFIG_HEADERS= /bin/sh ./config.status
53 # fi
54 # gettextize --intl -f --no-changelog
55 # echo "restoring Makefile.am and configure.in"
56 # cp -f Makefile.am~ Makefile.am
57 # cp -f configure.in~ configure.in
58 #fi
60 echo "Running aclocal -I m4"
61 aclocal -I m4
63 echo "Running autoheader"
64 autoheader
66 echo "Running autoconf"
67 autoconf
69 echo "Creating pixmaps Makefile.am"
70 pushd $(pwd) > /dev/null
71 cd src/pixmaps/flags_xpm
72 ./makeflags.sh
73 popd > /dev/null
75 echo "Running automake --foreign -a -c -f"
76 automake --foreign -a -c -f