summaryrefslogtreecommitdiff
blob: 526877a6d35b66e74cd18a9e514170f9e64a6ade (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
33
34
35
36
37
38
--- ltmain.sh.orig	2012-08-19 10:18:57.929178597 +0200
+++ ltmain.sh	2012-08-19 10:31:43.409388998 +0200
@@ -5798,10 +5798,15 @@
 	IFS="$save_ifs"
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
 
+      -Wl,--as-needed|-Wl,--no-as-needed)
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
       -Wl,*)
 	func_stripname '-Wl,' '' "$arg"
 	args=$func_stripname_result
 	arg=
 	save_ifs="$IFS"; IFS=','
@@ -6158,10 +6163,19 @@
 
       for deplib in $libs; do
 	lib=
 	found=no
 	case $deplib in
+	-Wl,--as-needed|-Wl,--no-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|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
 	  if test "$linkmode,$pass" = "prog,link"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"