From patchwork Fri Apr 22 22:16:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 92587 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 BA477B6F5C for ; Sat, 23 Apr 2011 08:16:36 +1000 (EST) Received: (qmail 6578 invoked by alias); 22 Apr 2011 22:16:33 -0000 Received: (qmail 6570 invoked by uid 22791); 22 Apr 2011 22:16:31 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL, BAYES_50, SARE_SUB_ENC_UTF8, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Apr 2011 22:16:05 +0000 Received: from eggs.gnu.org ([140.186.70.92]:46083) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QDOdw-0003ie-Fc for gcc-patches@gnu.org; Fri, 22 Apr 2011 18:16:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QDOdu-0006XC-Qo for gcc-patches@gnu.org; Fri, 22 Apr 2011 18:16:04 -0400 Received: from smtp191.iad.emailsrvr.com ([207.97.245.191]:59245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDOdu-0006Wy-NO for gcc-patches@gnu.org; Fri, 22 Apr 2011 18:16:02 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp39.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id B47F398207; Fri, 22 Apr 2011 18:16:01 -0400 (EDT) Received: from dynamic9.wm-web.iad.mlsrvr.com (dynamic9.wm-web.iad1a.rsapps.net [192.168.2.216]) by smtp39.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 9D25C981DD; Fri, 22 Apr 2011 18:16:01 -0400 (EDT) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic9.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id 897003200A4; Fri, 22 Apr 2011 18:16:01 -0400 (EDT) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Sat, 23 Apr 2011 00:16:01 +0200 (CEST) Date: Sat, 23 Apr 2011 00:16:01 +0200 (CEST) Subject: =?UTF-8?Q?Re:=20(build)=20Patch=20to=20fix=20cp/cfns.gperf=20building=20?= =?UTF-8?Q?issues?= From: "Nicola Pero" To: "Joseph S. Myers" Cc: "gcc-patches@gnu.org" MIME-Version: 1.0 X-Type: plain In-Reply-To: References: <1303485121.088925951@www2.webmail.us> Message-ID: <1303510561.560722554@www2.webmail.us> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 207.97.245.191 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 > We have a --enable-maintainer-mode configure option. Thanks - I had missed that option. It's an excellent suggestion - here is a new patch that uses it. :-) Ok to commit ? Thanks PS: Regarding how I detect --enable-maintainer-mode in this new patch, cp/Make-lang.in is used at it is, without going through configure, so I can't use @MAINT@ in it. I can't use MAINT either, because it's always empty. I added a FIXME as the intention in the code was probably different. I could actually fix MAINT to end up being exactly '#' when --disable-maintainer-mode is used, but why would we want that ? It would be a literal value, which you can't use to comment out bits of code in the same way as you can with @MAINT@. Of course, people may still try, and waste time trying to figure out why it doesn't work. It just doesn't make sense; you can't comment out make code by putting a variable with a value of '#' in front of something. If you ask me, I'd just remove the MAINT variable altogether - it's a bad idea and would/will confuse people. I added a new readable variable instead, ENABLE_MAINTAINER_RULES, which is 'true' or empty, so you can do ifeq ($(ENABLE_MAINTAINER_RULES), true) ... maintainer rules ... endif which is readable, expressive, simple and robust. Index: ChangeLog =================================================================== --- ChangeLog (revision 172860) +++ ChangeLog (working copy) @@ -1,3 +1,7 @@ +2011-04-22 Nicola Pero + + * Makefile.in (ENABLE_MAINTAINER_RULES): New. + 2011-04-22 Jakub Jelinek PR c/48716 Index: cp/Make-lang.in =================================================================== --- cp/Make-lang.in (revision 172860) +++ cp/Make-lang.in (working copy) @@ -104,10 +104,15 @@ cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $ +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS) -# Special build rules. +ifeq ($(ENABLE_MAINTAINER_RULES), true) +# Special build rule. This is a maintainer rule, that is only +# available when GCC is configured with --enable-maintainer-mode. In +# other cases, it is not available to avoid triggering rebuilds if a +# user has the source checked out with unusual timestamps. $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ - $(srcdir)/cp/cfns.gperf > $(srcdir)/cp/cfns.h + $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h +endif #^L # Build hooks: Index: cp/ChangeLog =================================================================== --- cp/ChangeLog (revision 172860) +++ cp/ChangeLog (working copy) @@ -1,3 +1,10 @@ +2011-04-23 Nicola Pero + + * Make-lang.in ($(srcdir)/cp/cfns.h): Enable the rule only in + maintainer mode. Use the --output-file option of gperf instead of + > to prevent creating an empty cp/cfns.h when gperf is not + available. + 2011-04-20 Jason Merrill * semantics.c (finish_compound_literal): Don't put an array Index: Makefile.in =================================================================== --- Makefile.in (revision 172860) +++ Makefile.in (working copy) @@ -165,8 +165,19 @@ C_STRICT_WARN = @c_strict_warn@ NOCOMMON_FLAG = @nocommon_flag@ # This is set by --disable-maintainer-mode (default) to "#" +# FIXME: 'MAINT' will always be set to an empty string, no matter if +# --disable-maintainer-mode is used or not. This is because the +# following will expand to "MAINT := " in maintainer mode, and to +# "MAINT := #" in non-maintainer mode, but because '#' starts a comment, +# they mean exactly the same thing for make. MAINT := @MAINT@ +# The following provides the variable ENABLE_MAINTAINER_RULES that can +# be used in language Make-lang.in makefile fragments to enable +# maintainer rules. So, ENABLE_MAINTAINER_RULES is 'true' in +# maintainer mode, and '' otherwise. +@MAINT@ ENABLE_MAINTAINER_RULES = true + # These are set by --enable-checking=valgrind. RUN_GEN = @valgrind_command@ VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@