Hi Ralf! Den 2010-08-31 19:02 skrev Ralf Wildenhues: > * Peter Rosin wrote on Tue, Aug 31, 2010 at 06:59:25PM CEST: >> When the compile wrapper is used to link, it needs to also >> transform /absolute/object/files.obj to win32 format for >> easy consumption by MSVC. >> >> Ok for the msvc branch? > > Yes, bumping scriptversion and extending the best-fitting test, I'm > guessing tests/compile4.test? Or you can always add a new one.
Pushing and merging into master as attached. The test fails w/o the compile script changes and passes with them. Thanks for the review, and for all other reviews I forgot to thank you for! Cheers, Peter
>From 8429d356654fe5248f039e57f5532b5aa68aee24 Mon Sep 17 00:00:00 2001 From: Peter Rosin <p...@lysator.liu.se> 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 <p...@lysator.liu.se> --- 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 <p...@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 <p...@lysator.liu.se> 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