autogen.sh 2.45 KB
Newer Older
aymeric's avatar
aymeric committed
1
#!/bin/sh
Simon Morlat's avatar
Simon Morlat committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
##
## Copyright (c) 2010-2019 Belledonne Communications SARL.
##
## This file is part of Liblinphone.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
aymeric's avatar
aymeric committed
20

Ghislain MARY's avatar
Ghislain MARY committed
21 22 23 24 25 26
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

THEDIR=`pwd`
cd $srcdir

jehan's avatar
jehan committed
27
#AM_VERSION="1.10"
aymeric's avatar
aymeric committed
28
if ! type aclocal-$AM_VERSION 1>/dev/null 2>&1; then
smorlat's avatar
smorlat committed
29
	# automake-1.10 (recommended) is not available on Fedora 8
aymeric's avatar
aymeric committed
30 31 32 33 34 35 36
	AUTOMAKE=automake
	ACLOCAL=aclocal
else
	ACLOCAL=aclocal-${AM_VERSION}
	AUTOMAKE=automake-${AM_VERSION}
fi

37 38 39 40 41 42 43 44 45 46 47 48
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
49

smorlat's avatar
smorlat committed
50
if test -d /opt/local/share/aclocal ; then
51
		ACLOCAL_ARGS="-I /opt/local/share/aclocal"
smorlat's avatar
smorlat committed
52 53
fi

54
if test -d /share/aclocal ; then
55
		ACLOCAL_ARGS="$ACLOCAL_ARGS -I /share/aclocal"
56 57
fi

58
INTLTOOLIZE=$(which intltoolize)
smorlat's avatar
smorlat committed
59

Simon Morlat's avatar
Simon Morlat committed
60 61 62 63 64
#workaround for mingw bug in intltoolize script.
if test "$INTLTOOLIZE" = "/bin/intltoolize" ; then
	INTLTOOLIZE=/usr/bin/intltoolize
fi

aymeric's avatar
aymeric committed
65 66
echo "Generating build scripts in linphone..."
set -x
smorlat's avatar
smorlat committed
67
$LIBTOOLIZE --copy --force
68

69
$INTLTOOLIZE -c --force --automake
smorlat's avatar
smorlat committed
70 71
$ACLOCAL -I m4 $ACLOCAL_ARGS
autoheader
72
$AUTOMAKE --force-missing --add-missing --copy
aymeric's avatar
aymeric committed
73 74
autoconf

Ghislain MARY's avatar
Ghislain MARY committed
75
set +x
76 77 78 79 80 81 82

#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
83 84 85 86 87
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
88

Ghislain MARY's avatar
Ghislain MARY committed
89 90 91 92
	if [ -x mediastreamer2/autogen.sh ]; then
		echo "Generating build scripts in mediastreamer2..."
		( cd mediastreamer2 && ./autogen.sh )
	fi
93
fi
Ghislain MARY's avatar
Ghislain MARY committed
94 95

cd $THEDIR