From patchwork Wed Nov 3 15:41:20 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: 70023 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 7D5311007D2 for ; Thu, 4 Nov 2010 02:41:41 +1100 (EST) Received: (qmail 25307 invoked by alias); 3 Nov 2010 15:41:33 -0000 Received: (qmail 25255 invoked by uid 22791); 3 Nov 2010 15:41:32 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, 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) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Nov 2010 15:41:27 +0000 Received: from hpaq5.eem.corp.google.com (hpaq5.eem.corp.google.com [172.25.149.5]) by smtp-out.google.com with ESMTP id oA3FfP2L014192 for ; Wed, 3 Nov 2010 08:41:25 -0700 Received: from pvg4 (pvg4.prod.google.com [10.241.210.132]) by hpaq5.eem.corp.google.com with ESMTP id oA3FeQo6012042 for ; Wed, 3 Nov 2010 08:41:24 -0700 Received: by pvg4 with SMTP id 4so294430pvg.12 for ; Wed, 03 Nov 2010 08:41:23 -0700 (PDT) Received: by 10.142.178.7 with SMTP id a7mr419974wff.438.1288798883409; Wed, 03 Nov 2010 08:41:23 -0700 (PDT) Received: from coign.google.com (dhcp-172-22-125-232.mtv.corp.google.com [172.22.125.232]) by mx.google.com with ESMTPS id x18sm13811884wfa.11.2010.11.03.08.41.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Nov 2010 08:41:22 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org Subject: PATCH RFA: Build system: Check lang_requires_boot_languages User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Date: Wed, 03 Nov 2010 08:41:20 -0700 Message-ID: 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 This patch adds a new feature to gcc's config-lang.in files: if the config-lang.in file for language L1 sets lang_requires_boot_languages to L2, L3, ..., then if L1 is enabled, then L2, L3, ... are automatically enabled during stage 1. This is necessary to bootstrap a frontend which is not written in C. This feature will be used by the Go frontend when it is committed. Bootstrapped on x86_64-unknown-linux-gnu. OK for mainline? Ian 2010-11-03 Ian Lance Taylor * configure.ac: Check for lang_requires_boot_languages in config-lang.in files. * configure: Rebuild. Index: configure.ac =================================================================== --- configure.ac (revision 166249) +++ configure.ac (working copy) @@ -1735,9 +1735,11 @@ if test -d ${srcdir}/gcc; then # an apparent bug in bash 1.12 on linux. ${srcdir}/gcc/[[*]]/config-lang.in) ;; *) - # From the config-lang.in, get $language, $lang_requires + # From the config-lang.in, get $language, $lang_requires, and + # $lang_requires_boot_languages. language= lang_requires= + lang_requires_boot_languages= . ${lang_frag} for other in ${lang_requires} ; do case ,${enable_languages}, in @@ -1749,6 +1751,22 @@ if test -d ${srcdir}/gcc; then ;; esac done + for other in ${lang_requires_boot_languages} ; do + if test "$other" != "c"; then + case ,${enable_stage1_languages}, in + *,$other,*) ;; + *,all,*) ;; + *) + case ,${enable_languages}, in + *,$language,*) + echo " '$other' language required by '$language' in stage 1; enabling" 1>&2 + enable_stage1_languages="$enable_stage1_languages,${other}" + ;; + esac + ;; + esac + fi + done ;; esac done