From: Ralf Wildenhues Date: Fri, 10 Apr 2009 14:44:08 +0000 (+0200) Subject: Skip `Multiple languages' test if CC is a C++ compiler. X-Git-Tag: v2.64~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e65a39811a1f6fbfb04065fe2a58c2833b2fd789;p=thirdparty%2Fautoconf.git 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 --- diff --git a/ChangeLog b/ChangeLog index 5daf08b59..3272e5f6c 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 628996002..6ca4ef433 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