tests: workaround for automatic linker determination and conditionals
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 26 Mar 2012 13:26:46 +0000 (15:26 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 27 Mar 2012 13:23:01 +0000 (15:23 +0200)
commit6805810d314e2b4ecb8ff14e04779d8f0ad2b4f8
tree180d139f129e5715de118ee8dc1748c668138261
parent619c1b265564ba2aac50004dec9761df567c69b3
tests: workaround for automatic linker determination and conditionals

See automake bug#11089.

Automake is not very smart in automatically determining the command
to be used to link a program whose source files' languages are
conditionally defined.  For example, an input like:

  if HAVE_CXX
  foo_SOURCES = more.c++
  else
  foo_SOURCES = less.c
  endif

will cause the build rules for 'foo' to *unconditionally* use the
C++ compiler for linking, even when the 'HAVE_CXX' conditional
evaluates to false (which might mean that no C++ compiler is
available).

This behaviour is not really correct, but it's easy enough to work
around, and it's only relevant for fringe use cases (at best).  So
let's just test that the workaround really works.

* tests/link_cond.test: New test.
* tests/list-of-tests.mk: Add it.
* THANKS: Update.

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