[mpich2-commits] r4150 - mpich2/trunk/maint
gropp at mcs.anl.gov
gropp at mcs.anl.gov
Fri Mar 20 15:23:20 CDT 2009
Author: gropp
Date: 2009-03-20 15:23:20 -0500 (Fri, 20 Mar 2009)
New Revision: 4150
Modified:
mpich2/trunk/maint/updatefiles
Log:
Added a test for whether test accepts -nt or whether using -nt will cause the script to abort (!)
Modified: mpich2/trunk/maint/updatefiles
===================================================================
--- mpich2/trunk/maint/updatefiles 2009-03-20 19:35:46 UTC (rev 4149)
+++ mpich2/trunk/maint/updatefiles 2009-03-20 20:23:20 UTC (rev 4150)
@@ -152,6 +152,25 @@
echo "Must execute at top level directory for now"
exit 1
fi
+#
+# On some systems (including Solaris), using -nt in a test statement causes
+# the shell script to abort. We test for this here to make updatefiles more
+# robust in this case. We use conftest as the name of the test program
+# because autoconf also uses this name, so we know that it will be ok.
+testNTfails=yes
+rm -rf conftest
+cat <<EOF >>conftest
+#! /bin/sh
+test a -nt b
+exit 2
+EOF
+chmod +x conftest
+./conftest 2>&1 >/dev/null
+st=$?
+if [ "$st" = 2 ] ; then
+ testNTfails=no
+fi
+rm -rf conftest
#
# Determine the autoconf to use. If --with-autoconf was set, use
# autoconf and autoheader from that directory
@@ -192,7 +211,7 @@
# -1 is used for unknown
acSubversion=-1
acIncDirFlag=-I
-for ver in 62 61 60 59 ; do
+for ver in 63 62 61 60 59 ; do
rm -f .tmp/configure.in .tmp/configure
cat >.tmp/configure.in <<EOF
AC_PREREQ(2.$ver)
@@ -205,7 +224,7 @@
rm -f .tmp/configure.in .tmp/configure
if [ "$acSubversion" -gt 0 ] ; then
acVersion="2.$acSubversion"
- echo "You have autoconf version $acVersion."
+ echo "You have autoconf version $acVersion or greater."
else
cat <<EOF
You either do not have autoconf in your path or updatefiles was unable to
@@ -596,15 +615,17 @@
# and set builtConfigure to true (or use find with
# -newer if you want to replace the test)
# Test for support of -nt
- rm -f .foo
- test $dir/configure -nt $dir/mf.newer 2>.foo
- # If .foo is empty, there was no error in test with -nt
- if [ ! -s ".foo" ] ; then
- if [ $dir/configure -nt $dir/mf.newer ] ; then
- builtConfigure=yes
- fi
+ if [ "$testNTfails" = "no" ] ; then
+ rm -f .foo
+ test $dir/configure -nt $dir/mf.newer 2>.foo
+ # If .foo is empty, there was no error in test with -nt
+ if [ ! -s ".foo" ] ; then
+ if [ $dir/configure -nt $dir/mf.newer ] ; then
+ builtConfigure=yes
+ fi
+ fi
+ rm -f .foo
fi
- rm -f .foo
#
rm -f $dir/mf.newer
if [ ! -x $dir/configure ] ; then
More information about the mpich2-commits
mailing list