From: Alexandre Oliva Date: Thu, 27 May 1999 11:41:01 +0000 (+0000) Subject: * ltmain.in: Expand convenience libraries when creating reloadable X-Git-Tag: release-1-3-3~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d6c6e46d8c13246081c9873de14348a4976cf8d;p=thirdparty%2Flibtool.git * ltmain.in: Expand convenience libraries when creating reloadable objects. * NEWS: Ditto. --- diff --git a/ChangeLog b/ChangeLog index bac9d7eb8..cb65e6042 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-05-27 Alexandre Oliva , Olly Betts + + * ltmain.in: Expand convenience libraries when creating reloadable + objects. + * NEWS: Ditto. + 1999-05-27 Alexandre Oliva * NEWS: Mention the two bugfixes below. diff --git a/NEWS b/NEWS index d045d73ec..b0ca8f4bc 100644 --- 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. diff --git a/ltmain.in b/ltmain.in index bd572352d..95e8c735b 100644 --- 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 ;;