depcomp tests: do not specify LDFLAGS for static libraries
authorPeter Rosin <peda@lysator.liu.se>
Tue, 14 Feb 2012 01:56:39 +0000 (02:56 +0100)
committerPeter Rosin <peda@lysator.liu.se>
Tue, 14 Feb 2012 01:56:39 +0000 (02:56 +0100)
Commit v1.11-1848-gb3f34ca accidentally specified LDFLAGS
for libbaz even when built as a static library, which is
not allowed.

* tests/depcomp.sh (src/Makefile.am): Don't add any LDFLAGS
when libbaz is built as a static library.

tests/depcomp.sh

index 9d8060d..d149280 100755 (executable)
@@ -158,6 +158,7 @@ case $depcomp_with_libtool in
     # explicit declaration, libtool falls back to a static library
     # only, regardless of any --enable-shared flags etc.
     LIBPRIMARY=LTLIBRARIES LINKADD=LIBADD NOUNDEF=-no-undefined
+    libbaz_ldflags="libbaz_${a}_LDFLAGS = $NOUNDEF"
     echo lib_LTLIBRARIES = libfoo.la >> Makefile.am
     make_ok ()
     {
@@ -175,6 +176,7 @@ case $depcomp_with_libtool in
     po=Po objext='$(OBJEXT)' a=a
     normalized_target=foo
     LIBPRIMARY=LIBRARIES LINKADD=LDADD NOUNDEF=
+    libbaz_ldflags=
     echo bin_PROGRAMS = foo >> Makefile.am
     make_ok ()
     {
@@ -192,7 +194,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}_LDFLAGS = $NOUNDEF
 ${normalized_target}_${LINKADD} = src/libbaz.$a
 
 .PHONY: grep-test
@@ -215,7 +217,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}
+$libbaz_ldflags
 END
 
 cat > foo.c <<'END'