1#!/bin/sh
2
3srcdir=`dirname $0`
4test -z "$srcdir" && srcdir=.
5
6olddir=`pwd`
7cd $srcdir
8
9aclocal --version > /dev/null 2> /dev/null || {
10    echo "error: aclocal not found"
11    exit 1
12}
13automake --version > /dev/null 2> /dev/null || {
14    echo "error: automake not found"
15    exit 1
16}
17
18amcheck=`automake --version | grep 'automake (GNU automake) 1.5'`
19if test "x$amcheck" = "xautomake (GNU automake) 1.5"; then
20    echo "warning: you appear to be using automake 1.5"
21    echo "         this version has a bug - GNUmakefile.am dependencies are not generated"
22fi
23
24rm -rf autom4te*.cache
25
26aclocal $ACLOCAL_FLAGS || {
27    echo "error: aclocal $ACLOCAL_FLAGS failed"
28    exit 1
29}
30automake -a -c --foreign || {
31    echo "warning: automake failed"
32}
33autoconf || {
34    echo "error: autoconf failed"
35    exit 1
36}
37
38if test x$NOCONFIGURE = x; then
39    ./configure $@
40fi
41