summaryrefslogtreecommitdiff
path: root/autogen.sh
blob: 4da1c1ffe51f4dbdd60f22702c99b68f97095096 (plain)
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
#!/bin/sh
set -e

if test -n "$AUTOMAKE"; then
    : # don't override an explicit user request
elif automake-1.11 --version >/dev/null 2>/dev/null && \
     aclocal-1.11 --version >/dev/null 2>/dev/null; then
    # If we have automake-1.11, use it. This is the oldest version (=> least
    # likely to introduce undeclared dependencies) that will give us
    # --enable-silent-rules support.
    AUTOMAKE=automake-1.11
    export AUTOMAKE
    ACLOCAL=aclocal-1.11
    export ACLOCAL
fi

autoreconf -i -f

#Check if building submodules
build_submodules=true
for arg in $*; do
    case $arg in
    --disable-submodules)
    build_submodules=false
    ;;
*)
;;
esac
done

if test $build_submodules = true; then
    # Fetch Wocky if needed
    if test ! -f lib/ext/wocky/autogen.sh;
    then
    echo "+ Setting up Wocky submodule"
    git submodule init
    fi
    git submodule update

    # launch Wocky's autogen.sh
    cd lib/ext/wocky
    sh autogen.sh --no-configure
    cd ../../..
fi

run_configure=true
for arg in $*; do
    case $arg in
        --no-configure)
            run_configure=false
            ;;
        *)
            ;;
    esac
done

if test $run_configure = true; then
    ./configure "$@"
fi