+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
;;
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
# 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
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
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
# 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