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