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 <Ralf.Wildenhues@gmx.de>
This commit is contained in:
Ralf Wildenhues 2009-04-10 16:44:08 +02:00
parent d882037ec0
commit e65a39811a
2 changed files with 23 additions and 0 deletions

View File

@ -1,5 +1,12 @@
2009-04-10 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
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.

View File

@ -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