+2011-06-02 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ silent-rules tests: fix spurious failures with Sun Studio C++
+ * tests/silentcxx.test: The C++ compiler from Sun Studio is named
+ `CC'. Account for this in our grepping checks on the make output.
+ Since we are at it, throw in a couple of improvements to comments
+ and formatting.
+ * tests/silent-many-generic.test: The C++ compiler from Sun Studio
+ is named `CC', and this can cause spurious failures in our grepping
+ of the make output. Work around this by using a wrapper script
+ around the C++ compiler (generated on the fly), since filtering the
+ make output proved to be too fragile.
+
2011-06-02 Stefano Lattarini <stefano.lattarini@gmail.com>
tests: fix spurious failure in backcompat2.test on NetBSD
cat >>configure.in <<'EOF'
AM_SILENT_RULES
AM_PROG_CC_C_O
-AC_PROG_CXX
AC_PROG_F77
AC_PROG_FC
AC_PROG_LEX
AC_PROG_YACC
+AC_PROG_CXX
+
+# 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.
+case " $CXX " in
+ *' CC '*|*'/CC '*)
+ AC_MSG_WARN([the C++ compiler '$CXX' seems to be named '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
+ chmod a+x bin/am--cxx
+ CXX=am--cxx
+esac
+
AC_CONFIG_FILES([sub/Makefile])
AC_OUTPUT
EOF
cp foo5.l sub/baz5.l
cp foo6.y sub/baz6.y
+mkdir bin
+saved_PATH=$PATH; export saved_PATH
+PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+
$ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
cat > foo.cpp <<'EOF'
using namespace std; /* C compilers fail on this. */
-int main() { return 0; }
+int main (void) { return 0; }
EOF
-# let's try out other extensions too
+# Let's try out other extensions too.
echo 'class Baz { public: int i; };' > baz.cxx
echo 'class Quux { public: bool b; };' > quux.cc
grep ' -c ' stdout
grep ' -o ' stdout
- $EGREP '(CC|CXX|LD) ' stdout && Exit 1
+ $EGREP '(CXX|LD) ' stdout && Exit 1
# Ensure a clean reconfiguration/rebuild.
$MAKE clean