From owner-freebsd-current@FreeBSD.ORG Sun Jul 10 19:07:54 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 0D00E16A41C for ; Sun, 10 Jul 2005 19:07:54 +0000 (GMT) (envelope-from zazubrik@mail.ru) Received: from mx3.mail.ru (mx3.mail.ru [194.67.23.149]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9737643D46 for ; Sun, 10 Jul 2005 19:07:53 +0000 (GMT) (envelope-from zazubrik@mail.ru) Received: from [83.237.204.121] (port=48646 helo=[192.168.0.8]) by mx3.mail.ru with esmtp id 1Drh9c-0000IN-00 for freebsd-current@freebsd.org; Sun, 10 Jul 2005 23:07:52 +0400 Mime-Version: 1.0 (Apple Message framework v730) In-Reply-To: <20050710165622.GW39292@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> <20050708215620.GN39292@obiwan.tataz.chchile.org> <7FCC20EB-A240-4EDC-B09A-31BEE5129676@mail.ru> <20050710165622.GW39292@obiwan.tataz.chchile.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <393F7F07-FE7C-41A1-9A7B-0F6552124EC2@mail.ru> Content-Transfer-Encoding: 7bit From: Artem Ignatiev Date: Sun, 10 Jul 2005 23:07:47 +0400 To: freebsd-current@freebsd.org X-Mailer: Apple Mail (2.730) 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: Sun, 10 Jul 2005 19:07:54 -0000 On 10.07.2005, at 20:56, Jeremie Le Hen wrote: > Hi Artem, >>> 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. >>> >> >> Why not : >> .if defined(PORT_CFLAGS) && !defined(CFLAGS) >> CFLAGS=${PORT_CFLAGS} >> .endif > For me, the goal of PORT_CFLAGS is to bring the possibility to specify > _alternate_ CFLAGs when building port. This means that PORT_CFLAGS > needs to be usable even if CFLAGS is specified. Typically, > make.conf(5) > would contain both variables. >> or even: >> .if defined(PORT_CFLAGS) >> CFLAGS=${PORT_CFLAGS} ${CFLAGS} >> .endif > > The problem is mostly the same here. If make.conf(5) contains : > %%% > CFLAGS="-O2 -pipe -fomit-frame-pointer" > PORT_CFLAGS="-O -pipe" > %%% > > what you have written above would lead to have CFLAGS containing : > -O -pipe -O2 -pipe -fomit-frame-pointer > > However, I'm maybe misunderstanding what you said. In this case, > correct me please. Yeah, I missed this. I was trying to reach this: If nothing regarding CFLAGS is given in the command line, port is built with PORTS_CFLAGS. If CFLAGS are set in command line, they are appended to PORTS_CFLAGS, thus effectively overriding PORTS_CFLAGS. I had missed that CFLAGS may be set in make.conf Then, one of the solutions may be to change sys.mk so it saves CFLAGS given from environment/command line before parsing make.conf, and if we are building some port, restore or reevaluate CFLAGS using PORT_CFLAGS and user-set CFLAGS.