From owner-freebsd-current@FreeBSD.ORG Fri Jul 8 21:56:19 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ECC0C16A41C for ; Fri, 8 Jul 2005 21:56:19 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AE1C43D45 for ; Fri, 8 Jul 2005 21:56:19 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from tatooine.tataz.chchile.org (vol75-8-82-233-239-98.fbx.proxad.net [82.233.239.98]) by postfix4-2.free.fr (Postfix) with ESMTP id 69B52321FD8; Fri, 8 Jul 2005 23:56:18 +0200 (CEST) Received: by tatooine.tataz.chchile.org (Postfix, from userid 1000) id 4B4D9405B; Fri, 8 Jul 2005 23:56:21 +0200 (CEST) Date: Fri, 8 Jul 2005 23:56:21 +0200 From: Jeremie Le Hen To: Thierry Herbelot Message-ID: <20050708215620.GN39292@obiwan.tataz.chchile.org> References: <20041102222000.GA65845@xor.obsecurity.org> <20050706073205.GA942@galgenberg.net> <20050706085737.GT73907@obiwan.tataz.chchile.org> <200507061116.17267.thierry@herbelot.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200507061116.17267.thierry@herbelot.com> User-Agent: Mutt/1.5.9i Cc: freebsd-current@freebsd.org, Jeremie Le Hen Subject: Re: HEADS UP: Ports are not ready for CFLAGS=-O2 in 6.0 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2005 21:56:20 -0000 Hi Thierry, > and it does not work if he ports tree is "physically" elsewhere (mine is > shared over NFS from /files2/ports -> .CURDIR does not begin > with /usr/ports). > > Perhaps a better way would be to use a variable set in bsd.ports.mk > (BUILDING_PORT="YES") I thought a bit more about this. This seems to be a better idea than having a PORT_CFLAGS variable, because when a user wants to compile a port with uncommon CFLAGS, he will do the following (for instance) : %%% cd /usr/ports/misc/vera make CFLAGS='-O3' install clean %%% If we add something like this in ports/Mk/bsd.port.mk : %%% .if defined(PORT_CFLAGS) CFLAGS=${PORT_CFLAGS} .end %%% This will obviously break POLA because setting CFLAGS won't work as expected. Having a BUILDING_PORT or some such variable might appear as a good idea but there is one technical problem that I don't know how to circumvent. make(1) manual page indeed states that share/mk/sys.mk will be read before everything else, and this is this file which includes /etc/make.conf, if the latter exists. And then only will be read ports/Mk/bsd.port.mk, when the port's Makefile will include it. Therefore, when make.conf(5) will be read, BUILDING_PORT will not be set yet. This can be checked easily : %%% obiwan:tmp$ cat Makefile VAR1="hello I'm VAR1" .if defined(VAR2) VAR1=${VAR2} .endif VAR2="hello I'm VAR2" all: @echo ${VAR1} obiwan:tmp$ make hello I'm VAR1 %%% Having a /etc/ports.conf file as Ulrich Spoerlein proposed could be a good solution, but some port commiters need to be convinced of its usefulness first in order to have their support. Best regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org >