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

Ghislain MARY's avatar
Ghislain MARY committed
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 20 21 22 23 24 25 26 27 28 29 30
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
31

32
if test -d /opt/local/share/aclocal ; then
33
		ACLOCAL_ARGS="-I /opt/local/share/aclocal"
34 35
fi

36
if test -d /share/aclocal ; then
37
		ACLOCAL_ARGS="$ACLOCAL_ARGS -I /share/aclocal"
38 39
fi

40
INTLTOOLIZE=$(which intltoolize)
41

Simon Morlat's avatar
Simon Morlat committed
42 43 44 45 46
#workaround for mingw bug in intltoolize script.
if test "$INTLTOOLIZE" = "/bin/intltoolize" ; then
	INTLTOOLIZE=/usr/bin/intltoolize
fi

aymeric's avatar
aymeric committed
47 48
echo "Generating build scripts in linphone..."
set -x
49
$LIBTOOLIZE --copy --force
50

51
$INTLTOOLIZE -c --force --automake
52 53
$ACLOCAL -I m4 $ACLOCAL_ARGS
autoheader
54
$AUTOMAKE --force-missing --add-missing --copy
aymeric's avatar
aymeric committed
55 56
autoconf

Ghislain MARY's avatar
Ghislain MARY committed
57
set +x
58 59 60 61 62 63 64

#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

Ghislain MARY's avatar
Ghislain MARY committed
65 66 67 68 69
if [ "$srcdir" = "." ]; then
	if [ -x oRTP/autogen.sh ]; then
		echo "Generating build scripts in oRTP..."
		( cd oRTP && ./autogen.sh )
	fi
aymeric's avatar
aymeric committed
70

Ghislain MARY's avatar
Ghislain MARY committed
71 72 73 74
	if [ -x mediastreamer2/autogen.sh ]; then
		echo "Generating build scripts in mediastreamer2..."
		( cd mediastreamer2 && ./autogen.sh )
	fi
75
fi
Ghislain MARY's avatar
Ghislain MARY committed
76 77

cd $THEDIR