[build] Fix interaction between shave, gtk-doc and libtool 1.x
[profile/ivi/clutter.git] / autogen.sh
1 #! /bin/sh
2
3 srcdir=`dirname $0`
4 test -z "$srcdir" && srcdir=.
5
6 PROJECT=Clutter
7 TEST_TYPE=-d
8 FILE=clutter
9
10 test $TEST_TYPE $FILE || {
11         echo "You must run this script in the top-level $PROJECT directory"
12         exit 1
13 }
14
15 GTKDOCIZE=`which gtkdocize`
16 if test -z $GTKDOCIZE; then
17         echo "*** No gtk-doc support ***"
18         echo "EXTRA_DIST =" > gtk-doc.make
19 else
20         gtkdocize || exit $?
21         # we need to patch gtk-doc.make to support pretty output with
22         # libtool 1.x.  Should be fixed in the next version of gtk-doc.
23         # To be more resilient with the various versions of gtk-doc one
24         # can find, just sed gkt-doc.make rather than patch it.
25         sed -e 's#) --mode=compile#) --tag=CC --mode=compile#' gtk-doc.make > gtk-doc.temp \
26                 && mv gtk-doc.temp gtk-doc.make
27         sed -e 's#) --mode=link#) --tag=CC --mode=link#' gtk-doc.make > gtk-doc.temp \
28                 && mv gtk-doc.temp gtk-doc.make
29 fi
30
31 GLIB_GETTEXTIZE=`which glib-gettextize`
32 if test -z $GLIB_GETTEXTIZE; then
33         echo "*** No glib-gettextize ***"
34         exit 1
35 else
36         glib-gettextize -f || exit $?
37 fi
38
39 AUTORECONF=`which autoreconf`
40 if test -z $AUTORECONF; then
41         echo "*** No autoreconf found ***"
42         exit 1
43 else
44         ACLOCAL="${ACLOCAL-aclocal} $ACLOCAL_FLAGS" autoreconf -v --install || exit $?
45 fi
46
47 ./configure "$@" && echo "Now type 'make' to compile $PROJECT."