9da7a6021ba16d17bf477c4fdff6807abf9bf2fb
[platform/upstream/glib.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 srcdir=`dirname $0`
5 test -z "$srcdir" && srcdir=.
6
7 ORIGDIR=`pwd`
8 cd $srcdir
9 PROJECT=GLib
10 TEST_TYPE=-f
11 FILE=glib/glib.h
12
13 DIE=0
14
15 have_libtool=false
16 if libtool --version < /dev/null > /dev/null 2>&1 ; then
17         libtool_version=`libtoolize --version |  libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
18         case $libtool_version in
19             1.4*)
20                 have_libtool=true
21                 ;;
22         esac
23 fi
24 if $have_libtool ; then : ; else
25         echo
26         echo "You must have libtool 1.4 installed to compile $PROJECT."
27         echo "Install the appropriate package for your distribution,"
28         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
29         DIE=1
30 fi
31
32 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
33         echo
34         echo "You must have autoconf installed to compile $PROJECT."
35         echo "libtool the appropriate package for your distribution,"
36         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
37         DIE=1
38 }
39
40 have_automake=false
41 if automake --version < /dev/null > /dev/null 2>&1 ; then
42         automake_version=`automake --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
43         case $automake_version in
44            1.2*|1.3*|1.4) 
45                 ;;
46            *)
47                 have_automake=true
48                 ;;
49         esac
50 fi
51 if $have_automake ; then : ; else
52         echo
53         echo "You must have automake 1.4-p1 installed to compile $PROJECT."
54         echo "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.4-p1.tar.gz"
55         echo "(or a newer version if it is available)"
56         DIE=1
57 fi
58
59 have_gettext=false
60 if xgettext --version 2>/dev/null | grep 'GNU' > /dev/null ; then 
61         have_gettext=true
62 fi
63
64 if $have_gettext ; then : ; else
65        echo
66        echo "GNU gettext must be installed to build GLib from CVS"
67        echo "GNU gettext is available from http://www.gnu.org/software/gettext/"
68        DIE=1
69 fi
70
71 if test "$DIE" -eq 1; then
72         exit 1
73 fi
74
75 test $TEST_TYPE $FILE || {
76         echo "You must run this script in the top-level $PROJECT directory"
77         exit 1
78 }
79
80 if test -z "$AUTOGEN_SUBDIR_MODE"; then
81         if test -z "$*"; then
82                 echo "I am going to run ./configure with no arguments - if you wish "
83                 echo "to pass any to it, please specify them on the $0 command line."
84         fi
85 fi
86
87 case $CC in
88 *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
89 esac
90
91 aclocal $ACLOCAL_FLAGS
92
93 # optionally feature autoheader
94 (autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader
95
96 automake -a $am_opt
97 autoconf
98 cd $ORIGDIR
99
100 if test -z "$AUTOGEN_SUBDIR_MODE"; then
101         $srcdir/configure --enable-maintainer-mode --enable-gtk-doc "$@"
102
103         echo 
104         echo "Now type 'make' to compile $PROJECT."
105 fi