From e65a39811a1f6fbfb04065fe2a58c2833b2fd789 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Fri, 10 Apr 2009 16:44:08 +0200 Subject: [PATCH] Skip `Multiple languages' test if CC is a C++ compiler. * tests/compile.at (Multiple languages): Before starting the test proper, build and run a configure script that tests the C compiler only, and skips the test if this is found to be a C++ compiler. Report by Eric Blake. Signed-off-by: Ralf Wildenhues --- ChangeLog | 7 +++++++ tests/compile.at | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5daf08b5..3272e5f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-04-10 Ralf Wildenhues + Skip `Multiple languages' test if CC is a C++ compiler. + * tests/compile.at (Multiple languages): Before starting the + test proper, build and run a configure script that tests the + C compiler only, and skips the test if this is found to be a + C++ compiler. + Report by Eric Blake. + Note that AC_DEFUN is needed for aclocal. * doc/autoconf.texi (Coding Style): Public third-party macros should be AC_DEFUN'ed. diff --git a/tests/compile.at b/tests/compile.at index 62899600..6ca4ef43 100644 --- a/tests/compile.at +++ b/tests/compile.at @@ -203,6 +203,22 @@ AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this, AT_SETUP([Multiple languages]) +# This test should be skipped if the C compiler is a C++ compiler. +AT_DATA([configure.ac], +[[AC_INIT + +AC_PROG_CC +AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #ifdef __cplusplus + choke me + #endif + ]])], [], AS_EXIT([77])) +]]) + +AT_CHECK_AUTOCONF +AT_CHECK_CONFIGURE + AT_DATA([configure.ac], [[AC_INIT