From cf6c3463f66a1cc5f28608cb23f63661faeb486f Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Mon, 17 Sep 2018 13:24:13 +0100 Subject: [PATCH] Proper check for C++ compiler (from Fabio) --- configure.ac | 1 + tests/Makefile.am | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a7800f762..3f5596cf0 100644 --- a/configure.ac +++ b/configure.ac @@ -71,6 +71,7 @@ if ! ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then fi AC_PROG_CXX +AM_CONDITIONAL(HAVE_GXX, [test "x$GXX" = xyes]) AC_PROG_AWK AC_PROG_CC AC_PROG_CPP diff --git a/tests/Makefile.am b/tests/Makefile.am index 1f3e758b8..25efa72ab 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -80,9 +80,14 @@ check: check-headers .PHONY: check-headers check-headers: $(auto_c_files:.c=.o) $(auto_c_files:.c=.opp) -# this is to attest basic sanity for using libqb from C++ code when possible +# this is to check basic sanity of using libqb from C++ code, if possible %.opp: %.c - @which $(CXX) >/dev/null && $(CXX) $(AM_CPPFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $< +if HAVE_GXX + $(AM_V_GEN)$(CXX) $(AM_CPPFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $< +else + @echo "C++ compatibility tests not run" +endif + CLEANFILES += ${auto_c_files:.c=.opp} distclean-local: