[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Converting configure.in for use with new auto* tools - what a mess!



On Sat, Sep 27, 2003 at 01:54:36PM -0500, Branden Robinson wrote:
> On Sat, Sep 27, 2003 at 02:45:20PM +0200, Martin Quinson wrote:
> > I use the attached bootstrap script to build the autotools scripts. the
> > version of autotools are hardcoded in it, which is a Bad Thing (TM). Feel
> > free to steal anyway ;)
> 
> As far as I could tell, this message had no attachment (apart from the
> message body and signature).

Ups
#!/bin/sh

######
###### Some defs
######

PKG_NAME="w3c-libwww"
# a list of all dirs containing possibly some macros
acmacrodirs="${HOME}/share/aclocal ${PWD}/tools/acmacro ${PWD}/m4"
 
######
###### End of conf part
######
for dir in $acmacrodirs ; do
   if test -d $dir ; then
       aclocalinclude="$aclocalinclude -I $dir";
   fi
done

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

echo "Autoregenerate package \`$PKG_NAME' in directory \`$srcdir'";

(test -f $srcdir/configure.ac \
  && test -f $srcdir/Robot/src/RobotMain.c) || {
    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
    echo " top-level $PKG_NAME directory"
    exit 1
}

######
###### Some tests (borrowed from Mt who borrowed it from 
###### macros/autogen.sh from achtung)
######
DIE=0

(autoconf --version) < /dev/null > /dev/null 2>&1 || {
  echo
  echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME."
  echo "Download the appropriate package for your distribution,"
  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/";
  DIE=1
}

(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
  (libtool --version) < /dev/null > /dev/null 2>&1 || {
    echo
    echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME."
    echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.4.tar.gz";
    echo "(or a newer version if it is available)"
    DIE=1
  }
}

(automake-1.7 --version) < /dev/null > /dev/null 2>&1 || {
  echo
  echo "**Error**: You must have \`automake' 1.7 installed to compile $PKG_NAME."
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.7.tar.gz";
  echo "(or a newer version if it is available)"
  DIE=1
  NO_AUTOMAKE=yes
}

# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
  echo
  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
  echo "installed doesn't appear recent enough."
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz";
  echo "(or a newer version if it is available)"
  DIE=1
}

if test "$DIE" -eq 1; then
  exit 1
fi
###### END of test part


######
###### Action part
######
if test -z "$*"; then
  echo "**Warning**: I am going to run \`configure' with no arguments."
  echo "If you wish to pass any to it, please specify them on the"
  echo \`$0\'" command line."
  echo
fi
echo "Generating configuration files for $PKG_NAME, please wait...."
echo;

case $CC in
xlc )
  am_opt=--include-deps;;
esac

#for coin in  `find $srcdir -name configure.ac -print `\
#             `find $srcdir -name configure.in -print`
for coin in $srcdir/configure.ac
do 
  dr=`dirname $coin`
  if test -f $dr/NO-AUTO-GEN; then
    echo skipping $dr -- flagged as no auto-gen
  else
    echo "************"
    echo "* Processing directory $dr"
    echo "************"

    if [ -e $dr/configure.in ] ; then
       configfile="configure.in"
    else 
       configfile="configure.ac"
    fi
    macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
      pwd=`pwd`
      cd $dr
      if grep "^AM_PROG_LIBTOOL" $configfile >/dev/null; then
	if test -z "$NO_LIBTOOLIZE" ; then 
	  echo "Running libtoolize --force --copy in "`pwd`"..."
	  libtoolize --force --copy
	fi
      fi
      echo "Running aclocal-1.7 $aclocalinclude..."
      aclocal-1.7 $aclocalinclude 
      if grep "^AM_CONFIG_HEADER" $configfile >/dev/null; then
	echo "Running autoheader in "`pwd`"..."
	autoheader
      fi
      echo "Running automake-1.7 --gnu --add-missing $am_opt ..."
      automake-1.7 --gnu --add-missing $am_opt
#      echo "Running automake m4/Makefile ..."
#      automake m4/Makefile
      echo "Running autoconf..."
      autoconf
      cd $pwd
  fi
done

#conf_flags="--enable-maintainer-mode"

if test x$NOCONFIGURE = x; then
  echo "************"
  echo "* Running $srcdir/configure $conf_flags $@ ..."
  echo "************"

  $srcdir/configure $conf_flags "$@" || exit 1
else
  echo Skipping configure process.
fi

echo Now type \`make\' to compile $PKG_NAME

Attachment: pgp6RFhjJ3fKn.pgp
Description: PGP signature


Reply to: