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

Re: Libtool 1.2b static lib problems



Hi!

>>>>> Ossama Othman writes:

 OO> Has anyone tried building static libraries with shared libraries
 OO> disabled with libtool 1.2b?  If I enable static library creation
 OO> and disable shared library creation, e.g.:

 OO> 	./configure --enable-static --disable-shared

 OO> My static library apparently gets built but then gets wiped out
 OO> by libtool.

The attached patch should work for you if you apply it to ltmain.sh.

Good luck,

-- 
 Gordon Matzigkeit <gord@fig.org> //\ I'm a FIG (http://www.fig.org/)
    Lovers of freedom, unite!     \// I use GNU (http://www.gnu.org/)

Copyright (C) 1998 FIG.org; the creator offers you this gift and wants it
to remain free.  See http://www.fig.org/freedom.html for details.
  This work may be copied, modified and distributed under the GNU General
  Public License (GPL).  See http://www.gnu.org/copyleft/gpl.html.

diff -ur libtool-1.2b.orig/ltmain.in libtool-1.2b/ltmain.in
--- libtool-1.2b.orig/ltmain.in	Wed Jul  1 04:08:34 1998
+++ libtool-1.2b/ltmain.in	Sun Sep 20 18:00:48 1998
@@ -932,7 +932,7 @@
       install_libdir="$2"
 
       # Now set the variables for building old libraries.
-      oldlibs="$objdir/$libname.a"
+      oldlibs=
       if test -z "$rpath"; then
 	# Building a libtool convenience library.
 	oldlibs="$objdir/$libname.al $oldlibs"
@@ -1074,6 +1074,14 @@
         fi
       fi
 
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+        oldlibs="$oldlibs $objdir/$libname.a"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
+      fi
+
       if test "$build_libtool_libs" = yes; then
 	# Get the real and link names of the library.
 	eval library_names=\"$library_names_spec\"
@@ -1095,9 +1103,6 @@
 
 	# Use standard objects if they are PIC.
 	test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
-
-	# Transform .lo files to .o files.
-	test "$build_old_libs" = yes && oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^   ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
 
 	if test -n "$whole_archive_flag_spec"; then
 	  if test -n "$convenience"; then


Reply to: