Andreas Fester wrote:

Hi,

the test suite uses the --whole-archive and --no-whole-archive
flags hard coded in the automake makefiles. The reason seems to
be to properly link the static convencience libraries
from the various sub directories into the executable, since
the main program does not reference any symbols from the libraries
and without those flags the linker would decide to drop the objects
(the libraries register the test cases in the cppunit framework
through global variables). However, whole-archive flags
are system dependant and non-portable (one reason why building
the test suite on solaris currently fails).

I did not find any possibility to tell libtool to add the
--whole-archive flags when creating executables; this only
seems to be supported with shared libraries. My proposed
solution is to create a shared library libtestsuite.so which
contains all test cases; the main testsuite executable only
contains main.cpp and links against libtestsuite.so (see
attached patch). This allows to get rid of the hard coded
linker flags because libtool adds them when creating the
shared library.

If noone has a better idea or tells me that I am completely
wrong, I will commit these patches :-)

Thanks,

        Andreas
I'm guessing the Ant build does not suffer from the same issue since it should not depend on implicit inclusion of object files from a library. I'd like the Ant and the automake builds to be as close as possible and having a single executable test produced by the Ant build and a executable+shared library from automake is undesirable.

Could you confirm that the Ant build does not suffer these issues and estimate the difficulties of making the automake to mimic the current Ant or modifying the Ant build to be consistent with the automake changes.

Reply via email to