coverage: compile rules used "-c -o" also with losing compilers
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 8 Jan 2013 19:19:04 +0000 (20:19 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 8 Jan 2013 19:25:30 +0000 (20:25 +0100)
commit744cd575c103166ed2b9e8ea1e8013f3e3e25bfe
tree853dc8f94e5e9dc69b7a81bc46898bf104b5a5f4
parent285d7b14cc55c047c432e3ed7322cb1a4f96aab2
coverage: compile rules used "-c -o" also with losing compilers

If the 'subdir-objects' option is used, Automake-generated rules for
C compilation pass both the "-c" and "-o" options to the C compiler,
*unconditionally*.  There are some compilers that choke on such an
usage, but the AM_PROG_CC_C_O macro takes care of them (it does so by
redefining $CC to use the Automake-provided 'compile' wrapper script
automatically, if a losing compiler is detected at configure runtime).

Unfortunately, in case the 'subdir-objects' option is specified in a
Makefile.am, but all the source files resided anyway in the top-level
directory (relative to the Makefile.am), Automake do *not* complain
if AM_PROG_CC_C_O wasn't invoked in 'configure.ac' -- all the while
still passing "-c -o" to the compiler invocations.  This could cause
compilation failures with losing compilers if the user forget to call
AM_PROG_CC_C_O in 'configure.ac' (and Automake would not warn him of
the issue).

Expose this bug in the testsuite.

Issue identified by Nick Bowler in the discussion on automake bug#13378:
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#35>
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#44>

* t/ccnoco4.sh: New test.
* t/list-of-tests.mk (XFAIL_TESTS, handwritten_TESTS): List it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/ccnoco4.sh [new file with mode: 0755]
t/list-of-tests.mk