]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
When assigning $linklib value, honor [-all]-static[-libtool-libs]
authorCharles Wilson <libtool@cwilson.fastmail.fm>
Sun, 12 Sep 2010 13:19:51 +0000 (09:19 -0400)
committerCharles Wilson <libtool@cwilson.fastmail.fm>
Sun, 12 Sep 2010 15:03:21 +0000 (11:03 -0400)
* libltdl/config/ltmain.m4sh (func_mode_link): When prefer_static_libs
and static library exists, ensure old_library name is used as $linklib.
Fixes failure on mingw when both static and shared libraries are
present.

Signed-off-by: Charles Wilson <libtool@cwilson.fastmail.fm>
ChangeLog
libltdl/config/ltmain.m4sh

index b9abe8a372f3df9640910f1fe6f9d25f8347ea1a..6b76340ffbf22492cec1899d8e94cf5df9fa19b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-09-12  Charles Wilson  <libtool@cwilson.fastmail.fm>
+
+       When assigning $linklib value, honor [-all]-static[-libtool-libs]
+
+       * libltdl/config/ltmain.m4sh (func_mode_link): When prefer_static_libs
+       and static library exists, ensure old_library name is used as $linklib.
+       Fixes failure on mingw when both static and shared libraries are
+       present.
+
 2010-09-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        tests: work around zsh use of $options variable.
index 509a421fa771a18042308084f69db2d64e87faee..6036f4f830dadd207aeef5573910d4273e56dcb7 100644 (file)
@@ -5652,9 +5652,15 @@ func_mode_link ()
 
        # Get the name of the library we link against.
        linklib=
-       for l in $old_library $library_names; do
-         linklib="$l"
-       done
+       if test -n "$old_library" &&
+          { test "$prefer_static_libs" = yes ||
+            test "$prefer_static_libs,$installed" = "built,no"; }; then
+         linklib=$old_library
+       else
+         for l in $old_library $library_names; do
+           linklib="$l"
+         done
+       fi
        if test -z "$linklib"; then
          func_fatal_error "cannot find name of link library for \`$lib'"
        fi