From: Alexandre Oliva Date: Wed, 4 Nov 1998 07:10:43 +0000 (+0000) Subject: * ltconfig.in (compiler_o_lo): check whether we can write directly X-Git-Tag: start~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1168e3b550fcfeff2495c18723b0868a3780a9d3;p=thirdparty%2Flibtool.git * ltconfig.in (compiler_o_lo): check whether we can write directly to a .lo * ltmain.in (compiler_o_lo): if not, write to .o and rename it --- diff --git a/ChangeLog b/ChangeLog index 55bb293bc..c9ff88b3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1998-11-04 Alexandre Oliva + + * ltconfig.in (compiler_o_lo): check whether we can write directly + to a .lo + * ltmain.in (compiler_o_lo): if not, write to .o and rename it + 1998-11-04 Ian Lance Taylor * ltconfig.in: For sunos4 using GNU ld, set hardcode_minus_L to diff --git a/ltconfig.in b/ltconfig.in index 10b9523e2..ee5caf588 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -616,13 +616,13 @@ else fi # Check to see if options -o and -c are simultaneously supported by compiler -echo $ac_n "checking if $compiler supports -c and -o options... $ac_c" 1>&6 +echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -c -o conftest.o" -echo "$progname:@LINENO@: checking if $compiler supports -c and -o options" >&5 -if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then +CFLAGS="$CFLAGS -c -o conftest2.o" +echo "$progname:@LINENO@: checking if $compiler supports -c -o file.o" >&5 +if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -642,6 +642,37 @@ fi CFLAGS="$save_CFLAGS" $rm conftest* +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 "int some_variable = 0;" > conftest.c + 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 @@ -1405,7 +1436,8 @@ case "$ltmain" in old_postuninstall_cmds archive_cmds postinstall_cmds postuninstall_cmds \ allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe \ - hardcode_libdir_flag_spec hardcode_libdir_separator compiler_c_o need_locks; do + hardcode_libdir_flag_spec hardcode_libdir_separator \ + compiler_c_o compiler_o_lo need_locks; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ @@ -1543,6 +1575,9 @@ pic_flag=$pic_flag # 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 3965769c9..d1917d1a3 100644 --- a/ltmain.in +++ b/ltmain.in @@ -415,9 +415,12 @@ compiler." # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile$pic_flag -DPIC $srcfile" - if test "$compiler_c_o" = yes; then + if test "$compiler_o_lo" = yes; then command="$command -o $libobj" output_obj="$libobj" + elif test "$compiler_c_o" = yes; then + command="$command -o $obj" + output_obj="$obj" fi $show "$command" @@ -448,7 +451,7 @@ compiler." fi # Just move the object if needed, then go on to compile the next one - if test "$compiler_c_o" = no && test x"$output_obj" != x"$libobj"; then + if test "$compiler_o_lo" = no && test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else