autogen.sh 1.24 KB
Newer Older
1 2
#!/bin/sh

3 4 5 6 7 8 9
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

THEDIR=`pwd`
cd $srcdir

#AM_VERSION="1.10"
10 11 12 13 14 15 16 17 18
if ! type aclocal-$AM_VERSION 1>/dev/null 2>&1; then
	# automake-1.10 (recommended) is not available on Fedora 8
	AUTOMAKE=automake
	ACLOCAL=aclocal
else
	ACLOCAL=aclocal-${AM_VERSION}
	AUTOMAKE=automake-${AM_VERSION}
fi

19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
libtoolize="libtoolize"
for lt in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do
        if test -x /usr/bin/$lt ; then
                libtoolize=$lt ; break
        fi
        if test -x /usr/local/bin/$lt ; then
                libtoolize=$lt ; break
        fi
        if test -x /opt/local/bin/$lt ; then
                libtoolize=$lt ; break
        fi
done

if test -d /usr/local/share/aclocal ; then
	ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal"
34 35
fi

Simon Morlat's avatar
Simon Morlat committed
36
if test -d /share/aclocal ; then
37
        ACLOCAL_ARGS="$ACLOCAL_ARGS -I /share/aclocal"
Simon Morlat's avatar
Simon Morlat committed
38 39
fi

40
set -x
41 42 43
rm -rf config.cache autom4te.cache
$libtoolize --copy --force
$ACLOCAL -I m4 $ACLOCAL_ARGS
44 45 46 47
autoheader
$AUTOMAKE --force-missing --add-missing --copy
autoconf

48 49 50 51 52
#install git pre-commit hooks if possible
if [ -d .git/hooks ] && [ ! -f .git/hooks/pre-commit ]; then
        cp .git-pre-commit .git/hooks/pre-commit
        chmod +x .git/hooks/pre-commit
fi
53 54

cd $THEDIR