autogen.sh
changeset 259 5b0601d184ed
child 262 63644cc28e0b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/autogen.sh	Mon Jun 23 09:59:08 2008 -0400
     1.3 @@ -0,0 +1,95 @@
     1.4 +#!/bin/sh
     1.5 +# Run this to generate all the initial makefiles, etc.
     1.6 +
     1.7 +srcdir=`dirname $0`
     1.8 +test -z "$srcdir" && srcdir=.
     1.9 +
    1.10 +DIE=0
    1.11 +
    1.12 +(test -f $srcdir/configure.ac) || {
    1.13 +    echo -n "**Error**: Directory $srcdir does not look like the"
    1.14 +    echo " top-level package directory"
    1.15 +    exit 1
    1.16 +}
    1.17 +
    1.18 +(autoconf --version) < /dev/null > /dev/null 2>&1 || {
    1.19 +  echo
    1.20 +  echo "**Error**: You must have autoconf installed."
    1.21 +  echo "Download the appropriate package for your distribution,"
    1.22 +  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
    1.23 +  DIE=1
    1.24 +}
    1.25 +
    1.26 +(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
    1.27 +  (libtool --version) < /dev/null > /dev/null 2>&1 || {
    1.28 +    echo
    1.29 +    echo "**Error**: You must have libtool installed."
    1.30 +    echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
    1.31 +    DIE=1
    1.32 +  }
    1.33 +}
    1.34 +
    1.35 +(automake --version) < /dev/null > /dev/null 2>&1 || {
    1.36 +  echo
    1.37 +  echo "**Error**: You must have automake installed."
    1.38 +  echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
    1.39 +  DIE=1
    1.40 +  NO_AUTOMAKE=yes
    1.41 +}
    1.42 +
    1.43 +
    1.44 +# if no automake, don't bother testing for aclocal
    1.45 +test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
    1.46 +  echo
    1.47 +  echo "**Error**: Missing aclocal.  The version of automake"
    1.48 +  echo "installed doesn't appear recent enough."
    1.49 +  echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
    1.50 +  DIE=1
    1.51 +}
    1.52 +
    1.53 +if test "$DIE" -eq 1; then
    1.54 +  exit 1
    1.55 +fi
    1.56 +
    1.57 +if test -z "$*"; then
    1.58 +  echo "**Warning**: I am going to run configure with no arguments."
    1.59 +  echo "If you wish to pass any to it, please specify them on the"
    1.60 +  echo $0 " command line."
    1.61 +  echo
    1.62 +fi
    1.63 +
    1.64 +case $CC in
    1.65 +xlc )
    1.66 +  am_opt=--include-deps;;
    1.67 +esac
    1.68 +
    1.69 +      aclocalinclude="$ACLOCAL_FLAGS"
    1.70 +
    1.71 +      if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
    1.72 +	if test -z "$NO_LIBTOOLIZE" ; then 
    1.73 +	  echo "Running libtoolize..."
    1.74 +	  libtoolize --force --copy
    1.75 +	fi
    1.76 +      fi
    1.77 +      echo "Running aclocal $aclocalinclude ..."
    1.78 +      aclocal $aclocalinclude
    1.79 +      if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
    1.80 +	echo "Running autoheader..."
    1.81 +	autoheader
    1.82 +      fi
    1.83 +      echo "Running automake --gnu -Wno-portability $am_opt ..."
    1.84 +      automake --add-missing --gnu -Wno-portability $am_opt
    1.85 +      echo "Running autoconf ..."
    1.86 +      autoconf
    1.87 +
    1.88 +intltoolize --copy --force --automake                  || exit 1
    1.89 +
    1.90 +conf_flags="--enable-maintainer-mode"
    1.91 +
    1.92 +if test x$NOCONFIGURE = x; then
    1.93 +  echo "Running $srcdir/configure $conf_flags $@ ..."
    1.94 +  $srcdir/configure $conf_flags "$@" \
    1.95 +  && echo "Now type make to compile." || exit 1
    1.96 +else
    1.97 +  echo "Skipping configure process."
    1.98 +fi