1
#!/bin/sh
2
3
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4"
4
DIE=0
5
6
srcdir=`dirname $0`
7
test -z "$srcdir" && srcdir=.
8
9
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
10
  echo
11
  echo "**Error**: You must have \`autoconf' installed."
12
  echo "Download the appropriate package for your distribution,"
13
  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
14
  DIE=1
15
}
16
17
(automake --version) < /dev/null > /dev/null 2>&1 || {
18
  echo
19
  echo "**Error**: You must have \`automake' installed."
20
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
21
  echo "(or a newer version if it is available)"
22
  DIE=1
23
  NO_AUTOMAKE=yes
24
}
25
26
# if no automake, don't bother testing for aclocal
27
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
28
  echo
29
  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
30
  echo "installed doesn't appear recent enough."
31
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
32
  echo "(or a newer version if it is available)"
33
  DIE=1
34
}
35
36
if test "$DIE" -eq 1; then
37
  exit 1
38
fi
39
40
if test -z "$*"; then
41
  echo "**Warning**: I am going to run \`configure' with no arguments."
42
  echo "If you wish to pass any to it, please specify them on the"
43
  echo \`$0\'" command line."
44
  echo
45
fi
46
47
case $CC in
48
xlc )
49
  am_opt=--include-deps;;
50
esac
51
52
echo "Running aclocal $ACLOCAL_FLAGS ..."
53
aclocal $ACLOCAL_FLAGS || {
54
  echo
55
  echo "**Error**: aclocal failed. This may mean that you have not"
56
  echo "installed all of the packages you need, or you may need to"
57
  echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
58
  echo "for the prefix where you installed the packages whose"
59
  echo "macros were not found"
60
  exit 1
61
}
62
63
if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
64
  echo "Running autoheader..."
65
  autoheader || { echo "**Error**: autoheader failed."; exit 1; }
66
fi
67
68
echo "Running automake --gnu $am_opt ..."
69
automake --add-missing --gnu $am_opt ||
70
  { echo "**Error**: automake failed."; exit 1; }
71
echo "Running autoconf ..."
72
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
73
74
75
conf_flags="--enable-maintainer-mode"
76
77
if test x$NOCONFIGURE = x; then
78
  echo Running $srcdir/configure $conf_flags "$@" ...
79
  $srcdir/configure $conf_flags "$@" \
80
  && echo Now type \`make\' to compile $PKG_NAME || exit 1
81
else
82
  echo Skipping configure process.
83
fi