From: Ossama Othman Date: Mon, 31 Jan 2000 19:23:44 +0000 (+0000) Subject: * ltconfig.in (compile_c_lo): Removed the test that checks if X-Git-Tag: multi-language-merge-point~247 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0b908b56e6ef64b6a42446971f395a03eed73d1;p=thirdparty%2Flibtool.git * ltconfig.in (compile_c_lo): Removed the test that checks if compiler support "-c -o file.lo" since the changes made to ltmain.in remove the need to do this. * ltmain.in: Changed compile mode to generate `.lo' libtool objects, instead of generating PIC objects that end in `.lo'. These are analogous to libtool archive `.la' files. They contain the name of the PIC and non-PIC objects. All PIC objects will now be placed in `$objdir' (usually `.libs'). No changes to existing Makefiles should be necessary. Libtool should work the same as it did prior to this change. This change was necessary to correct a problem with Sun C++'s template repository mechanism since it couldn't handle repository objects ending in `.lo'. This change causes some tests to fail, so it still needs some work. The tests that fail are: dryrun.test, build-relink2.test, link-2.test. The quote.test and sh.test tests also fail but they failed after the initial multi-language changes were made. --- diff --git a/ChangeLog b/ChangeLog index d64e2add5..284edded8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2000-01-31 Ossama Othman + + * ltconfig.in (compile_c_lo): Removed the test that checks if + compiler support "-c -o file.lo" since the changes made to + ltmain.in remove the need to do this. + * ltmain.in: Changed compile mode to generate `.lo' libtool + objects, instead of generating PIC objects that end in `.lo'. + These are analogous to libtool archive `.la' files. They contain + the name of the PIC and non-PIC objects. All PIC objects will now + be placed in `$objdir' (usually `.libs'). No changes to existing + Makefiles should be necessary. Libtool should work the same as it + did prior to this change. This change was necessary to correct a + problem with Sun C++'s template repository mechanism since it + couldn't handle repository objects ending in `.lo'. This change + causes some tests to fail, so it still needs some work. The tests + that fail are: dryrun.test, build-relink2.test, link-2.test. The + quote.test and sh.test tests also fail but they failed after the + initial multi-language changes were made. + 2000-01-25 Ossama Othman * libtool.m4, ltconfig.in, ltmain.in: Merged updates found in diff --git a/ltconfig.in b/ltconfig.in index 0e176397e..0672736f7 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -798,37 +798,6 @@ cd .. rmdir conftest $rm -r conftest 2>/dev/null -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 - $rm conftest* - echo $lt_simple_compile_test_code > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - echo "$progname:@LINENO@: checking if $compiler supports -c -o file.lo" >&5 -if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_o_lo=no - else - echo "$ac_t"yes 1>&6 - compiler_o_lo=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_o_lo=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* -else - compiler_o_lo=no -fi - # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then @@ -1952,7 +1921,7 @@ case "$ltmain" in finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do + compiler_c_o need_locks exclude_expsyms include_expsyms; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ @@ -2139,9 +2108,6 @@ pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o -# Can we write directly to a .lo ? -compiler_o_lo=$compiler_o_lo - # Must we lock files when doing compilation ? need_locks=$need_locks diff --git a/ltmain.in b/ltmain.in index 253e27347..458e03081 100644 --- a/ltmain.in +++ b/ltmain.in @@ -470,9 +470,9 @@ if test -z "$show_help"; then # Delete any leftover library objects. if test "$build_old_libs" = yes; then - removelist="$obj $libobj" + removelist="$obj $objdir/$obj $libobj" else - removelist="$libobj" + removelist="$objdir/$obj $libobj" fi $run $rm $removelist @@ -520,6 +520,19 @@ compiler." eval srcfile=\"$fix_srcfile_path\" fi + $run $rm "libobj" + + # Create a libtool object file (analogous to a `.la' file) + cat > $libobj <> $libobj <> $libobj <> $libobj <> $libobj < $libobj" - $run eval "echo timestamp > \$libobj" || exit $? - else - # Move the .lo from within objdir - $show "$mv $libobj $lo_libobj" - if $run $mv $libobj $lo_libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi +EOF fi # Unlock the critical section if it was locked @@ -775,6 +751,7 @@ compiler." module=no no_install=no objs= + old_objects= prefer_static_libs=no preload=no prev= @@ -1192,27 +1169,60 @@ compiler." ;; *.lo) - # A library object. - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + object_name= + old_object= + + # Read the .lo file + # If there is no directory component, then add one. + case "$arg" in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$object_name" || test -z "$old_object"; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit 1 + fi + + if test "$object_name" != none; then + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $object_name" + if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` - prev= + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $object_name" + prev= + fi + + # A PIC object. + libobjs="$libobjs $object_name" + fi + + # Non-PIC object. + if test "$old_object" != none; then + # A standard non-PIC object + old_objects="$old_objects $old_object" + fi + else + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 fi - libobjs="$libobjs $arg" ;; - *.a | *.lib) + *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" @@ -1366,9 +1376,9 @@ compiler." $echo "$help" 1>&2 exit 1 ;; - *.a | *.lib) + *.$libext) linkmode=oldlib ;; - *.lo | *.o | *.obj) + *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; @@ -1465,7 +1475,7 @@ compiler." continue fi ;; - *.a | *.lib) + *.$libext) if test $linkmode = prog; then if test $pass = scan; then deplibs="$deplibs $deplib" @@ -2293,9 +2303,22 @@ compiler." fi if test "$mode" != relink; then - # Remove our outputs. - $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" - $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`echo $output_objdir/* | $Xsed -e "s/.*\.$objext//"` + for p in $tempremovelist; do + case "$p" in + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi fi # Now set the variables for building old libraries. @@ -2624,22 +2647,22 @@ EOF linknames="$linknames $link" done - # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) in case we are running --disable-static - for obj in $libobjs; do - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` - if test ! -f $xdir/$oldobj; then - $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" - $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? - fi - done +# # Ensure that we have .o objects for linkers which dislike .lo +# # (e.g. aix) in case we are running --disable-static +# for obj in $libobjs; do +# xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` +# if test "X$xdir" = "X$obj"; then +# xdir="." +# else +# xdir="$xdir" +# fi +# baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` +# oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` +# if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then +# $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" +# $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? +# fi +# done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` @@ -2881,8 +2904,8 @@ EOF # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. - $show "echo timestamp > $libobj" - $run eval "echo timestamp > $libobj" || exit $? + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? exit 0 fi @@ -2898,20 +2921,20 @@ EOF $run eval "$cmd" || exit $? done IFS="$save_ifs" - else - # Just create a symlink. - $show $rm $libobj - $run $rm $libobj - xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$libobj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` - $show "(cd $xdir && $LN_S $oldobj $baseobj)" - $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? +# else +# # Just create a symlink. +# $show $rm $libobj +# $run $rm $libobj +# xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` +# if test "X$xdir" = "X$libobj"; then +# xdir="." +# else +# xdir="$xdir" +# fi +# baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` +# oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` +# $show "(cd $xdir && $LN_S $oldobj $baseobj)" +# $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then @@ -3553,7 +3576,7 @@ fi\ oldobjs="$libobjs_save" build_libtool_libs=no else - oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` + oldobjs="$objs$old_deplibs $old_objects" fi addlibs="$old_convenience" fi @@ -3591,7 +3614,7 @@ fi\ $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP` done fi @@ -3599,23 +3622,23 @@ fi\ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else - # Ensure that we have .o objects in place in case we decided - # not to build a shared library, and have fallen back to building - # static libs even though --disable-static was passed! - for oldobj in $oldobjs; do - if test ! -f $oldobj; then - xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$oldobj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` - obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` - $show "(cd $xdir && ${LN_S} $obj $baseobj)" - $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? - fi - done +# # Ensure that we have .o objects in place in case we decided +# # not to build a shared library, and have fallen back to building +# # static libs even though --disable-static was passed! +# for oldobj in $oldobjs; do +# if test ! -f $oldobj; then +# xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` +# if test "X$xdir" = "X$oldobj"; then +# xdir="." +# else +# xdir="$xdir" +# fi +# baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` +# obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` +# $show "(cd $xdir && ${LN_S} $obj $baseobj)" +# $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? +# fi +# done eval cmds=\"$old_archive_cmds\" fi @@ -3867,7 +3890,7 @@ relink_command=\"$relink_command\"" # Do each installation. case "$file" in - *.a | *.lib) + *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;;