autogen.sh 1.36 KB
Newer Older
aymeric's avatar
aymeric committed
1 2
#!/bin/sh

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

THEDIR=`pwd`
cd $srcdir

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

19
INTLTOOLIZE=$(which intltoolize)
Simon Morlat's avatar
Simon Morlat committed
20

Simon Morlat's avatar
Simon Morlat committed
21 22 23 24 25
#workaround for mingw bug in intltoolize script.
if test "$INTLTOOLIZE" = "/bin/intltoolize" ; then
	INTLTOOLIZE=/usr/bin/intltoolize
fi

26 27
libtoolize="libtoolize"
for lt in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do
28 29 30 31 32 33 34 35 36
	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
37
done
38

39
if test -d /usr/local/share/aclocal ; then
40 41 42 43
	ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal"
fi

if test -d /share/aclocal ; then
44
	ACLOCAL_ARGS="$ACLOCAL_ARGS -I /share/aclocal"
45
fi
46

aymeric's avatar
aymeric committed
47 48
echo "Generating build scripts in mediastreamer..."
set -x
49
$libtoolize --copy --force
Simon Morlat's avatar
Simon Morlat committed
50
$INTLTOOLIZE --copy --force --automake
Yann Diorcet's avatar
Yann Diorcet committed
51
$ACLOCAL -I m4 $ACLOCAL_ARGS
52
autoheader
53
$AUTOMAKE --force-missing --add-missing --copy
aymeric's avatar
aymeric committed
54
autoconf
55

56 57 58 59 60 61
#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

62
cd $THEDIR