Integrate a patch from Debian (see #347650) which fixes a bug in libtool when -Wl...
Sylvestre Ledru [Sat, 28 Mar 2009 20:32:15 +0000 (21:32 +0100)]
scilab/config/ltmain.sh

index 5def351..f97fd3d 100755 (executable)
@@ -1807,6 +1807,11 @@ EOF
        arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
        ;;
 
+      -Wl,--as-needed)
+       deplibs="$deplibs $arg"
+       continue
+       ;;
+      
       -Wl,*)
        args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
        arg=
@@ -2150,6 +2155,15 @@ EOF
        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"