From: Peter Rosin Date: Mon, 13 Feb 2012 20:21:48 +0000 (+0100) Subject: tests: increase coverage for depcomp tests X-Git-Tag: ng-0.5a~9^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3f34caa4a4b9ff6862f3b4f1d45560ea4ffee5f;p=thirdparty%2Fautomake.git tests: increase coverage for depcomp tests On platforms requiring that no undefined symbols exist in order to build shared libraries (e.g. Windows DLLs), you have to explicitly declare that the libtool library you are building does not actually have any undefined symbols, for libtool to even try to build it as a shared library. Without that explicit declaration, libtool falls back to a static library only, regardless of any --enable-shared flags etc. tests/depcomp.sh (Makefile.am): Add -no-undefined if a libtool library (.la) is built. (src/Makefile.am): Likewise. --- diff --git a/tests/depcomp.sh b/tests/depcomp.sh index a53c0b57c..708314fd3 100755 --- a/tests/depcomp.sh +++ b/tests/depcomp.sh @@ -150,7 +150,14 @@ case $depcomp_with_libtool in yes) po=Plo objext=lo a=la normalized_target=libfoo_la - LIBPRIMARY=LTLIBRARIES LINKADD=LIBADD + # On platforms requiring that no undefined symbols exist in order + # to build shared libraries (e.g. Windows DLLs), you have to + # explicitly declare that the libtool library you are building + # does not actually have any undefined symbols, for libtool to + # even try to build it as a shared library. Without that + # explicit declaration, libtool falls back to a static library + # only, regardless of any --enable-shared flags etc. + LIBPRIMARY=LTLIBRARIES LINKADD=LIBADD NOUNDEF=-no-undefined echo lib_LTLIBRARIES = libfoo.la >> Makefile.am make_ok () { @@ -167,7 +174,7 @@ case $depcomp_with_libtool in no) po=Po objext='$(OBJEXT)' a=a normalized_target=foo - LIBPRIMARY=LIBRARIES LINKADD=LDADD + LIBPRIMARY=LIBRARIES LINKADD=LDADD NOUNDEF= echo bin_PROGRAMS = foo >> Makefile.am make_ok () { @@ -185,6 +192,7 @@ SUBDIRS = src # We include subfoo only to be sure that the munging in depcomp # doesn't remove too much from the object file name. ${normalized_target}_SOURCES = foo.c sub/subfoo.c foo.h sub/subfoo.h +${normalized_target}_LDFLAGS = ${NOUNDEF} ${normalized_target}_${LINKADD} = src/libbaz.$a .PHONY: grep-test @@ -207,6 +215,7 @@ noinst_${LIBPRIMARY} = libbaz.$a # We include sub2foo only to be sure that the munging in depcomp # doesn't remove too much from the object file name. libbaz_${a}_SOURCES = baz.c sub2/sub2foo.c baz.h sub2/sub2foo.h +libbaz_${a}_LDFLAGS = ${NOUNDEF} END cat > foo.c <<'END'