summaryrefslogtreecommitdiff
path: root/build.sh
blob: 2083e36ded45aa6134a6768d32e117a4e6be9672 (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
#!/bin/sh
#autoreconf --install

# Thanks, https://github.com/raywill/automake

export AUTOM4TE="autom4te"
export AUTOCONF="autoconf"

# On OSX, it's glibtoolize
LIBTOOLIZE=$(which libtoolize)
if [ "$LIBTOOLIZE" = "" ]; then
    LIBTOOLIZE=$(which glibtoolize)
fi
if [ "$LIBTOOLIZE" = "" ]; then
    echo "CANNOT CONTINUE! MISSING (G)LIBTOOLIZE! Install libtool!" >&2
    exit 2
fi

case "x$1" in
xinit)
        [ -d m4 ] || mkdir m4
        set -x
        autoheader
        aclocal
        $LIBTOOLIZE --force --copy --automake
        autoconf --force
        automake --foreign --copy --add-missing -Woverride
        ;;
xclean)
        echo 'cleaning...'
        make distclean >/dev/null 2>&1
        rm -rf autom4te.cache
        for fn in aclocal.m4 configure config.guess config.sub depcomp install-sh \
                ltmain.sh libtool missing mkinstalldirs config.log config.status Makefile; do
                rm -f $fn
        done

        find . -name Makefile.in -exec rm -f {} \;
        find . -name Makefile -exec rm -f {} \;
        find . -name .deps -prune -exec rm -rf {} \;
        echo 'done'
        ;;
*)
        ./configure
        ;;
esac