autogen.sh 1010 Bytes
Newer Older
oddsock's avatar
oddsock committed
1 2
#!/bin/sh

3 4
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/pkg/bin:/usr/pkg/sbin"

Moritz Grimm's avatar
Moritz Grimm committed
5
_ac_version="2.69"
Moritz Grimm's avatar
Moritz Grimm committed
6
_am_version="1.15"
oddsock's avatar
oddsock committed
7

8 9
if [ ! -f "./$(basename $0)" ]; then
	echo "Please chdir into $(basename $0)'s directory first."
10
	exit 1
oddsock's avatar
oddsock committed
11 12
fi

moritz's avatar
moritz committed
13 14
USE_LIBTOOL="$(grep AC_PROG_LIBTOOL ./configure.* 2> /dev/null)"

15
EXTRA=
16 17 18 19
if [ -d m4 ]; then
	EXTRA="-I m4"
fi

20
if [ -d /usr/local/share/aclocal ]; then
21
	EXTRA="${EXTRA} -I /usr/local/share/aclocal"
22 23
fi

24 25 26 27 28 29
AUTOCONF_VERSION="${_ac_version}" AUTOMAKE_VERSION="${_am_version}" \
	aclocal ${EXTRA} || exit 1
AUTOCONF_VERSION="${_ac_version}" AUTOMAKE_VERSION="${_am_version}" \
	autoconf || exit 1
AUTOCONF_VERSION="${_ac_version}" AUTOMAKE_VERSION="${_am_version}" \
	autoheader || exit 1
moritz's avatar
moritz committed
30 31 32 33
if [ -n "${USE_LIBTOOL}" ]; then
	AUTOCONF_VERSION="${_ac_version}" AUTOMAKE_VERSION="${_am_version}" \
		libtoolize --automake -c -f || exit 1
fi
34 35 36
AUTOCONF_VERSION="${_ac_version}" AUTOMAKE_VERSION="${_am_version}" \
	automake -a -c || exit 1

37
rm -r autom4te.cache
38 39

exit 0