···11+Do not search for a C++ compiler and set MAKE_CXX.
22+33+Removes unnecessary reference to C++ compiler if CXX is set to an
44+absolute path. If CXX is not an absolute path, we avoid defaulting CXX
55+to a compiler name that was used to build the package.
66+77+Context: GNU Make defines default values for CC, CXX and other
88+environment variables. For CXX, it usually defaults to g++, however,
99+FreeBSD and OpenBSD no longer ship GCC as a system compiler (and use
1010+Clang instead). For C compiler, POSIX standardizes the name to be "cc",
1111+but there is no such standard for C++ compiler name. As a fix, GNU Make
1212+uses CXX set for build as a default (via MAKE_CXX preprocessor macro in
1313+the source code).
1414+1515+We revert the change that added this behavior and set the default to c++
1616+or g++ that does not depend on the build platform.
1717+1818+In stdenv, CXX environment variable is always defined and overrides the
1919+default value.
2020+2121+References:
2222+• https://savannah.gnu.org/bugs/?63668
2323+• https://git.savannah.gnu.org/cgit/make.git/commit/?id=ffa28f3914ff402b3915f75e4fed86ac6fb1449d
2424+2525+--- a/configure.ac
2626++++ b/configure.ac
2727+@@ -37,6 +37,4 @@ AM_INIT_AUTOMAKE([1.16.1 foreign -Werror -Wall])
2828+ # Checks for programs.
2929+ AC_USE_SYSTEM_EXTENSIONS
3030+ AC_PROG_CC
3131+-AC_PROG_CXX
3232+-AC_DEFINE_UNQUOTED(MAKE_CXX, ["$CXX"], [Default C++ compiler.])
3333+3434+--- a/src/default.c
3535++++ b/src/default.c
3636+@@ -528,22 +528,15 @@ static const char *default_variables[] =
3737+ #ifdef GCC_IS_NATIVE
3838+ "CC", "gcc",
3939+ "OBJC", "gcc",
4040++# ifdef __MSDOS__
4141++ "CXX", "gpp", /* g++ is an invalid name on MSDOS */
4242++# else
4343++ "CXX", "g++",
4444++# endif /* __MSDOS__ */
4545+ #else
4646+ "CC", "cc",
4747+ "OBJC", "cc",
4848++ "CXX", "c++",
4949+ #endif
5050+-#ifdef MAKE_CXX
5151+- "CXX", MAKE_CXX,
5252+-#else
5353+-# ifdef GCC_IS_NATIVE
5454+-# ifdef __MSDOS__
5555+- "CXX", "gpp", /* g++ is an invalid name on MSDOS */
5656+-# else
5757+- "CXX", "gcc",
5858+-# endif /* __MSDOS__ */
5959+-# else
6060+- "CXX", "g++",
6161+-# endif
6262+-#endif
6363+ /* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
6464+ and to the empty string if $@ does exist. */