Ticket #1885: minimal gettext version is 0.18.1.
[midnight-commander.git] / autogen.sh
blob9ef0135af8e420cb96aa14c96a4c1006ddd4f5dd
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 : ${AUTOPOINT=autopoint}
13 : ${LIBTOOLIZE=libtoolize}
14 : ${XGETTEXT=xgettext}
16 srcdir=`dirname $0`
17 test -z "$srcdir" && srcdir=.
21 # Some shells don't propagate "set -e" to subshells.
22 set -e
24 cd "$srcdir"
26 # The autoconf cache (version after 2.52) is not reliable yet.
27 rm -rf autom4te.cache src/vfs/smbfs/helpers/autom4te.cache
29 if test ! -d config; then
30 mkdir config
33 # Recreate intl directory.
34 rm -rf intl
35 $AUTOPOINT --force || exit 1
37 # Generate po/POTFILES.in
38 $XGETTEXT --keyword=_ --keyword=N_ --keyword=Q_ --output=- \
39 `find . -name '*.[ch]'` | sed -ne '/^#:/{s/#://;s/:[0-9]*/\
40 /g;s/ //g;p;}' | \
41 grep -v '^$' | sort | uniq >po/POTFILES.in
43 $LIBTOOLIZE
45 ACLOCAL_INCLUDES="-I m4"
47 # Some old version of GNU build tools fail to set error codes.
48 # Check that they generate some of the files they should.
50 $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS
51 test -f aclocal.m4 || \
52 { echo "aclocal failed to generate aclocal.m4" >&2; exit 1; }
54 $AUTOHEADER || exit 1
55 test -f config.h.in || \
56 { echo "autoheader failed to generate config.h.in" >&2; exit 1; }
58 $AUTOCONF || exit 1
59 test -f configure || \
60 { echo "autoconf failed to generate configure" >&2; exit 1; }
62 # Workaround for Automake 1.5 to ensure that depcomp is distributed.
63 if test "`$AUTOMAKE --version|awk '{print $NF;exit}'`" = '1.5' ; then
64 $AUTOMAKE -a src/Makefile
66 $AUTOMAKE -a
67 test -f Makefile.in || \
68 { echo "automake failed to generate Makefile.in" >&2; exit 1; }
70 cd src/vfs/smbfs/helpers
71 date -u >include/stamp-h.in
73 $AUTOHEADER
74 test -f include/config.h.in || \
75 { echo "autoheader failed to generate src/vfs/smbfs/helpers/include/config.h.in" >&2; exit 1; }
77 $AUTOCONF
78 test -f configure || \
79 { echo "autoconf failed to generate src/vfs/smbfs/helpers/configure" >&2; exit 1; }
80 ) || exit 1
82 $srcdir/maint/utils/version.sh "$srcdir"
84 if test -x $srcdir/configure.mc; then
85 $srcdir/configure.mc "$@"