From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25506 invoked by alias); 27 Apr 2015 13:40:27 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34972 Received: (qmail 27860 invoked from network); 27 Apr 2015 13:40:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=l7j8twm2CiR5A8OEH29AjBotWI8=; b=YzMILU YIjrP/K+OuFnxpUPEIsNP/ZscAqSA79692lQPyPiZuwKuAvOFyk8yg3sTkyVOjdN E8zhnSy7l7svs/NMrzyznuQanfdwngxfGvmCrvB1GqyxVqLqVN3Lrc24Z6gtYS1e ZjxTuzKPYC8IOJ4N3OvnA96oZk5Gdnwh/Q5Dw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=l7j8twm2CiR5A8OEH29AjBotWI8=; b=kQUNT nip2ECmUMJBCBeeoX4JgIU/TzLfHJ1yUFiWKaE93WkxZ6ygnrTDGjoIpS3GpTZA8 Bgj+e23PJdbkrUr6QKRY8ulHZDhArecIlVum5yA48lXxfntmT/hxvZnrgXFG6IRI XH13BKfkw8wxki5FXnrGySE4fwHcWA7WE6As4s= X-Sasl-enc: xD/WESfGO9vhvbPLsZUZctD9dNYl2h9lyBWi+Lz1ow/F 1430141435 Date: Mon, 27 Apr 2015 13:30:33 +0000 From: Daniel Shahaf To: Peter Stephenson Cc: zsh-workers@zsh.org Subject: Re: [PATCH] Use CC to determine if gcc is used Message-ID: <20150427133033.GC1863@tarsus.local2> References: <1430070511-9895-1-git-send-email-heirecka@exherbo.org> <20150427094742.27589aca@pwslap01u.europe.root.pri> <20150427100756.12c82959@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150427100756.12c82959@pwslap01u.europe.root.pri> User-Agent: Mutt/1.5.21 (2010-09-15) Peter Stephenson wrote on Mon, Apr 27, 2015 at 10:07:56 +0100: > On Mon, 27 Apr 2015 09:47:42 +0100 > Peter Stephenson wrote: > > That's probably OK, but rather than test CC when using CPP, it might be > > simpler just to test if $(CPP) contains "gnu" as an alternative to > > "gcc"? What happens if $(CPP) is set to simply the string 'cpp'? > > ... Or is this safer? > > diff --git a/Src/zsh.mdd b/Src/zsh.mdd > index 71dd613..820fcab 100644 > --- a/Src/zsh.mdd > +++ b/Src/zsh.mdd > @@ -28,8 +28,8 @@ hdrdeps="zshcurses.h zshterm.h" > # on the option to remove them being the same. > signames.c: signames1.awk signames2.awk ../config.h @SIGNAL_H@ > $(AWK) -f $(sdir)/signames1.awk @SIGNAL_H@ >sigtmp.c > - case "$(CPP)" in \ > - gcc*) \ > + case "`$(CPP) --version 2>&1`" in \ > + *GCC*) \ This would false negative on my system: % cpp --version cpp (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388] Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. On another system I see: % cpp --version cpp (GCC) 4.2.1 20070831 patched [FreeBSD] Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. So I guess the parenthetical is distro-configurable. The second line is constant, though. Or we could bypass the "Is this a GNU CPP" problem entirely: [[[ diff --git Src/zsh.mdd Src/zsh.mdd index 71dd613..8b6842d 100644 --- Src/zsh.mdd +++ Src/zsh.mdd @@ -28,12 +28,7 @@ hdrdeps="zshcurses.h zshterm.h" # on the option to remove them being the same. signames.c: signames1.awk signames2.awk ../config.h @SIGNAL_H@ $(AWK) -f $(sdir)/signames1.awk @SIGNAL_H@ >sigtmp.c - case "$(CPP)" in \ - gcc*) \ - $(CPP) -P sigtmp.c >sigtmp.out;; \ - *) \ - $(CPP) sigtmp.c >sigtmp.out;; \ - esac + $(CPP) sigtmp.c | grep -v '^ *# *line [0-9]\+' >sigtmp.out $(AWK) -f $(sdir)/signames2.awk sigtmp.out > $@ rm -f sigtmp.c sigtmp.out ]]] (Haven't tested this, sorry.) Daniel > $(CPP) -P sigtmp.c >sigtmp.out;; \ > *) \ > $(CPP) sigtmp.c >sigtmp.out;; \ > > pws