]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltconfig.in (compiler_o_lo): check whether we can write directly
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Wed, 4 Nov 1998 07:10:43 +0000 (07:10 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 4 Nov 1998 07:10:43 +0000 (07:10 +0000)
to a .lo
* ltmain.in (compiler_o_lo): if not, write to .o and rename it

ChangeLog
ltconfig.in
ltmain.in

index 55bb293bc368fbcd0d999b78d3f1aa9a70d7990a..c9ff88b3a37b9449dd8db64b86c5ea521ed36a60 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1998-11-04  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * 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  <ian@cygnus.com>
 
        * ltconfig.in: For sunos4 using GNU ld, set hardcode_minus_L to
index 10b9523e2dfe74e7836cea02c117dfc21c523551..ee5caf58836ed08a1c1e50188f13a5a9e9298425 100755 (executable)
@@ -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
 
index 3965769c9260d1bbeae9217797d076d7cf833837..d1917d1a31457774f0a6073e5daac25b9c2d6164 100644 (file)
--- 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