]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in (compile): When output object is in subdir, create
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Fri, 26 May 2000 05:16:42 +0000 (05:16 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Fri, 26 May 2000 05:16:42 +0000 (05:16 +0000)
the pic_object in subdir/objdir, not objdir/subdir.

ChangeLog
ltmain.in

index 737b372d72ae19330c9df6b342de36a222d5e039..4499d3bb7ae4a24fd9cf82a82b9885a60cdc8bbe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-05-26  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * ltmain.in (compile): When output object is in subdir, create
+       the pic_object in subdir/objdir, not objdir/subdir.
+
 2000-05-24  Ossama Othman  <ossama@debian.org>
 
        * libtool.m4 (AC_LIBTOOL_PICMODE): Merged this macro from the HEAD
index 5a38d9b8acc7301cebefb8818792e0debacf12f0..09caebd7462f1fa0ccc3b10682679c380f49e8b4 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -502,6 +502,15 @@ if test -z "$show_help"; then
       ;;
     esac
 
+    objname=`echo "X$obj" | $Xsed -e 's%^.*/%%'`
+    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$xdir" = "X$obj"; then
+      xdir=
+    else
+      xdir=$xdir/
+    fi
+    lobj=${xdir}$objdir/$objname
+
     if test -z "$base_compile"; then
       $echo "$modename: you must specify a compilation command" 1>&2
       $echo "$help" 1>&2
@@ -510,9 +519,9 @@ if test -z "$show_help"; then
 
     # Delete any leftover library objects.
     if test "$build_old_libs" = yes; then
-      removelist="$obj $objdir/$obj $libobj"
+      removelist="$obj $lobj $libobj"
     else
-      removelist="$objdir/$obj $libobj"
+      removelist="$lobj $libobj"
     fi
 
     $run $rm $removelist
@@ -598,24 +607,24 @@ EOF
        command="$base_compile $srcfile"
       fi
 
-      if test ! -d $objdir; then
-       $show "$mkdir $objdir"
-       $run $mkdir $objdir
+      if test ! -d ${xdir}$objdir; then
+       $show "$mkdir ${xdir}$objdir"
+       $run $mkdir ${xdir}$objdir
        status=$?
-       if test $status -ne 0 && test ! -d $objdir; then
+       if test $status -ne 0 && test ! -d ${xdir}$objdir; then
          exit $status
         fi
       fi 
 
       # Place PIC objects in $objdir
-      output_obj="$objdir/$obj"
+      output_obj=$lobj
       command="$command -o $output_obj"
 
       $run $rm "$output_obj"
 
       # Append the name of the PIC object to the libtool object file.
       test -z "$run" && cat >> $libobj <<EOF
-pic_object='$output_obj'
+pic_object='$objdir/$objname'
 
 EOF
 
@@ -648,9 +657,9 @@ compiler."
       fi
 
       # Just move the object if needed, then go on to compile the next one
-      if test x"$output_obj" != x"$objdir/$obj"; then
-       $show "$mv $output_obj $objdir/$obj"
-       if $run $mv $output_obj $objdir/$obj; then :
+      if test x"$output_obj" != x"$lobj"; then
+       $show "$mv $output_obj $lobj"
+       if $run $mv $output_obj $lobj; then :
        else
          error=$?
          $run $rm $removelist
@@ -687,7 +696,7 @@ EOF
       # Only append if the libtool object file exists.
       test -z "$run" && cat >> $libobj <<EOF
 # Name of the non-PIC object.
-non_pic_object='$obj'
+non_pic_object='$objname'
 
 EOF