Do file name conversion for object files in the compile wrapper.
authorPeter Rosin <peda@lysator.liu.se>
Tue, 31 Aug 2010 19:57:22 +0000 (21:57 +0200)
committerPeter Rosin <peda@lysator.liu.se>
Tue, 31 Aug 2010 19:57:22 +0000 (21:57 +0200)
* lib/compile (func_cl_wrapper): Do file name conversion for object
files (i.e. extensions .obj, .OBJ, .o and .O) if needed.
* lib/compile4.test: Test the above.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
ChangeLog
lib/compile
tests/compile4.test

index 9a054e2..5d80edb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-08-31  Peter Rosin  <peda@lysator.liu.se>
+
+       Do file name conversion for object files in the compile wrapper.
+       * lib/compile (func_cl_wrapper): Do file name conversion for object
+       files (i.e. extensions .obj, .OBJ, .o and .O) if needed.
+       * lib/compile4.test: Test the above.
+
 2010-08-16  Peter Rosin  <peda@lysator.liu.se>
 
        Optimize compile script on MSYS.
index b6419ce..77f8f31 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand `-c -o'.
 
-scriptversion=2010-08-16.11; # UTC
+scriptversion=2010-08-31.19; # UTC
 
 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010 Free Software
 # Foundation, Inc.
@@ -142,7 +142,7 @@ func_cl_wrapper ()
          set x "$@" -Tp"$file"
          shift
          ;;
-       *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib)
+       *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
          func_file_conv "$1" mingw
          set x "$@" "$file"
          shift
index 9e7bcbb..5a0bdf3 100755 (executable)
@@ -42,7 +42,8 @@ main ()
 EOF
 
 absfoodir=`pwd`/sub
-absmain=`pwd`/main.c
+absmainc=`pwd`/main.c
+absmainobj=`pwd`/main.obj
 
 cat >> configure.in << 'END'
 AC_PROG_CC
@@ -67,6 +68,8 @@ $AUTOMAKE -a
 ./configure
 $MAKE
 
+./compile cl $CPPFLAGS $CFLAGS -c -o "$absmainobj" "$absmainc"
+
 # cl expects archives to be named foo.lib, not libfoo.a so
 # make a simple copy here if needed. This is a severe case
 # of badness, but ignore that since this is not what is
@@ -75,7 +78,7 @@ if test -f sub/libfoo.a; then
   cp sub/libfoo.a sub/foo.lib
 fi
 
-./compile cl $CPPFLAGS $CFLAGS $LDFLAGS -L"$absfoodir" "$absmain" -o main -lfoo
+./compile cl $CFLAGS $LDFLAGS -L"$absfoodir" "$absmainobj" -o main -lfoo
 
 ./main