check-cc-no-c-o: avoid a spurious failure
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 14 May 2013 11:17:50 +0000 (13:17 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 14 May 2013 11:18:33 +0000 (13:18 +0200)
* t/am-prog-cc-c-o.sh: In this test, by relying on the knowledge
that we are running under the aegis of the 'check-cc-no-c-o'
maintainer-specific target, knowledge given us by ...
* t/Makefile.in (check-cc-no-c-o) : ... the new environment
variable 'AM_TESTSUITE_SIMULATING_NO_CC_C_O', set to a value
of "yes" by this rule.
* t/ax/test-defs.in: Initialize the new variable to "no" by
default, and add an explanatory comment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/Makefile.inc
t/am-prog-cc-c-o.sh
t/ax/test-defs.in

index 18a57c2..800b66c 100644 (file)
@@ -235,6 +235,7 @@ check-no-trailing-backslash-in-recipes:
 # long discussion about automake bug#13378.
 check-cc-no-c-o:
        $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
+         AM_TESTSUITE_SIMULATING_NO_CC_C_O=yes \
          CC='$(abs_top_builddir)/%D%/ax/cc-no-c-o' \
          GNU_CC='$(abs_top_builddir)/%D%/ax/cc-no-c-o'
 .PHONY: check-cc-no-c-o
index 549cdcc..920a0dc 100755 (executable)
@@ -56,7 +56,11 @@ $AUTOMAKE --add-missing
 
 ./configure >stdout || { cat stdout; exit 1; }
 cat stdout
-$EGREP 'understands? -c and -o together.* yes$' stdout
+if test "$AM_TESTSUITE_SIMULATING_NO_CC_C_O" != no; then
+  $EGREP 'understands? -c and -o together.* no$' stdout
+else
+  $EGREP 'understands? -c and -o together.* yes$' stdout
+fi
 # No repeated checks please.
 test $(grep -c ".*-c['\" ].*-o['\" ]" stdout) -eq 1
 $MAKE
index 1083743..7bf4342 100644 (file)
@@ -76,6 +76,11 @@ PATH_SEPARATOR='@PATH_SEPARATOR@'
 host_alias=${host_alias-'@host_alias@'}; export host_alias
 build_alias=${build_alias-'@build_alias@'}; export build_alias
 
+# Whether the testsuite is being run by faking the presence of a C
+# compiler that doesn't grasp the '-c' and '-o' flags together.  By
+# default, of course, it isn't.
+: "${AM_TESTSUITE_SIMULATING_NO_CC_C_O:=no}"
+
 # A concurrency-safe "mkdir -p" implementation.
 MKDIR_P=${AM_TESTSUITE_MKDIR_P-'@MKDIR_P@'}