]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: Expand convenience libraries when creating reloadable
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Thu, 27 May 1999 11:41:01 +0000 (11:41 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Thu, 27 May 1999 11:41:01 +0000 (11:41 +0000)
objects.
* NEWS: Ditto.

ChangeLog
NEWS
ltmain.in

index bac9d7eb8da6a09665291e5ea401f9ea80469004..cb65e6042e065d60cae3297a55cd3d3051f2719b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-05-27  Alexandre Oliva  <oliva@dcc.unicamp.br>, Olly Betts  <olly@muscat.co.uk>
+
+       * ltmain.in: Expand convenience libraries when creating reloadable 
+       objects.
+       * NEWS: Ditto.
+
 1999-05-27  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * NEWS: Mention the two bugfixes below.
diff --git a/NEWS b/NEWS
index d045d73eca759279acfc13380dc8b7cfc4cb5e01..b0ca8f4bc22052d7794dcab4ea9bb7d210603dc5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 NEWS - list of user-visible changes between releases of GNU Libtool
 
 New in CVS version 1.3.2a, Libtool team:
+* Expand convenience libraries when creating reloadable objects.
 * Do not pass -whole-archive or equivalent to symbol extractor.
 * Create directory to expand convenience libraries only when needed.
 \f
index bd572352d4799e7f35a126a69f4f2c779e6ca531..95e8c735b1b2e34fcc823987b1eeaaa1d4bf957f 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -2187,8 +2187,58 @@ EOF
       # Delete the old objects.
       $run $rm $obj $libobj
 
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec
+      wl= 
+
+      if test -n "$convenience"; then
+       if test -n "$whole_archive_flag_spec"; then
+         eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+       else
+         gentop="$output_objdir/${obj}x"
+         $show "${rm}r $gentop"
+         $run ${rm}r "$gentop"
+         $show "mkdir $gentop"
+         $run mkdir "$gentop"
+         status=$?
+         if test $status -ne 0 && test ! -d "$gentop"; then
+           exit $status
+         fi
+         generated="$generated $gentop"
+
+         for xlib in $convenience; do
+           # Extract the objects.
+           case "$xlib" in
+           [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+           *) xabs=`pwd`"/$xlib" ;;
+           esac
+           xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+           xdir="$gentop/$xlib"
+
+           $show "${rm}r $xdir"
+           $run ${rm}r "$xdir"
+           $show "mkdir $xdir"
+           $run mkdir "$xdir"
+           status=$?
+           if test $status -ne 0 && test ! -d "$xdir"; then
+             exit $status
+           fi
+           $show "(cd $xdir && $AR x $xabs)"
+           $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+           reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+         done
+       fi
+      fi
+
       # Create the old-style object.
-      reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
+      reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
 
       output="$obj"
       eval cmds=\"$reload_cmds\"
@@ -2201,9 +2251,21 @@ EOF
       IFS="$save_ifs"
 
       # Exit if we aren't doing a library object file.
-      test -z "$libobj" && exit 0
+      if test -z "$libobj"; then
+       if test -n "$gentop"; then
+         $show "${rm}r $gentop"
+         $run ${rm}r $gentop
+       fi
+
+       exit 0
+      fi
 
       if test "$build_libtool_libs" != yes; then
+       if test -n "$gentop"; then
+         $show "${rm}r $gentop"
+         $run ${rm}r $gentop
+       fi
+
        # Create an invalid libtool object if no PIC, so that we don't
        # accidentally link it into a program.
        $show "echo timestamp > $libobj"
@@ -2213,7 +2275,7 @@ EOF
 
       if test -n "$pic_flag"; then
        # Only do commands if we really have different PIC objects.
-       reload_objs="$libobjs"
+       reload_objs="$libobjs $reload_conv_objs"
        output="$libobj"
        eval cmds=\"$reload_cmds\"
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
@@ -2231,6 +2293,11 @@ EOF
        $run $LN_S $obj $libobj || exit $?
       fi
 
+      if test -n "$gentop"; then
+       $show "${rm}r $gentop"
+       $run ${rm}r $gentop
+      fi
+
       exit 0
       ;;