forked from syslog-ng/syslog-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·81 lines (66 loc) · 2.06 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
#!/bin/sh
#
# This script is needed to setup build environment from checked out
# source tree.
#
SUBMODULES="lib/ivykis modules/afmongodb/libmongo-client modules/afamqp/rabbitmq-c lib/jsonc"
GIT=`which git`
autogen_submodules()
{
origdir=`pwd`
submod_initialized=1
for submod in $SUBMODULES; do
if [ ! -f $submod/configure.gnu ]; then
submod_initialized=0
fi
done
if [ -n "$GIT" ] && [ -f .gitmodules ] && [ -d .git ] && [ $submod_initialized = 0 ]; then
# only clone submodules if none of them present
git submodule update --init
sed -e "s#git://#https://#" \
< modules/afamqp/rabbitmq-c/.gitmodules \
> modules/afamqp/rabbitmq-c/.gitmodules.new && \
mv modules/afamqp/rabbitmq-c/.gitmodules.new modules/afamqp/rabbitmq-c/.gitmodules
git submodule update --init --recursive
fi
for submod in $SUBMODULES; do
echo "Running autogen in '$submod'..."
cd "$submod"
if [ -x autogen.sh ]; then
./autogen.sh
elif [ -f configure.in ] || [ -f configure.ac ]; then
autoreconf -i
else
echo "Don't know how to bootstrap submodule '$submod'" >&2
exit 1
fi
CONFIGURE_OPTS="--disable-shared --enable-static --with-pic"
cat >configure.gnu <<EOF
#!/bin/sh
CONFIGURE_OPTS="${CONFIGURE_OPTS}"
echo \$0
configure="\`dirname \$0\`/\`basename \$0 .gnu\`"
echo "Running: " \$configure \$@ \$CONFIGURE_OPTS
\$SHELL \$configure "\$@" \$CONFIGURE_OPTS
EOF
cd "$origdir"
done
}
if [ -z "$skip_submodules" ] || [ "$skip_modules" = 0 ]; then
autogen_submodules
fi
# bootstrap syslog-ng itself
libtoolize --force --copy
aclocal -I m4 --install
sed -i -e 's/PKG_PROG_PKG_CONFIG(\[0\.16\])/PKG_PROG_PKG_CONFIG([0.14])/g' aclocal.m4
autoheader
automake --foreign --add-missing --copy
autoconf
if grep AX_PREFIX_CONFIG_H configure > /dev/null; then
cat <<EOF
You need autoconf-archive http://savannah.gnu.org/projects/autoconf-archive/
installed in order to generate the configure script, e.g:
apt-get install autoconf-archive
EOF
exit 1
fi