gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
authorBruno Haible <bruno@clisp.org>
Tue, 5 Oct 2010 00:30:24 +0000 (02:30 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 5 Oct 2010 01:24:51 +0000 (03:24 +0200)
* 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.

ChangeLog
gnulib-tool

index 8479498e36449bb71606d88742052e608cce8651..f58806975850e3ff983e6a3833c9ab7b3b2f3ffa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-10-04  Bruno Haible  <bruno@clisp.org>
+
+       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.
+
 2010-10-04  Bruno Haible  <bruno@clisp.org>
 
        threadlib: Make option --with-libpth-prefix work.
index 245ed995e13a452303af2c542de11dc4eed57799..b89c2eb4a82763629183faa98e5c943b57d98b9b 100755 (executable)
@@ -2931,6 +2931,18 @@ func_emit_lib_Makefile_am ()
   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