libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ITS#3977 libtool 1.5.18 and installed libraries


From: Howard Chu
Subject: Re: ITS#3977 libtool 1.5.18 and installed libraries
Date: Sun, 28 Aug 2005 22:54:27 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050827 SeaMonkey/1.1a

The attached patch appears to fix the problem with libtool-1.5.18 mistreating installed libtool libraries. The documentation indicates that linking a program with "-static" should only statically link un-installed libtool libraries, but libtool was ignoring their installed status and always statically linking them. This patch tweaks prefer_static_libs to distinguish between the -static and -all-static cases so that the link step can actually perform as documented.

--
 -- Howard Chu
 Chief Architect, Symas Corp.  http://www.symas.com
 Director, Highland Sun        http://highlandsun.com/hyc
 OpenLDAP Core Team            http://www.openldap.org/project/

Index: ltmain.sh
===================================================================
RCS file: /repo/OpenLDAP/pkg/ldap/build/ltmain.sh,v
retrieving revision 1.30
diff -u -r1.30 ltmain.sh
--- ltmain.sh   25 Aug 2005 18:09:32 -0000      1.30
+++ ltmain.sh   29 Aug 2005 05:49:11 -0000
@@ -1105,14 +1105,15 @@
          if test -n "$link_static_flag"; then
            dlopen_self=$dlopen_self_static
          fi
+         prefer_static_libs=yes
        else
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
            dlopen_self=$dlopen_self_static
          fi
+         prefer_static_libs=built
        fi
        build_libtool_libs=no
        build_old_libs=yes
-       prefer_static_libs=yes
        break
        ;;
       esac
@@ -2491,8 +2492,12 @@
        fi
 
        link_static=no # Whether the deplib will be linked statically
+       use_static_libs="$prefer_static_libs"
+       if test "$use_static_libs" = built && test "$installed" = yes ; then
+         use_static_libs=no
+       fi
        if test -n "$library_names" &&
-          { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+          { test "$use_static_libs" = no || test -z "$old_library"; }; then
          if test "$installed" = no; then
            notinst_deplibs="$notinst_deplibs $lib"
            need_relink=yes

reply via email to

[Prev in Thread] Current Thread [Next in Thread]