gtk-doc actually builds now...
[gnome.seed] / 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 DIE=0
8
9 gtkdocize || exit 1
10
11 if [ -n "$GNOME2_DIR" ]; then
12         ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
13         LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH"
14         PATH="$GNOME2_DIR/bin:$PATH"
15         export PATH
16         export LD_LIBRARY_PATH
17 fi
18
19 (test -f $srcdir/configure.ac) || {
20     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
21     echo " top-level package directory"
22     exit 1
23 }
24
25 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
26   echo
27   echo "**Error**: You must have \`autoconf' installed."
28   echo "Download the appropriate package for your distribution,"
29   echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
30   DIE=1
31 }
32
33 (grep "^IT_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && {
34   (intltoolize --version) < /dev/null > /dev/null 2>&1 || {
35     echo 
36     echo "**Error**: You must have \`intltool' installed."
37     echo "You can get it from:"
38     echo "  ftp://ftp.gnome.org/pub/GNOME/"
39     DIE=1
40   }
41 }
42
43 (grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && {
44   (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
45     echo
46     echo "**Error**: You must have \`xml-i18n-toolize' installed."
47     echo "You can get it from:"
48     echo "  ftp://ftp.gnome.org/pub/GNOME/"
49     DIE=1
50   }
51 }
52
53 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
54   (libtool --version) < /dev/null > /dev/null 2>&1 || {
55     echo
56     echo "**Error**: You must have \`libtool' installed."
57     echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
58     DIE=1
59   }
60 }
61
62 (grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && {
63   (grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \
64   (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
65     echo
66     echo "**Error**: You must have \`glib' installed."
67     echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
68     DIE=1
69   }
70 }
71
72 (automake --version) < /dev/null > /dev/null 2>&1 || {
73   echo
74   echo "**Error**: You must have \`automake' installed."
75   echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
76   DIE=1
77   NO_AUTOMAKE=yes
78 }
79
80
81 # if no automake, don't bother testing for aclocal
82 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
83   echo
84   echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
85   echo "installed doesn't appear recent enough."
86   echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
87   DIE=1
88 }
89
90 if test "$DIE" -eq 1; then
91   exit 1
92 fi
93
94 if test -z "$*"; then
95   echo "**Warning**: I am going to run \`configure' with no arguments."
96   echo "If you wish to pass any to it, please specify them on the"
97   echo \`$0\'" command line."
98   echo
99 fi
100
101 case $CC in
102 xlc )
103   am_opt=--include-deps;;
104 esac
105
106 for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.ac -print`
107 do 
108   dr=`dirname $coin`
109   if test -f $dr/NO-AUTO-GEN; then
110     echo skipping $dr -- flagged as no auto-gen
111   else
112     echo processing $dr
113     ( cd $dr
114
115       aclocalinclude="$ACLOCAL_FLAGS"
116
117       if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then
118         echo "Creating $dr/aclocal.m4 ..."
119         test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
120         echo "Running glib-gettextize...  Ignore non-fatal messages."
121         echo "no" | glib-gettextize --force --copy
122         echo "Making $dr/aclocal.m4 writable ..."
123         test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
124       fi
125       if grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then
126         echo "Running intltoolize..."
127         intltoolize --copy --force --automake
128       fi
129       if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then
130         echo "Running xml-i18n-toolize..."
131         xml-i18n-toolize --copy --force --automake
132       fi
133       if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
134         if test -z "$NO_LIBTOOLIZE" ; then 
135           echo "Running libtoolize..."
136           libtoolize --force --copy
137         fi
138       fi
139       echo "Running aclocal $aclocalinclude ..."
140       aclocal $aclocalinclude
141       if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then
142         echo "Running autoheader..."
143         autoheader
144       fi
145       echo "Running automake --gnu $am_opt ..."
146       automake --add-missing --gnu $am_opt
147       echo "Running autoconf ..."
148       autoconf
149     )
150   fi
151 done
152
153 conf_flags="--enable-maintainer-mode"
154
155 if test x$NOCONFIGURE = x; then
156   echo Running $srcdir/configure $conf_flags "$@" ...
157   $srcdir/configure $conf_flags "$@" \
158   && echo Now type \`make\' to compile. || exit 1
159 else
160   echo Skipping configure process.
161 fi