Merge commit 'origin/mc-4.6'
[free-mc.git] / autogen.sh
bloba2b4f9247496b3892cec8fe703d6ebce3c49e49f
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 : ${XGETTEXT=xgettext}
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 # Recreate intl directory.
32 rm -rf intl
33 $AUTOPOINT --force || exit 1
35 # Generate po/POTFILES.in
36 $XGETTEXT --keyword=_ --keyword=N_ --keyword=Q_ --output=- \
37 `find . -name '*.[ch]'` | sed -ne '/^#:/{s/#://;s/:[0-9]*/\
38 /g;s/ //g;p;}' | \
39 grep -v '^$' | sort | uniq | grep -v 'regex.c' >po/POTFILES.in
41 ACLOCAL_INCLUDES="-I m4"
43 # Some old version of GNU build tools fail to set error codes.
44 # Check that they generate some of the files they should.
46 $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS
47 test -f aclocal.m4 || \
48 { echo "aclocal failed to generate aclocal.m4" >&2; exit 1; }
50 $AUTOHEADER || exit 1
51 test -f config.h.in || \
52 { echo "autoheader failed to generate config.h.in" >&2; exit 1; }
54 $AUTOCONF || exit 1
55 test -f configure || \
56 { echo "autoconf failed to generate configure" >&2; exit 1; }
58 # Workaround for Automake 1.5 to ensure that depcomp is distributed.
59 if test "`$AUTOMAKE --version|awk '{print $NF;exit}'`" = '1.5' ; then
60 $AUTOMAKE -a src/Makefile
62 $AUTOMAKE -a
63 test -f Makefile.in || \
64 { echo "automake failed to generate Makefile.in" >&2; exit 1; }
66 cd vfs/samba
67 date -u >include/stamp-h.in
69 $AUTOHEADER
70 test -f include/config.h.in || \
71 { echo "autoheader failed to generate vfs/samba/include/config.h.in" >&2; exit 1; }
73 $AUTOCONF
74 test -f configure || \
75 { echo "autoconf failed to generate vfs/samba/configure" >&2; exit 1; }
76 ) || exit 1
78 if test -x $srcdir/configure.mc; then
79 $srcdir/configure.mc "$@"
80 else
81 $srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"