[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ITS#3977 libtool 1.5.18 and installed libraries



This is a multi-part message in MIME format.
--------------020002020104040400050605
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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/


--------------020002020104040400050605
Content-Type: text/plain;
 name="dif.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="dif.txt"

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

--------------020002020104040400050605--