#!/bin/sh HAVE_PRCS="`which prcs 2> /dev/null`" # must precede -e set -e autofilter="perl -0 -pe 's/^(autoheader.*?: )?WARN.+auxiliary files(.|\n)+WARN.+documentation.\n//m' \ | perl -pe 's/^.*?AC_PROG_LEX invoked multiple times.*?\n?$//g' \ | perl -0 -pe 's/^((.*?AC_CONFIG_SUBDIRS.*?\n)+([^ ]* the top level\n)?)*//g'" DOIT='echo "+ $CMD | \$autofilter" ; ( eval $CMD 2>&1 || kill $$ ) | eval $autofilter' srcdir=`dirname $0` if [ \ -r $srcdir/config.h.in \ -a -r $srcdir/Makefile.in \ -a -r $srcdir/aclocal.m4 \ -a -r $srcdir/configure \ -a "$1" != "y" \ ]; then echo 'The "Bootstrap" script need only be used on a' echo 'completely clean, fresh source tree. After the' echo 'first build, you should just use "make" or "gmake".' echo echo 'It looks as though you have already bootstrapped' echo 'this source tree. You should only bootstrap it' echo 'again if the makefiles or configuration files are' echo 'broken and "make" or "gmake" do not work properly.' echo echo 'Are you sure you want to re-bootstrap this tree?' echo case `echo -n` in '') n='-n' c='' ;; *) n='' c='\c' ;; esac echo $n "[y/n]: $c" read redo case $redo in y* ) ;; * ) exit 1; esac fi cd $srcdir missing= for autotool in autoconf autoheader automake aclocal m4 ; do info=`( $autotool --version 2>/dev/null < /dev/null || echo 'Not found' ) | head -1` if test "$info" != "Not found" ; then info="$info, in `which $autotool`" elif "$autotool" != "m4" ; then missing="$missing$autotool " fi echo "$autotool: $info" done if test "$missing" != ""; then echo "The following GNU autotools are missing from your PATH:" echo " $missing" if test -r $srcdir/config.h.in \ -a -r $srcdir/Makefile.in \ -a -r $srcdir/aclocal.m4 \ -a -r $srcdir/configure ; then echo "However, it appears this directory has already been Bootstrapped." echo "You should skip Bootstrap and instead do: configure ; gmake" else echo "Please download them from ftp://ftp.gnu.org/gnu" fi exit 1 fi if test -f titaniumc.prj -a -d /project/cs/titanium/a/PRCS -a -x "$HAVE_PRCS" ; then echo "prcs rekey -f titaniumc.prj configure.in" prcs rekey -f titaniumc.prj configure.in chmod -R og-rwx . 2>&1 > /dev/null fi set -x ( rm -Rf autom4te*.cache ) set +x CMD="aclocal -I runtime/gasnet" ; eval $DOIT CMD="autoheader" ; eval $DOIT CMD="autoconf" ; eval $DOIT set -x ( # Perform some postprocessing to fix bugs in the configure script: # 1) caching: # Our configure script requires caching, and autoconf 2.5 stupidly disables # caching by default. Caching may open some dangers of stale values, but # the alternative is worse - automake reconfiguring in the absence of # precious environment variables leads to silent incorrect behavior that # can't be detected or fixed because there's no cache! # Restore ./config.cache as the default cache # 2) recursive configure: # When $top_builddir contains a space, the configure script tries to cd # back to $top_builddir w/o quoting it. # Add quotes around the offending command. mv configure .configure-orig sed -e 's/^cache_file=\/dev\/null$/cache_file=.\/config.cache/' \ -e 's/cd $ac_popdir/cd "$ac_popdir"/' \ .configure-orig > configure chmod +x configure rm -f .configure-orig ) set +x CMD="automake -a" ; eval $DOIT set -x ( echo ------------ running GASNet Bootstrap -------------- ( cd runtime/gasnet && ./Bootstrap y n ) echo ----------------------------------------------------- rm -Rf autom4te*.cache ) rm -f config.cache