Updated Italian translation.
[midnight-commander.git] / autogen.sh
blob2e57704082359a3e063bacaee30935190d43264e
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 | \
33 sed '2,$d; # remove all but the first line
34 s/.* //; # take text after the last space
35 s/-.*//; # strip "-pre" or "-rc" at the end
36 s/\([^.][^.]*\)/0\1/g; # prepend 0 to every token
37 s/0\([^.][^.]\)/\1/g; # strip leading 0 from long tokens
38 s/$/.00.00/; # add .00.00 for short version strings
39 s/\.//g; # remove dots
40 s/\(......\).*/\1/; # leave only 6 leading digits
43 if test $gettext_ver -lt 01038; then
44 echo "Don't use gettext older than 0.10.38" 2>&1
45 exit 1
48 rm -rf intl
49 if test $gettext_ver -ge 01100; then
50 if test $gettext_ver -lt 01105; then
51 echo "Upgrade gettext to at least 0.11.5 or downgrade to 0.10.40" 2>&1
52 exit 1
54 $AUTOPOINT --force || exit 1
55 else
56 $GETTEXTIZE --copy --force || exit 1
57 if test -e po/ChangeLog~; then
58 rm -f po/ChangeLog
59 mv po/ChangeLog~ po/ChangeLog
63 ACLOCAL_INCLUDES="-I m4"
65 # Some old version of GNU build tools fail to set error codes.
66 # Check that they generate some of the files they should.
68 $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS
69 test -f aclocal.m4 || \
70 { echo "aclocal failed to generate aclocal.m4" 2>&1; exit 1; }
72 $AUTOHEADER || exit 1
73 test -f config.h.in || \
74 { echo "autoheader failed to generate config.h.in" 2>&1; exit 1; }
76 $AUTOCONF || exit 1
77 test -f configure || \
78 { echo "autoconf failed to generate configure" 2>&1; exit 1; }
80 # Workaround for Automake 1.5 to ensure that depcomp is distributed.
81 $AUTOMAKE -a src/Makefile
82 $AUTOMAKE -a
83 test -f Makefile.in || \
84 { echo "automake failed to generate Makefile.in" 2>&1; exit 1; }
86 cd vfs/samba
87 date -u >include/stamp-h.in
89 $AUTOHEADER
90 test -f include/config.h.in || \
91 { echo "autoheader failed to generate vfs/samba/include/config.h.in" 2>&1; exit 1; }
93 $AUTOCONF
94 test -f configure || \
95 { echo "autoconf failed to generate vfs/samba/configure" 2>&1; exit 1; }
96 ) || exit 1
98 if test -x $srcdir/configure.mc; then
99 $srcdir/configure.mc "$@"
100 else
101 $srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"