From patchwork Fri Nov 12 18:18:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 71005 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 76E8AB712D for ; Sat, 13 Nov 2010 05:19:42 +1100 (EST) Received: (qmail 6980 invoked by alias); 12 Nov 2010 18:19:40 -0000 Received: (qmail 6970 invoked by uid 22791); 12 Nov 2010 18:19:38 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, TW_CX, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Nov 2010 18:18:58 +0000 Received: from kpbe13.cbf.corp.google.com (kpbe13.cbf.corp.google.com [172.25.105.77]) by smtp-out.google.com with ESMTP id oACIIuHO026224 for ; Fri, 12 Nov 2010 10:18:57 -0800 Received: from yxd5 (yxd5.prod.google.com [10.190.1.197]) by kpbe13.cbf.corp.google.com with ESMTP id oACIIcEN020024 for ; Fri, 12 Nov 2010 10:18:55 -0800 Received: by yxd5 with SMTP id 5so51663yxd.34 for ; Fri, 12 Nov 2010 10:18:55 -0800 (PST) Received: by 10.42.179.1 with SMTP id bo1mr2455169icb.268.1289585930354; Fri, 12 Nov 2010 10:18:50 -0800 (PST) Received: from coign.google.com (dhcp-172-22-126-178.mtv.corp.google.com [172.22.126.178]) by mx.google.com with ESMTPS id i16sm3894151ibl.6.2010.11.12.10.18.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 12 Nov 2010 10:18:49 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org Subject: PATCH RFA: Fix --enable-build-with-cxx Date: Fri, 12 Nov 2010 10:18:44 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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