* tools/Info.cs: Add --list-backends, --list-static-indexes to
[beagle.git] / autogen.sh
blob6b9ec270596d5d2e3b062cba677894e76959626c
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
4 srcdir=`dirname $0`
5 test -z "$srcdir" && srcdir=.
7 ORIGDIR=`pwd`
8 cd $srcdir
9 PROJECT=beagle
10 TEST_TYPE=-f
11 FILE=beagled/BeagleDaemon.cs
13 DIE=0
15 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
16 echo
17 echo "You must have autoconf installed to compile $PROJECT."
18 echo "Download the appropriate package for your distribution,"
19 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
20 DIE=1
23 AUTOMAKE=automake-1.8
24 ACLOCAL=aclocal-1.8
26 ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
27 AUTOMAKE=automake
28 ACLOCAL=aclocal
31 ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
32 echo
33 echo "You must have automake installed to compile $PROJECT."
34 echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz"
35 echo "(or a newer version if it is available)"
36 DIE=1
39 (grep "^AM_PROG_LIBTOOL" configure.in >/dev/null) && {
40 (libtool --version) < /dev/null > /dev/null 2>&1 || {
41 echo
42 echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
43 echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
44 echo "(or a newer version if it is available)"
45 DIE=1
49 grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null && {
50 grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
51 (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
52 echo
53 echo "**Error**: You must have \`glib' installed to compile $PROJECT."
54 DIE=1
58 if test "$DIE" -eq 1; then
59 exit 1
62 test $TEST_TYPE $FILE || {
63 echo "You must run this script in the top-level $PROJECT directory"
64 exit 1
67 if test -z "$*"; then
68 echo "I am going to run ./configure with no arguments - if you wish "
69 echo "to pass any to it, please specify them on the $0 command line."
72 case $CC in
73 *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
74 esac
76 for coin in `find $srcdir -name configure.in -print`
77 do
78 dr=`dirname $coin`
79 if test -f $dr/NO-AUTO-GEN; then
80 echo skipping $dr -- flagged as no auto-gen
81 else
82 echo processing $dr
83 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
84 ( cd $dr
85 aclocalinclude="$ACLOCAL_FLAGS"
86 for k in $macrodirs; do
87 if test -d $k; then
88 aclocalinclude="$aclocalinclude -I $k"
89 ##else
90 ## echo "**Warning**: No such directory \`$k'. Ignored."
92 done
93 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
94 if grep "sed.*POTFILES" configure.in >/dev/null; then
95 : do nothing -- we still have an old unmodified configure.in
96 else
97 echo "Creating $dr/aclocal.m4 ..."
98 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
99 echo "Running gettextize... Ignore non-fatal messages."
100 echo "no" | gettextize --force --copy
101 echo "Making $dr/aclocal.m4 writable ..."
102 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
105 if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
106 echo "Creating $dr/aclocal.m4 ..."
107 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
108 echo "Running gettextize... Ignore non-fatal messages."
109 echo "no" | gettextize --force --copy
110 echo "Making $dr/aclocal.m4 writable ..."
111 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
113 if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
114 echo "Creating $dr/aclocal.m4 ..."
115 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
116 echo "Running gettextize... Ignore non-fatal messages."
117 echo "no" | glib-gettextize --force --copy
118 echo "Making $dr/aclocal.m4 writable ..."
119 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
121 if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then
122 echo "Running intltoolize..."
123 intltoolize --copy --force --automake
125 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
126 echo "Running libtoolize..."
127 libtoolize --force --copy
129 echo "Running $ACLOCAL $aclocalinclude ..."
130 $ACLOCAL $aclocalinclude
131 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
132 echo "Running autoheader..."
133 autoheader
135 echo "Running $AUTOMAKE --gnu $am_opt ..."
136 $AUTOMAKE --add-missing --gnu $am_opt
137 echo "Running autoconf ..."
138 autoconf
141 done
143 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
145 cd "$ORIGDIR"
147 if test x$NOCONFIGURE = x; then
148 echo Running $srcdir/configure $conf_flags "$@" ...
149 $srcdir/configure $conf_flags "$@" \
150 && echo Now type \`make\' to compile $PROJECT || exit 1
151 else
152 echo Skipping configure process.