aboutsummaryrefslogtreecommitdiffstats
path: root/force-as-needed-for-shared-lib-in-libtool
blob: 2694273caf5a7fcb55d2ee7c2a904c45b5264c50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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