From: Nick Bowler Date: Thu, 22 Sep 2011 00:58:27 +0000 (-0400) Subject: Avoid gratuitous library dependencies linking gnulib. X-Git-Url: https://git.draconx.ca/gitweb/dxcommon.git/commitdiff_plain/03d1aa34d110422a3f7e41977c97b567095f064f 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. --- 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";