autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: testsuite failure: multiple languages


From: Ralf Wildenhues
Subject: Re: testsuite failure: multiple languages
Date: Fri, 10 Apr 2009 08:41:48 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

* Ralf Wildenhues wrote on Mon, Mar 30, 2009 at 08:28:45PM CEST:
> * Eric Blake wrote on Mon, Mar 30, 2009 at 07:37:26PM CEST:
> > 'make -C tests maintainer-check-c++' fails the 'Multiple languages' test,
> > since you can't use C++ to compile a C-only program.  Generally, autoconf
> > tries to allow the use of a C++ compiler in place of a C compiler (that
> > is, most of autoconf tries to target the intersection of the two
> > languages, rather than sticking with strict C), hence the
> > 'maintainer-check-c++' target.  But we need a way to skip this particular
> > test when CC is not a C compiler, and I don't have a good idea for it.
> 
> Untested:
> In a separate configure.ac script compiled and run before the main part
> of the test, have something like this (without any CXX stuff in there)?

Tested now.  OK?

Thanks,
Ralf

    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.

diff --git a/tests/compile.at b/tests/compile.at
index 6289960..6ca4ef4 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
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]