aboutsummaryrefslogtreecommitdiffstats
path: root/force-as-needed-for-shared-lib-in-libtool
diff options
context:
space:
mode:
Diffstat (limited to 'force-as-needed-for-shared-lib-in-libtool')
-rwxr-xr-xforce-as-needed-for-shared-lib-in-libtool14
1 files changed, 14 insertions, 0 deletions
diff --git a/force-as-needed-for-shared-lib-in-libtool b/force-as-needed-for-shared-lib-in-libtool
new file mode 100755
index 0000000..2694273
--- /dev/null
+++ b/force-as-needed-for-shared-lib-in-libtool
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# replaces
+# tmp_sharedflag='-shared' ;;
+# with
+# tmp_sharedflag='-shared -Wl,--as-needed' ;;
+#
+# since passing -Wl,--as-needed is not enough because libtool moves it
+# after *.o and libs
+
+if [ -e configure ]; then
+ echo "Forcing -Wl,--as-needed in configure/libtool to workaround libtool bug (cf http://lists.gnu.org/archive/html/libtool-patches/2004-06/msg00002.html)"
+ sed -i "s/^\([ \t]*tmp_sharedflag\)='-shared'/\1='-shared -Wl,--as-needed'/" configure
+fi