From owner-freebsd-ports@FreeBSD.ORG Tue Jun 1 01:22:25 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 510CE16A4CE for ; Tue, 1 Jun 2004 01:22:25 -0700 (PDT) Received: from smtp.dkm.cz (smtp.dkm.cz [62.24.64.34]) by mx1.FreeBSD.org (Postfix) with SMTP id 7A40743D1D for ; Tue, 1 Jun 2004 01:22:24 -0700 (PDT) (envelope-from neuhauser@chello.cz) Received: (qmail 98070 invoked by uid 0); 1 Jun 2004 08:22:03 -0000 Received: from r3al16.mistral.cz (HELO isis.wad.cz) (213.220.229.16) by smtp.dkm.cz with SMTP; 1 Jun 2004 08:22:03 -0000 Received: by isis.wad.cz (Postfix, from userid 1001) id 960712FDA01; Tue, 1 Jun 2004 10:22:03 +0200 (CEST) Date: Tue, 1 Jun 2004 10:22:03 +0200 From: Roman Neuhauser To: Kirill Ponomarew , freebsd-ports Message-ID: <20040601082203.GA17296@isis.wad.cz> Mail-Followup-To: Kirill Ponomarew , freebsd-ports References: <20040531233106.GE85902@isis.wad.cz> <20040601074657.GF34332@voodoo.oberon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040601074657.GF34332@voodoo.oberon.net> User-Agent: Mutt/1.5.6i Subject: Re: respect CFLAGS: should I override optimizations? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2004 08:22:25 -0000 # krion@voodoo.oberon.net / 2004-06-01 09:46:57 +0200: > Hi, > > On Tue, Jun 01, 2004 at 01:31:06AM +0200, Roman Neuhauser wrote: > > I'm updating biology/migrate, the upstream Makefile.in includes > > > > CFLAGS = @CFLAGS@ ... > > > > and configure says: > > > > case "$GCC" in > > yes) CFLAGS="-O3 -Wall -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -D$CPUTYPE" ;; > > > > If I was to take Porter's Hang^Hdbook literally, I would change the > > set (=) to append (+=) and be done with it, but is that really what > > I'm expected to do? Or should I filter out the -O3 on the assumption > > that optimization levels are make.conf's business? > > If you need to switch on some optimizations, you can use > WITH_OPTIMIZED_CFLAGS knob and define CFLAGS+=$optimized_cflags > there. I was actually looking for advice on what to do with upstream configure / Makefile.in pair that sets CFLAGS without respect to my preference. There's lot of it, and there are two camps: "author knows it runs best with -O3 -fthis -fthat, so don't screw with it" and "I don't care if it runs for ages without it". I'm sitting on the fence on this, I'm just looking for really unambiguous information, and Kris' email has given me that. > Porters Handbook expresses clearly: > > "The port should respect the CFLAGS variable. What we mean by > this is that the port should not set the value of this variable > absolutely, overriding the existing value; instead, it should > append whatever values it needs to the existing value. This is > so that build options that affect all ports can be set > globally." Yes, that's *very clear*, and means that I should turn the CFLAGS = -O3 -Wall ... to CFLAGS += -O3 -Wall ... That will make it "-O -pipe -O3 -Wall ..." on my computer, but that defeats the perceived purpose of the whole CFLAGS whacking, and is *clearly* opposite to what Kris said and what you meant, but is otherwise exactly what the Porter's Handbook says just below the quote above: """ An example of a Makefile respecting the CFLAGS variable follows. Note the +=: CFLAGS += -Wall -Werror Here is an example which does not respect the CFLAGS variable: CFLAGS = -Wall -Werror """ As far as I'm concerned, neither respects my local setting, local CFLAGS would have to be *appended*, += doesn't help. -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html