* dir.c (handle_dirent): Use MSG_ERROR.
[midnight-commander.git] / autogen.sh
blob0f25bebf2724699b0688bc0e853307655e583c19
1 #! /bin/sh
2 # Run this to generate all the initial makefiles, etc.
4 # Make it possible to specify path in the environment
5 : ${AUTOCONF=autoconf}
6 : ${AUTOHEADER=autoheader}
7 : ${AUTOMAKE=automake}
8 : ${ACLOCAL=aclocal}
9 : ${GETTEXTIZE=gettextize}
11 srcdir=`dirname $0`
12 test -z "$srcdir" && srcdir=.
15 cd $srcdir
17 # The autoconf cache (version after 2.52) is not reliable yet.
18 rm -rf autom4te.cache vfs/samba/autom4te.cache
20 # Ensure that gettext is reasonably new.
21 gettext_ver=`$GETTEXTIZE --version | sed -n '1s/^.* //p'`
23 case $gettext_ver in
24 0.10.3[89]) ;;
25 *) echo "Don't use gettext other than versions 0.10.38 and 0.10.39"
26 exit 1;;
27 esac
29 rm -rf intl
30 $GETTEXTIZE --copy --force >tmpout || exit 1
31 rm -f po/ChangeLog
32 mv po/ChangeLog~ po/ChangeLog
34 if test ! -d config; then
35 mkdir config || exit 1
38 rm -f aclocal.m4
39 if test -f `aclocal --print-ac-dir`/gettext.m4; then
40 : # gettext macro files are available to aclocal.
41 else
42 # gettext macro files are not available.
43 # Find them and copy to a local directory.
44 # Ugly way to parse the instructions gettexize gives us.
45 m4files="`cat tmpout | sed -n -e '/^Please/,/^from/s/^ *//p'`"
46 fromdir=`cat tmpout | sed -n -e '/^Please/,/^from/s/^from the \([^ ]*\) .*$/\1/p'`
47 rm tmpout
48 rm -rf gettext.m4
49 mkdir gettext.m4
50 for i in $m4files; do
51 cp -f $fromdir/$i gettext.m4
52 done
53 ACLOCAL_INCLUDES="-I gettext.m4"
56 # Some old version of GNU build tools fail to set error codes.
57 # Check that they generate some of the files they should.
59 $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS || exit 1
60 test -f aclocal.m4 || \
61 { echo "aclocal failed to generate aclocal.m4" 2>&1; exit 1; }
63 $AUTOHEADER || exit 1
64 test -f config.h.in || \
65 { echo "autoheader failed to generate config.h.in" 2>&1; exit 1; }
67 $AUTOCONF || exit 1
68 test -f configure || \
69 { echo "autoconf failed to generate configure" 2>&1; exit 1; }
71 # Workaround for Automake 1.5 to ensure that depcomp is distributed.
72 $AUTOMAKE -a src/Makefile || exit 1
73 $AUTOMAKE -a || exit 1
74 test -f Makefile.in || \
75 { echo "automake failed to generate Makefile.in" 2>&1; exit 1; }
77 cd vfs/samba || exit 1
78 date -u >include/stamp-h.in
80 $AUTOHEADER || exit 1
81 test -f include/config.h.in || \
82 { echo "autoheader failed to generate vfs/samba/include/config.h.in" 2>&1; exit 1; }
84 $AUTOCONF || exit 1
85 test -f configure || \
86 { echo "autoconf failed to generate vfs/samba/configure" 2>&1; exit 1; }
87 ) || exit 1
89 $srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"