* Make-mc.in: Include necessary parts of Make.common to
[midnight-commander.git] / autogen.sh
blob0afeff3afb8fbea649b356fd3f59a180d34b73a9
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 # Ensure that gettext is reasonably new.
18 gettext_ver=`$GETTEXTIZE --version | sed -n '1s/^.* //p'`
20 case $gettext_ver in
21 0.10.3[89]) ;;
22 *) echo "Don't use gettext other than versions 0.10.38 and 0.10.39"
23 exit 1;;
24 esac
26 rm -rf intl
27 $GETTEXTIZE --copy --force >tmpout || exit 1
28 rm -f po/ChangeLog
29 mv po/ChangeLog~ po/ChangeLog
31 # Ugly way to parse the instructions gettexize gives us.
32 m4files="`cat tmpout | sed -n -e '/^Please/,/^from/s/^ *//p'`"
33 fromdir=`cat tmpout | sed -n -e '/^Please/,/^from/s/^from the \([^ ]*\) .*$/\1/p'`
34 rm tmpout
35 rm -rf gettext.m4
36 mkdir gettext.m4
37 for i in $m4files; do
38 cp -f $fromdir/$i gettext.m4
39 done
41 $ACLOCAL -I gettext.m4 $ACLOCAL_FLAGS || \
42 $ACLOCAL $ACLOCAL_FLAGS || \
43 exit 1
44 $AUTOHEADER || exit 1
45 $AUTOCONF || exit 1
46 $AUTOMAKE -a || exit 1
48 cd vfs/samba || exit 1
49 date -u >include/stamp-h.in
50 $AUTOHEADER || exit 1
51 $AUTOCONF || exit 1
52 ) || exit 1
54 $srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"