>From 8429d356654fe5248f039e57f5532b5aa68aee24 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Tue, 31 Aug 2010 21:57:22 +0200 Subject: [PATCH] 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. Signed-off-by: Peter Rosin --- ChangeLog | 7 +++++++ lib/compile | 4 ++-- tests/compile4.test | 7 +++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a054e2..5d80edb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-08-31 Peter Rosin + + 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 Optimize compile script on MSYS. diff --git a/lib/compile b/lib/compile index b6419ce..77f8f31 100755 --- a/lib/compile +++ b/lib/compile @@ -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 diff --git a/tests/compile4.test b/tests/compile4.test index 9e7bcbb..5a0bdf3 100755 --- a/tests/compile4.test +++ b/tests/compile4.test @@ -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 -- 1.7.1