[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test fails when no C++ compiler is available
From: |
Ralf Wildenhues |
Subject: |
Re: test fails when no C++ compiler is available |
Date: |
Wed, 13 May 2009 21:49:19 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
[ dropping bug-automake, adding autoconf-patches ]
Hi Jim, Eric,
* Jim Meyering wrote on Tue, May 12, 2009 at 11:30:40AM CEST:
> > I've just built automake-from-git on a newly-installed system
> > that lacked a C++ compiler. It failed like this:
> > 220. compile.at:204: 220. Multiple languages (compile.at:204): FAILED
> > (compile.at:249)
> >
> > tests/testsuite.dir/220/config.log:
> >
> > configure:2973: result: no
> > configure:3003: checking a simple C program that is not valid C++
> > configure:3018: gcc -c -g -O2 conftest.c >&5
> > configure:3018: $? = 0
> > configure:3019: result: ok
> > configure:3040: checking a simple C++ program that is not valid C
> > configure:3054: g++ -c conftest.cpp >&5
> > ./configure: line 1401: g++: command not found
> > configure:3054: $? = 127
> > configure:3058: result: failed
> > configure:3060: error: could not compile test program
Thanks for the bug report. I'm proposing the following patch to fix
this test failure, that doesn't care about the AC_PROG_CXX glitch.
OK?
Thanks,
Ralf
testsuite: skip `Multiple languages' test without C++ compiler.
* tests/compile.at (Multiple languages): Skip test on systems
without a C++ compiler.
Report by Jim Meyering.
diff --git a/tests/compile.at b/tests/compile.at
index 6ca4ef4..20398fb 100644
--- a/tests/compile.at
+++ b/tests/compile.at
@@ -2,8 +2,8 @@
AT_BANNER([Low level compiling/preprocessing macros.])
-# Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007, 2008 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007, 2008, 2009 Free
+# Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -219,6 +219,24 @@ AC_COMPILE_IFELSE([
AT_CHECK_AUTOCONF
AT_CHECK_CONFIGURE
+# This test should be skipped on systems without a C++ compiler.
+AT_DATA([configure.ac],
+[[AC_INIT
+
+AC_PROG_CXX
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ #ifndef __cplusplus
+ choke me
+ #endif
+ ]])], [], AS_EXIT([77]))
+AC_LANG_POP([C++])
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+
AT_DATA([configure.ac],
[[AC_INIT
- Re: test fails when no C++ compiler is available,
Ralf Wildenhues <=