From 4a5377aef7a6093a8cc4ab76d5ad37ca3592b44c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 27 Oct 2015 20:47:27 +0200 Subject: [PATCH] [SV 46304] Don't invoke C++ compiler on C sources on MS-Windows * default.c (default_variables) [HAVE_CASE_INSENSITIVE_FS]: Make COMPILE.C and LINK.C be synonyms for COMPILE.c and LINK.c, respectively. --- default.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/default.c b/default.c index 93c993e1..08a69a87 100644 --- a/default.c +++ b/default.c @@ -602,10 +602,21 @@ static const char *default_variables[] = "COMPILE.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c", "LINK.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)", "COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c", +#ifndef HAVE_CASE_INSENSITIVE_FS + /* On case-insensitive filesystems, treat *.C files as *.c files, + to avoid erroneously compiling C sources as C++, which will + probably fail. */ "COMPILE.C", "$(COMPILE.cc)", +#else + "COMPILE.C", "$(COMPILE.c)", +#endif "COMPILE.cpp", "$(COMPILE.cc)", "LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)", +#ifndef HAVE_CASE_INSENSITIVE_FS "LINK.C", "$(LINK.cc)", +#else + "LINK.C", "$(LINK.c)", +#endif "LINK.cpp", "$(LINK.cc)", "YACC.y", "$(YACC) $(YFLAGS)", "LEX.l", "$(LEX) $(LFLAGS) -t",