From patchwork Wed Nov 30 17:41:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 128542 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 086121007D1 for ; Thu, 1 Dec 2011 04:41:50 +1100 (EST) Received: (qmail 15327 invoked by alias); 30 Nov 2011 17:41:49 -0000 Received: (qmail 15317 invoked by uid 22791); 30 Nov 2011 17:41:48 -0000 X-SWARE-Spam-Status: No, hits=-7.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Nov 2011 17:41:33 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAUHfWQ2009516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Nov 2011 12:41:33 -0500 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pAUHfWmR026682 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 30 Nov 2011 12:41:32 -0500 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id pAUHfVwF018316; Wed, 30 Nov 2011 18:41:31 +0100 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id pAUHfV5I018314; Wed, 30 Nov 2011 18:41:31 +0100 Date: Wed, 30 Nov 2011 18:41:31 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Cc: ebotcazou@redhat.com Subject: [PATCH] Avoid messages about non-existent gnatls command (PR bootstrap/51201) Message-ID: <20111130174131.GJ27242@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 Hi! := assigned variable gets evaluated right away, including the case when host doesn't have any Ada compiler installed. In that case we remove ada from enabled languages, but still RTS_DIR is sometimes computed. With this patch we could call gnatls 4 times (or even 6 times) instead of just once, but as gnatls isn't very expensive command, I think it is worth doing that. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2011-11-30 Jakub Jelinek PR bootstrap/51201 * gcc-interface/Make-lang.in: Initialize RTS_DIR with = instead of :=. Jakub --- gcc/ada/gcc-interface/Make-lang.in.jj 2011-11-28 17:58:01.000000000 +0100 +++ gcc/ada/gcc-interface/Make-lang.in 2011-11-30 11:47:18.723657889 +0100 @@ -118,7 +118,7 @@ ifeq ($(build), $(host)) # put the host RTS dir first in the PATH to hide the default runtime # files that are among the sources - RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib ))) + RTS_DIR=$(strip $(subst \,/,$(shell gnatls -v | grep adalib ))) ADA_TOOLS_FLAGS_TO_PASS=\ CC="$(CC)" \ @@ -153,7 +153,7 @@ else else # This is a canadian cross. We should use a toolchain running on the # build platform and targeting the host platform. - RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib ))) + RTS_DIR=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib ))) ADA_TOOLS_FLAGS_TO_PASS=\ CC="$(CC)" \ $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \