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