From d51f0698dfcd45cf209b0b1bcb50d28d96b4913f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 5 Oct 2010 02:30:24 +0200 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ gnulib-tool | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8479498e3..f58806975 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2010-10-04 Bruno Haible + 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 + threadlib: Make option --with-libpth-prefix work. * m4/threadlib.m4 (gl_THREADLIB_BODY): When testing whether pth works, use $LIBPTH, not just -lpth. diff --git a/gnulib-tool b/gnulib-tool index 245ed995e..b89c2eb4a 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -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 -- 2.11.0