* lib/compile (func_cl_wrapper): MSVC only recognizes the .cpp
file extension as C++, unless it's given a hint. So hint about
.cc, .CC, .cxx, .CXX, c++ and C++. Also do path conversion on
.c, .cpp, .CPP, .lib, .LIB and .Lib files.
* lib/compile3.test: Test the C++ hinting.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
+2010-08-16 Peter Rosin <peda@lysator.liu.se>
+
+ Support more C++ file extensions for MSVC in the compile script.
+ * lib/compile (func_cl_wrapper): MSVC only recognizes the .cpp
+ file extension as C++, unless it's given a hint. So hint about
+ .cc, .CC, .cxx, .CXX, c++ and C++. Also do path conversion on
+ .c, .cpp, .CPP, .lib, .LIB and .Lib files.
+ * lib/compile3.test: Test the C++ hinting.
+
2010-08-12 Peter Rosin <peda@lysator.liu.se>
Enable the use of "link -lib" as the wrapped archiver.
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
-scriptversion=2010-08-07.06; # UTC
+scriptversion=2010-08-16.07; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010 Free Software
# Foundation, Inc.
eat=1
linker_opts="$linker_opts $2"
;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib)
+ func_file_conv "$1"
+ set x "$@" "$file"
+ shift
+ ;;
*)
set x "$@" "$1"
shift
opts=`./compile ./cl -c foo.c -o foo.o -Ibaz`
test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
+# Check if compile handles "foo.cc" as C++.
+opts=`./compile ./cl -c foo.cc -o foo.o -Ibaz`
+test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
+
: