diff gnulib-tool @ 13763:064af6542c0a

gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library. * gnulib-tool (func_emit_lib_Makefile_am): When preparing for a libtool library, put '-no-undefined' and the link dependencies into _LDFLAGS. Reported by Bruce Korb and Eric Blake.
author Bruno Haible <bruno@clisp.org>
date Tue, 05 Oct 2010 02:30:24 +0200
parents 38b745d4e6a4
children f19c8837df90
line wrap: on
line diff
--- a/gnulib-tool	Tue Oct 05 03:19:16 2010 +0200
+++ b/gnulib-tool	Tue Oct 05 02:30:24 2010 +0200
@@ -2931,6 +2931,18 @@
   echo "EXTRA_${libname}_${libext}_SOURCES ="
   if test "$libtool" = true; then
     echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)"
+    echo "${libname}_${libext}_LDFLAGS += -no-undefined"
+    # Synthesize an ${libname}_${libext}_LDFLAGS augmentation by combining
+    # the link dependencies of all modules.
+    for module in $modules; do
+      func_verify_nontests_module
+      if test -n "$module"; then
+        func_get_link_directive "$module"
+      fi
+    done \
+      | LC_ALL=C sed -e '/^$/d' -e 's/ when linking with libtool.*//' \
+      | LC_ALL=C sort -u \
+      | LC_ALL=C sed -e 's/^/'"${libname}_${libext}"'_LDFLAGS += /'
   fi
   echo
   if test -n "$pobase"; then