From 03d1aa34d110422a3f7e41977c97b567095f064f Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 21 Sep 2011 20:58:27 -0400 Subject: [PATCH] Avoid gratuitous library dependencies linking gnulib. libcdecl doesn't use the readline module at all, but libtool happily pulls it in as a dependency. Handle library dependencies manually to avoid this problem. --- scripts/fix-gnulib.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/fix-gnulib.pl b/scripts/fix-gnulib.pl index b8185fa..834fb7a 100755 --- a/scripts/fix-gnulib.pl +++ b/scripts/fix-gnulib.pl @@ -111,6 +111,14 @@ EOF # useful for non-recursive builds. Strip them out. drop if (/^(AM_CPPFLAGS|AM_CFLAGS)/); + # Library dependencies are added automatically to libgnu.la by + # gnulib-tool. Unfortunately, this means that everything linking + # against libgnu.la is forced to pull in the same deps, even if they're + # unneeded. Furthermore, a libtool linker flag reordering bug prevents + # --as-needed from stripping out the useless deps, so it's better to + # handle them all manually. + drop if (/LDFLAGS/); + # Rewrite automake hook targets to be more generic. if (s/^(.*)-local:/\1-gnulib:/) { print ".PHONY: $1-gnulib\n"; -- 2.43.0