Bump EC version for release
[amule.git] / autogen.sh
blob5be15953cb3073ce728a5e6283de8693da6ac3b5
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 UNAME=`uname`
53 if [ x$UNAME = x"Darwin" ]; then
54 echo Not patching po/Makefile.in.in - sed is too old.
55 else
56 sed -e '/^clean:/a\
57 rm -f *.gmo' po/Makefile.in.in > po/Makefile.in.in.tmp && mv -f po/Makefile.in.in.tmp po/Makefile.in.in
59 # if [ -f Makefile -a -x config.status ]; then
60 # CONFIG_FILES=intl/Makefile CONFIG_HEADERS= /bin/sh ./config.status
61 # fi
62 # gettextize --intl -f --no-changelog
63 # echo "restoring Makefile.am and configure.in"
64 # cp -f Makefile.am~ Makefile.am
65 # cp -f configure.in~ configure.in
66 #fi
68 echo "Running aclocal -I m4"
69 aclocal -I m4
71 echo "Running autoheader"
72 autoheader
74 echo "Running autoconf"
75 autoconf
77 echo "Creating pixmaps Makefile.am"
78 OLDPWD="`pwd`"
79 cd src/pixmaps/flags_xpm
80 ./makeflags.sh
81 cd "$OLDPWD"
83 echo "Running automake --foreign -a -c -f"
84 automake --foreign -a -c -f