]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in (convenience): fixed race condition when more than one
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Fri, 2 Apr 1999 13:57:23 +0000 (13:57 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Fri, 2 Apr 1999 13:57:23 +0000 (13:57 +0000)
library was linked with the same convenience library by
uniquifying the extract directory.  It is now named after the new
library *and* the old one, and lives in the objdir of the new one.

ChangeLog
ltmain.in

index 78084b9beb9ee3cd375d260528d87b4794855de2..1d3b7828d7b87e85584ac953699420355fa4c221 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1999-04-02  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * ltmain.in (convenience): fixed race condition when more than one 
+       library was linked with the same convenience library by
+       uniquifying the extract directory.  It is now named after the new
+       library *and* the old one, and lives in the objdir of the new one.
+
 1999-04-02  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * ltmain.in (-L*): do not abort just because a directory specified 
index f3c2d3eed3909a8e992980024367220970627cd4..90c7c143250e8f7e879fe920837b826424d55832 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -2213,11 +2213,25 @@ EOF
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
          fi
        else
+         gentop="$output_objdir/${outputname}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.
-           xdir="$xlib"x
-           generated="$generated $xdir"
+           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"
@@ -2227,8 +2241,8 @@ EOF
            if test $status -ne 0 && test ! -d "$xdir"; then
              exit $status
            fi
-           $show "(cd $xdir && $AR x ../$xlib)"
-           $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
+           $show "(cd $xdir && $AR x $xabs)"
+           $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
 
            libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
          done
@@ -3493,26 +3507,42 @@ fi\
        addlibs="$old_convenience"
       fi
 
-      # Add in members from convenience archives.
-      for xlib in $addlibs; do
-       # Extract the objects.
-       xdir="$xlib"x
-       generated="$generated $xdir"
-       xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-
-       $show "${rm}r $xdir"
-       $run ${rm}r "$xdir"
-       $show "mkdir $xdir"
-       $run mkdir "$xdir"
+      if test -n "$addlibs"; then
+       gentop="$output_objdir/${outputname}x"
+       $show "${rm}r $gentop"
+       $run ${rm}r "$gentop"
+       $show "mkdir $gentop"
+       $run mkdir "$gentop"
        status=$?
-       if test $status -ne 0 && test ! -d "$xdir"; then
+       if test $status -ne 0 && test ! -d "$gentop"; then
          exit $status
        fi
-       $show "(cd $xdir && $AR x ../$xlib)"
-       $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
+       generated="$generated $gentop"
+         
+       # Add in members from convenience archives.
+       for xlib in $addlibs; 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"
 
-       oldobjs="$oldobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
-      done
+         $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 $?
+
+         oldobjs="$oldobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+       done
+      fi
 
       # Do each command in the archive commands.
       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then