summarylogtreecommitdiffstats
path: root/99_ltmain_as-needed.patch
blob: 2aa19c1e9f305fe9d90f6075faeb858d3495a33c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Index: libunique-1.1.6/ltmain.sh
===================================================================
--- libunique-1.1.6.orig/ltmain.sh	2009-11-12 14:57:49.000000000 +0100
+++ libunique-1.1.6/ltmain.sh	2011-10-27 20:25:26.369869652 +0200
@@ -4716,6 +4716,11 @@
 	arg=$func_stripname_result
 	;;
 
+      -Wl,--as-needed)
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
       -Wl,*)
 	func_stripname '-Wl,' '' "$arg"
 	args=$func_stripname_result
@@ -5067,6 +5072,15 @@
 	lib=
 	found=no
 	case $deplib in
+	-Wl,--as-needed)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	  fi
+	  continue
+	  ;;
 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
 	  if test "$linkmode,$pass" = "prog,link"; then
 	    compile_deplibs="$deplib $compile_deplibs"