*** empty log message ***
[midnight-commander.git] / autogen.sh
blob0b440e6c5a547372eac7abbf3ea49d4021e747f6
1 #! /bin/sh
2 # Run this to generate all the initial makefiles, etc.
4 # Don't ignore errors.
5 set -e
7 # Make it possible to specify path in the environment
8 : ${AUTOCONF=autoconf}
9 : ${AUTOHEADER=autoheader}
10 : ${AUTOMAKE=automake}
11 : ${ACLOCAL=aclocal}
12 : ${GETTEXTIZE=gettextize}
13 : ${AUTOPOINT=autopoint}
15 srcdir=`dirname $0`
16 test -z "$srcdir" && srcdir=.
19 # Some shells don't propagate "set -e" to subshells.
20 set -e
22 cd $srcdir
24 # The autoconf cache (version after 2.52) is not reliable yet.
25 rm -rf autom4te.cache vfs/samba/autom4te.cache
27 if test ! -d config; then
28 mkdir config
31 # Ensure that gettext is reasonably new.
32 gettext_ver=`$GETTEXTIZE --version | sed -n '1s/\.//g;1s/.* //;1s/^\(...\)$/\100/;1s/^\(...\)\(.\)$/\10\2/;1p'`
33 if test $gettext_ver -lt 01038; then
34 echo "Don't use gettext older than 0.10.38" 2>&1
35 exit 1
38 rm -rf intl
39 if test $gettext_ver -ge 01100; then
40 if test $gettext_ver -lt 01105; then
41 echo "Upgrade gettext to at least 0.11.5 or downgrade to 0.10.40" 2>&1
42 exit 1
44 $AUTOPOINT
45 else
46 $GETTEXTIZE --copy --force
47 if test -e po/ChangeLog~; then
48 rm -f po/ChangeLog
49 mv po/ChangeLog~ po/ChangeLog
53 ACLOCAL_INCLUDES="-I m4"
55 # Some old version of GNU build tools fail to set error codes.
56 # Check that they generate some of the files they should.
58 $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS
59 test -f aclocal.m4 || \
60 { echo "aclocal failed to generate aclocal.m4" 2>&1; exit 1; }
62 $AUTOHEADER || exit 1
63 test -f config.h.in || \
64 { echo "autoheader failed to generate config.h.in" 2>&1; exit 1; }
66 $AUTOCONF || exit 1
67 test -f configure || \
68 { echo "autoconf failed to generate configure" 2>&1; exit 1; }
70 # Workaround for Automake 1.5 to ensure that depcomp is distributed.
71 $AUTOMAKE -a src/Makefile
72 $AUTOMAKE -a
73 test -f Makefile.in || \
74 { echo "automake failed to generate Makefile.in" 2>&1; exit 1; }
76 cd vfs/samba
77 date -u >include/stamp-h.in
79 $AUTOHEADER
80 test -f include/config.h.in || \
81 { echo "autoheader failed to generate vfs/samba/include/config.h.in" 2>&1; exit 1; }
83 $AUTOCONF
84 test -f configure || \
85 { echo "autoconf failed to generate vfs/samba/configure" 2>&1; exit 1; }
86 ) || exit 1
88 $srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"