This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH RFA: Fix --enable-build-with-cxx
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 12 Nov 2010 10:18:44 -0800
- Subject: PATCH RFA: Fix --enable-build-with-cxx
The only current problem with the default languages with
--enable-build-with-cxx is in libcpp. Back in 2009-07-17
libcpp/configure.ac picked up a test which switches AC_LANG based on
--enable-build-with-cxx. That seems superficially desirable but
autoconf does not actually support conditionally changing AC_LANG. With
a small bit of care, changing AC_LANG is unnecessary when switching
between C and C++. Note in particular that gcc/configure.ac does not do
it.
This patch removes the switch of AC_LANG in libcpp/configure.ac, and
adds AC_USE_SYSTEM_EXTENSIONS which eliminates some relevant differences
between the C and C++ header files when using glibc. This fixes
--enable-build-with-cxx.
Bootstrapped on x86_64-unknown-linux-gnu with and without
--enable-build-with-cxx. OK for mainline?
Ian
2010-11-12 Ian Lance Taylor <iant@google.com>
* configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
AC_LANG based on ENABLE_BUILD_WITH_CXX.
Index: configure.ac
===================================================================
--- configure.ac (revision 166441)
+++ configure.ac (working copy)
@@ -14,6 +14,7 @@ AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
+AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
# See if we are building gcc with C++.
@@ -58,18 +59,8 @@ fi
AC_HEADER_TIME
ACX_HEADER_STRING
-# AC_CHECK_HEADERS is repeated to work around apparent autoconf 2.59 bug. If
-# AC_CHECK_HEADERS comes after the if clause, the last AC_LANG call gets used,
-# no matter which branch is taken.
-if test "$ENABLE_BUILD_WITH_CXX" = "no"; then
- AC_LANG(C)
- AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
+AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
stdlib.h strings.h string.h sys/file.h unistd.h)
-else
- AC_LANG(C++)
- AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
- stdlib.h strings.h string.h sys/stat.h sys/file.h unistd.h)
-fi
# Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN