forked from didier-barvaux/rohc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·98 lines (86 loc) · 2.68 KB
/
autogen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh
#
# Copyright 2007,2009-2010,2013 Viveris Technologies
# Copyright 2011-2014 Didier Barvaux
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script to generate all required files for `configure' when
# starting from a fresh repository checkout.
run()
{
binary_name="$1"
shift
args="$@"
echo -n "Running ${binary_name}... "
binary_path=$( which ${binary_name} 2>/dev/null )
if [ -z "$binary_path" ] || [ ! -x "$binary_path" ] ; then
echo "failed"
echo "Command ${binary_name} not found, please install it"
exit 1
fi
$binary_path $args >/dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "done"
else
echo "failed"
echo "Running ${binary_name} again with errors unmasked:"
$binary_path $args
exit 1
fi
}
rm -f config.cache
rm -f config.log
OLD_PWD="$PWD"
NEW_PWD="`dirname $0`"
cd "${NEW_PWD}" >/dev/null
run aclocal
run libtoolize --force
run autoconf
run autoheader
run automake --add-missing --force-missing
cd "${OLD_PWD}" >/dev/null
# autodetect some dev options
add_opts=""
doxygen="$( which doxygen 2>/dev/null )"
if [ $? -eq 0 ] && [ "x${doxygen}" != "x" ] && [ -x "${doxygen}" ] ; then
dot="$( which dot 2>/dev/null )"
if [ $? -eq 0 ] && [ "x${dot}" != "x" ] && [ -x "${dot}" ] ; then
add_opts="${add_opts} --enable-doc"
fi
fi
doxy2man="$( which doxy2man 2>/dev/null )"
if [ $? -eq 0 ] && [ "x${doxy2man}" != "x" ] && [ -x "${doxy2man}" ] ; then
add_opts="${add_opts} --enable-doc-man"
fi
if [ "${USE_VALGRIND}" = yes ] ; then
add_opts="${add_opts} --enable-rohc-tests-valgrind"
fi
if [ -e "/lib/modules/`uname -r`/build" ] ; then
add_opts="${add_opts} --enable-linux-kernel-module"
fi
# run configure with failure on compiler warnings enabled since autogen.sh
# is for developpers not users, also enable tests, stats, doc and examples.
chmod +x ${NEW_PWD}/configure
${NEW_PWD}/configure \
--enable-rohc-debug \
--enable-fail-on-warning \
--enable-fortify-sources \
--enable-app-sniffer \
--enable-app-stats \
--enable-rohc-tests \
--enable-examples \
${add_opts} \
$@