]> git.ipfire.org Git - thirdparty/make.git/commitdiff
[SV 46304] Don't invoke C++ compiler on C sources on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Tue, 27 Oct 2015 18:47:27 +0000 (20:47 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 27 Oct 2015 18:47:27 +0000 (20:47 +0200)
* 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

index 93c993e152e55a0e425ce0a7a6163be4f06f312d..08a69a876b8ca7b826e5977bba5ecfcc0743d339 100644 (file)
--- 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",