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

gtkdocize || exit 1

if test -n "$AUTOMAKE"; then
    : # don't override an explicit user request
elif automake-1.9 --version >/dev/null 2>/dev/null && \
     aclocal-1.9 --version >/dev/null 2>/dev/null; then
    # If we have automake-1.9, use it. This helps to ensure that our build
    # system doesn't accidentally grow automake-1.10 dependencies.
    AUTOMAKE=automake-1.9
    export AUTOMAKE
    ACLOCAL=aclocal-1.9
    export ACLOCAL
fi

autoreconf -i -f

# Workaround for gtk-doc + shave + libtool 1.x
# See http://git.lespiau.name/cgit/shave/tree/README#n83
sed -e 's#) --mode=compile#) --tag=CC --mode=compile#' gtk-doc.make \
                > gtk-doc.temp \
        && mv gtk-doc.temp gtk-doc.make
sed -e 's#) --mode=link#) --tag=CC --mode=link#' gtk-doc.make \
                > gtk-doc.temp \
        && mv gtk-doc.temp gtk-doc.make

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