From ffa28f3914ff402b3915f75e4fed86ac6fb1449d Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 5 Feb 2023 10:22:13 -0500 Subject: [SV 63668] Use autoconf to detect the default C++ compiler * configure.ac: Add AC_PROG_CXX to search for a C++ compiler. (MAKE_CXX): Add the discovered compiler to config.h. * src/default.c (default_variables): Use MAKE_CXX as the C++ compiler. --- src/default.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/default.c b/src/default.c index 1082b41d..ffb5f98c 100644 --- a/src/default.c +++ b/src/default.c @@ -527,18 +527,24 @@ static const char *default_variables[] = "AS", "as", #ifdef GCC_IS_NATIVE "CC", "gcc", -# ifdef __MSDOS__ - "CXX", "gpp", /* g++ is an invalid name on MSDOS */ -# else - "CXX", "gcc", -# endif /* __MSDOS__ */ "OBJC", "gcc", #else "CC", "cc", - "CXX", "g++", "OBJC", "cc", #endif - +#ifdef MAKE_CXX + "CXX", MAKE_CXX, +#else +# ifdef GCC_IS_NATIVE +# ifdef __MSDOS__ + "CXX", "gpp", /* g++ is an invalid name on MSDOS */ +# else + "CXX", "gcc", +# endif /* __MSDOS__ */ +# else + "CXX", "g++", +# endif +#endif /* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist, and to the empty string if $@ does exist. */ "CHECKOUT,v", "+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)", -- cgit v1.2.1