summaryrefslogtreecommitdiff
path: root/autogen.sh
blob: a9e02cb78ae7848f20b23bf848d29cecb01fea18 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#! /bin/sh

PKG_NAME=glibmm

srcdir=`dirname $0`
test "x$srcdir" = x && srcdir=.

origdir=`pwd`

if test -f "$srcdir/configure.in" && \
   test -d "$srcdir/glib/src" && \
   test -d "$srcdir/glib/glibmm"
then :; else
    echo "** Error **: Directory \`${srcdir}\' does not look like"
    echo "the top-level ${PKG_NAME} directory."
    exit 1
fi

MAKE=`which gnumake`
test -x "$MAKE" || MAKE=`which gmake`
test -x "$MAKE" || MAKE=`which make`

if "$MAKE" --version 2>/dev/null | grep "Free Software Foundation" >/dev/null 2>&1
then :; else
    echo "** Error **: You need GNU make to build gtkmm from CVS."
    echo "${MAKE} is not GNU make."
    exit 1
fi

echo "Found GNU make at ${MAKE}... good."

cd "$srcdir"

echo "Adding libtools."
libtoolize --automake || exit 1

echo "Building macros."
aclocal -I "$srcdir/scripts" $ACLOCAL_FLAGS || exit 1

#echo "Building config header."
#autoheader

echo "Building makefiles."
automake --add-missing || exit 1

echo "Building configure."

autoconf || exit 1


enable_warnings=

case "$*" in
    *--enable-warnings*|*--disable-warnings*)
        ;;
    *)  # enable -Werror by default when building with gcc3
        ${CXX:-"g++"} --version 2>/dev/null | grep '(GCC) 3\.[0-9]\+\.[0-9]' >/dev/null 2>&1 \
            && enable_warnings='--enable-warnings=hardcore'
        ;;
esac

cd "$origdir"
rm -f config.cache

if test -z "$AUTOGEN_SUBDIR_MODE"
then
    echo "Running $srcdir/configure --enable-maintainer-mode" $enable_warnings "$@"
    "$srcdir/configure" --enable-maintainer-mode $enable_warnings "$@" || exit 1
    echo
    echo 'run "make"'
    echo
else
    echo
    echo 'run "./configure ; make"'
    echo
fi

exit 0