tests: fix spurious failure with Portland Compilers
authorDave Goodell <goodell@mcs.anl.gov>
Tue, 28 Feb 2012 19:49:22 +0000 (13:49 -0600)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 29 Feb 2012 18:42:50 +0000 (19:42 +0100)
* tests/silent-many-generic.test (configure.ac): Be more careful
in the workaround to avoid spurious failures with C++ compilers
containing the string "CC" in their names; this avoids spurious
failures with at least the Sun Studio C++ compiler (when named
"sunCC") and the Portland Group C++ Compiler ("pgCC").
Also handle arguments with whitespace correctly in the 'am--cxx'
temporary wrapper.
* THANKS: Update.

Co-authored-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Copyright-paperwork-exempt: yes

THANKS
tests/silent-many-generic.test

diff --git a/THANKS b/THANKS
index 1bc3a80..9d3c32c 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -71,6 +71,7 @@ Daniel Kahn Gillmor   dkg@fifthhorseman.net
 Daniel Richard G.      skunk@iskunk.org
 Debarshi Ray           rishi@gnu.org
 Dave Brolley           brolley@redhat.com
+Dave Goodell           goodell@mcs.anl.gov
 Dave Hart              davehart@gmail.com
 Dave Korn              dave.korn.cygwin@googlemail.com
 Dave Morrison          dave@bnl.gov
index a7a0487..a3d3b81 100755 (executable)
@@ -110,17 +110,21 @@ test -n "`echo $CXX`" || AC_MSG_ERROR([C++ compiler not found], [77])
 test -n "`echo $FC`"  || AC_MSG_ERROR([Fortran compiler not found], [77])
 test -n "`echo $F77`" || AC_MSG_ERROR([Fortran 77 compiler not found], [77])
 
-# The SunStudio C++ compiler is unfortunately named 'CC' (yuck!),
-# and this can cause problems with our grepping checks on the
-# output from make.  Avoid these problems by invoking a wrapper
-# script, as filtering the make output proved too fragile.
+# The SunStudio C++ compiler is unfortunately named 'sunCC' (or even just
+# 'CC', yuck!); similarly and the Portland group C++ compiler is named
+# 'pgCC'.  This can cause problems with our grepping checks on the output
+# from make.  Avoid these problems by invoking a wrapper script, as
+# filtering the make output proved too fragile.
 case " $CXX " in
-  *' CC '*|*'/CC '*)
-    AC_MSG_WARN([the C++ compiler '$CXX' seems to be named 'CC'])
+  *'CC '*)
+    AC_MSG_WARN([the C++ compiler '$CXX' name ends with 'CC'])
     AC_MSG_WARN([it will be wrapped with the custom script 'am--cxx'])
     echo '#!/bin/sh' > bin/am--cxx
     echo 'PATH=$saved_PATH; export PATH' >> bin/am--cxx
-    echo "exec $CXX \${1+"\$@"}" >> bin/am--cxx
+    echo "case \$# in" >> bin/am--cxx
+    echo "  0) exec $CXX ;;" >> bin/am--cxx
+    echo "  *) exec $CXX \"\$@\" ;;" >> bin/am--cxx
+    echo "esac" >> bin/am--cxx
     chmod a+x bin/am--cxx
     CXX=am--cxx
 esac