1#!/bin/sh
2
3srcdir=`dirname $0`
4test -z "$srcdir" && srcdir=.
5
6THEDIR=`pwd`
7cd $srcdir
8
9#AM_VERSION="1.10"
10if ! type aclocal-$AM_VERSION 1>/dev/null 2>&1; then
11	# automake-1.10 (recommended) is not available on Fedora 8
12	AUTOMAKE=automake
13	ACLOCAL=aclocal
14else
15	ACLOCAL=aclocal-${AM_VERSION}
16	AUTOMAKE=automake-${AM_VERSION}
17fi
18
19INTLTOOLIZE=$(which intltoolize)
20
21#workaround for mingw bug in intltoolize script.
22if test "$INTLTOOLIZE" = "/bin/intltoolize" ; then
23	INTLTOOLIZE=/usr/bin/intltoolize
24fi
25
26libtoolize="libtoolize"
27for lt in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do
28	if test -x /usr/bin/$lt ; then
29		libtoolize=$lt ; break
30	fi
31	if test -x /usr/local/bin/$lt ; then
32		libtoolize=$lt ; break
33	fi
34	if test -x /opt/local/bin/$lt ; then
35		libtoolize=$lt ; break
36	fi
37done
38
39if test -d /usr/local/share/aclocal ; then
40	ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal"
41fi
42
43if test -d /share/aclocal ; then
44	ACLOCAL_ARGS="$ACLOCAL_ARGS -I /share/aclocal"
45fi
46
47echo "Generating build scripts in mediastreamer..."
48set -x
49$libtoolize --copy --force
50$INTLTOOLIZE --copy --force --automake
51$ACLOCAL -I m4 $ACLOCAL_ARGS
52autoheader
53$AUTOMAKE --force-missing --add-missing --copy
54autoconf
55
56#install git pre-commit hooks if possible
57if [ -d .git/hooks ] && [ ! -f .git/hooks/pre-commit ]; then
58	cp .git-pre-commit .git/hooks/pre-commit
59	chmod +x .git/hooks/pre-commit
60fi
61
62cd $THEDIR
63