summaryrefslogtreecommitdiff
path: root/build-aux/ltmain-asneeded.patch
blob: af5ae6b2de96bb206345cdf3986e4181d5b658a5 (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
--- ltmain.sh.orig      2013-06-26 14:31:53.472627840 +1000
+++ ltmain.sh   2013-06-26 14:30:56.137038936 +1000
@@ -5800,6 +5800,14 @@
        arg=$func_stripname_result
        ;;
 
+      -Wl,*--as-needed*)
+       deplibs="$deplibs $wl--as-needed"
+       ;;
+
+      -Wl,*--no-as-needed*)
+       deplibs="$deplibs $wl--no-as-needed"
+       ;;
+
       -Wl,*)
        func_stripname '-Wl,' '' "$arg"
        args=$func_stripname_result
@@ -6160,6 +6168,15 @@
        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