From reg@shale.csir.co.za  Mon Jan 24 23:24:06 2000
Return-Path: <reg@shale.csir.co.za>
Received: from shale.csir.co.za (shale.csir.co.za [146.64.46.5])
	by hub.freebsd.org (Postfix) with ESMTP id D1EFC1536E
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Jan 2000 23:23:55 -0800 (PST)
	(envelope-from reg@shale.csir.co.za)
Received: from granite.hip.berkeley.edu (granite.hip.berkeley.edu [136.152.155.25])
	by shale.csir.co.za (8.9.3/8.9.3) with ESMTP id JAA83199
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Jan 2000 09:23:43 +0200 (SAT)
	(envelope-from reg@shale.csir.co.za)
Received: (from reg@localhost)
	by granite.hip.berkeley.edu (8.9.3/8.9.3) id XAA57310;
	Mon, 24 Jan 2000 23:22:21 -0800 (PST)
	(envelope-from reg)
Message-Id: <200001250722.XAA57310@granite.hip.berkeley.edu>
Date: Mon, 24 Jan 2000 23:22:21 -0800 (PST)
From: reg@shale.csir.co.za
Reply-To: reg@shale.csir.co.za
To: FreeBSD-gnats-submit@freebsd.org
Subject: bsd.port.mk cannot override make.conf.
X-Send-Pr-Version: 3.2

>Number:         16343
>Category:       ports
>Synopsis:       bsd.port.mk cannot override make.conf.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 24 23:30:01 PST 2000
>Closed-Date:    Thu Jun 03 19:06:08 PDT 2004
>Last-Modified:  Thu Jun 03 19:06:08 PDT 2004
>Originator:     Jeremy Lea
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
Arb's Inc.
>Environment:

	Standard bsd.port.mk, and /usr/share/mk/*.  CFLAGS set in
	/etc/make.conf.

>Description:

	bsd.port.mk tries to pass CFLAGS to a port's distribution Makefile
	via MAKE_ENV, but any CFLAGS set in the system makefiles (including
	/etc/make.conf) override the the environment.

>How-To-Repeat:

	Try to do a 'CFLAGS+= -DJUNK' in port makefile with CFLAGS set in
	make.conf and see it not appear in the commandline in the port.

>Fix:

	Setting CFLAGS in MAKE_ARGS or passing '-e' in MAKE_FLAGS prevents
	the port's makefile from adding to CFLAGS; so this is not a
	solution.

	There are four possible solutions I can think of:

	1.  Ensure that sytem makefiles always use ?= instead of =, and
	change sys.mk to include /etc/make.conf then /etc/defaults/make.conf
	first rather than last.

	2.  Have a flag passed in MAKE_ENV and checked in sys.mk to prevent
	the inclusion of /etc/make.conf.

	3.  Have a copy of sys.mk which is non-FreeBSD specific in
	/usr/ports/Mk/ and add '-m ${PORTSDIR}/Mk' to MAKE_FLAGS in
	bsd.port.mk.

	4.  Change make(1) to have an additional flag like -e which would
	cause environment variables to overright anything set in the system
	makefiles.

	This is a bookmark PR so that this isn't forgotten.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: will 
State-Changed-When: Tue Mar 28 13:54:11 PST 2000 
State-Changed-Why:  
We need more feedback on this. I think it (the real problem) lies 
with ports that do not respect CFLAGS. I have verified (by building 
games/kbubbles with and without the line 

CFLAGS+=	-v 

and found that it does indeed respect CFLAGS in this manner). 

Therefore, should this PR be closed? 


Responsible-Changed-From-To: freebsd-ports->asami 
Responsible-Changed-By: will 
Responsible-Changed-When: Tue Mar 28 13:54:11 PST 2000 
Responsible-Changed-Why:  
asami manages bsd.port.mk. 
State-Changed-From-To: feedback->open 
State-Changed-By: reg 
State-Changed-When: Tue Mar 28 18:32:59 PST 2000 
State-Changed-Why:  
This still needs to be analyzed. 


Responsible-Changed-From-To: asami->reg 
Responsible-Changed-By: reg 
Responsible-Changed-When: Tue Mar 28 18:32:59 PST 2000 
Responsible-Changed-Why:  
I will supply a fix unless someone beats me too it. 
State-Changed-From-To: open->closed 
State-Changed-By: petef 
State-Changed-When: Mon Nov 19 14:31:45 PST 2001 
State-Changed-Why:  
This isn't an issue anymore; I always specify CFLAGS in /etc/make.conf (with 
CFLAGS=<whatever>), and I just tested a bunch of ports that have "CFLAGS+= 
<something>" and there is no problem -- it works as expected. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=16343 
State-Changed-From-To: closed->open 
State-Changed-By: reg 
State-Changed-When: Wed Feb 20 01:02:58 PST 2002 
State-Changed-Why:  
I wondered what happened to this bug. 

Please don't close bugs which are submitted and assigned to the same person.  
It normally means that they know what the problem is and waht to be reminded 
of it.  Just because you think it's not a problem doesn't mean it's not... 


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=16343 
State-Changed-From-To: open->feedback 
State-Changed-By: will 
State-Changed-When: Sat Apr 13 16:09:34 PDT 2002 
State-Changed-Why:  
Please don't ignore my (now 2+ years old) request for feedback and 
then re-open this PR saying you know what the "problem" is without 
giving any more details.  As I said *two* years ago, your PR does not 
really indicate any problem.  I still do CFLAGS+= overriding in some 
ports these days.  If you do not reply to this request for feedback in 
one week, I will close this PR for good with the log message  
"two year feedback timeout."  Thank you. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=16343 

From: Jeremy Lea <reg@freebsd.org>
To: freebsd-gnats-submit@freebsd.org
Cc: imp@freebsd.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Sat, 18 May 2002 19:22:10 +0200

 Since no one understand this, make another attempt at describing
 the problem.  Let's use this patch to ports/graphics/png/Makefile as an
 example.
 
 --- /usr/ports.ref/graphics/png/Makefile	Mon May  6 22:32:26 2002
 +++ graphics/png/Makefile	Mon May  6 22:32:26 2002
 @@ -23,6 +23,7 @@
  MAKEFILE=       ${WRKSRC}/scripts/makefile.freebsd
  INSTALLS_SHLIB=	yes
  SHLIB_VER=	5
 +CFLAGS+=	-DJUNK
  
  MAKE_ENV=	SHLIB_VER="${SHLIB_VER}"
  PLIST_SUB=	SHLIB_VER="${SHLIB_VER}"
 
 What happens is that CFLAGS (which is just an example!) is passed in
 MAKE_ENV to submake's.  Because of the way that make(1) works, a
 variables from the environment are overridden by explict assignments in
 the makefiles.  <sys.mk> includes /etc/make.conf, and most people have
 an explict CFLAGS=blah in make.conf.  The settings of CFLAGS, and
 any other variable passed by bsd.port.mk in MAKE_ENV, which is explicity
 set in /etc/make.conf is lost.
 
 revision 1.58 of sys.mk makes it possible to fix this problem by setting
 __MAKE_CONF=/dev/null in bsd.port.mk.  This needs to be merged to -STABLE.
 
 If you don't understand this, then just ignore this PR.

From: "M. Warner Losh" <imp@village.org>
To: re@freebsd.org, reg@freebsd.org
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Sat, 18 May 2002 14:08:07 -0600 (MDT)

 Greetings RE team.
 
 I'd like to merge the __MAKE_CONF change into -stable.  It changes
 sys.mk from
 
 .if exists("/etc/make.conf")
 .include "/etc/make.conf"
 .endif
 
 to
 
 __MAKE_CONF?=/etc/make.conf
 .if exists(${__MAKE_CONF})
 .include "${__MAKE_CONF}"
 .endif
 
 And should be insanely safe.
 
 Warner
 
 
 
 In message: <20020518192210.A62009@shale.csir.co.za>
             Jeremy Lea <reg@freebsd.org> writes:
 : Since no one understand this, make another attempt at describing
 : the problem.  Let's use this patch to ports/graphics/png/Makefile as an
 : example.
 : 
 : --- /usr/ports.ref/graphics/png/Makefile	Mon May  6 22:32:26 2002
 : +++ graphics/png/Makefile	Mon May  6 22:32:26 2002
 : @@ -23,6 +23,7 @@
 :  MAKEFILE=       ${WRKSRC}/scripts/makefile.freebsd
 :  INSTALLS_SHLIB=	yes
 :  SHLIB_VER=	5
 : +CFLAGS+=	-DJUNK
 :  
 :  MAKE_ENV=	SHLIB_VER="${SHLIB_VER}"
 :  PLIST_SUB=	SHLIB_VER="${SHLIB_VER}"
 : 
 : What happens is that CFLAGS (which is just an example!) is passed in
 : MAKE_ENV to submake's.  Because of the way that make(1) works, a
 : variables from the environment are overridden by explict assignments in
 : the makefiles.  <sys.mk> includes /etc/make.conf, and most people have
 : an explict CFLAGS=blah in make.conf.  The settings of CFLAGS, and
 : any other variable passed by bsd.port.mk in MAKE_ENV, which is explicity
 : set in /etc/make.conf is lost.
 : 
 : revision 1.58 of sys.mk makes it possible to fix this problem by setting
 : __MAKE_CONF=/dev/null in bsd.port.mk.  This needs to be merged to -STABLE.
 : 
 : If you don't understand this, then just ignore this PR.

From: "Bruce A. Mah" <bmah@freebsd.org>
To: "M. Warner Losh" <imp@village.org>
Cc: re@freebsd.org, reg@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf. 
Date: Sat, 18 May 2002 13:31:48 -0700

 If memory serves me right, "M. Warner Losh" wrote:
 > Greetings RE team.
 
 Greetings Warner!
 
 > I'd like to merge the __MAKE_CONF change into -stable.  It changes
 > sys.mk from
 > 
 > .if exists("/etc/make.conf")
 > .include "/etc/make.conf"
 > .endif
 > 
 > to
 > 
 > __MAKE_CONF?=/etc/make.conf
 > .if exists(${__MAKE_CONF})
 > .include "${__MAKE_CONF}"
 > .endif
 > 
 > And should be insanely safe.
 
 I agree.  Approved...please commit!
 
 Bruce.
 
 

From: Brian Somers <brian@Awfulhak.org>
To: "M. Warner Losh" <imp@village.org>
Cc: re@freebsd.org, reg@freebsd.org,
	freebsd-gnats-submit@freebsd.org, brian@Awfulhak.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf. 
Date: Sat, 18 May 2002 21:32:28 +0100

 Approved
 
 > Greetings RE team.
 > 
 > I'd like to merge the __MAKE_CONF change into -stable.  It changes
 > sys.mk from
 > 
 > .if exists("/etc/make.conf")
 > .include "/etc/make.conf"
 > .endif
 > 
 > to
 > 
 > __MAKE_CONF?=/etc/make.conf
 > .if exists(${__MAKE_CONF})
 > .include "${__MAKE_CONF}"
 > .endif
 > 
 > And should be insanely safe.
 > 
 > Warner
 > 
 > 
 > 
 > In message: <20020518192210.A62009@shale.csir.co.za>
 >             Jeremy Lea <reg@freebsd.org> writes:
 > : Since no one understand this, make another attempt at describing
 > : the problem.  Let's use this patch to ports/graphics/png/Makefile as an
 > : example.
 > : 
 > : --- /usr/ports.ref/graphics/png/Makefile	Mon May  6 22:32:26 2002
 > : +++ graphics/png/Makefile	Mon May  6 22:32:26 2002
 > : @@ -23,6 +23,7 @@
 > :  MAKEFILE=       ${WRKSRC}/scripts/makefile.freebsd
 > :  INSTALLS_SHLIB=	yes
 > :  SHLIB_VER=	5
 > : +CFLAGS+=	-DJUNK
 > :  
 > :  MAKE_ENV=	SHLIB_VER="${SHLIB_VER}"
 > :  PLIST_SUB=	SHLIB_VER="${SHLIB_VER}"
 > : 
 > : What happens is that CFLAGS (which is just an example!) is passed in
 > : MAKE_ENV to submake's.  Because of the way that make(1) works, a
 > : variables from the environment are overridden by explict assignments in
 > : the makefiles.  <sys.mk> includes /etc/make.conf, and most people have
 > : an explict CFLAGS=blah in make.conf.  The settings of CFLAGS, and
 > : any other variable passed by bsd.port.mk in MAKE_ENV, which is explicity
 > : set in /etc/make.conf is lost.
 > : 
 > : revision 1.58 of sys.mk makes it possible to fix this problem by setting
 > : __MAKE_CONF=/dev/null in bsd.port.mk.  This needs to be merged to -STABLE.
 > : 
 > : If you don't understand this, then just ignore this PR.
 
 -- 
 Brian <brian@Awfulhak.org>                    <brian@freebsd-services.com>
       <http://www.Awfulhak.org>                   <brian@[uk.]FreeBSD.org>
 Don't _EVER_ lose your sense of humour !          <brian@[uk.]OpenBSD.org>
 
 

From: Jun Kuriyama <kuriyama@waterblue.imgsrc.co.jp>
To: freebsd-gnats-submit@FreeBSD.org, reg@shale.csir.co.za
Cc: reg@FreeBSD.org, portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Mon, 7 Jul 2003 15:03:49 +0900 (JST)

 Should we go to next stage?
 
 > > : revision 1.58 of sys.mk makes it possible to fix this problem by setting
 > > : __MAKE_CONF=/dev/null in bsd.port.mk.  This needs to be merged to -STABLE.

From: Kris Kennaway <kris@obsecurity.org>
To: Jun Kuriyama <kuriyama@waterblue.imgsrc.co.jp>
Cc: freebsd-gnats-submit@FreeBSD.org, reg@shale.csir.co.za,
	reg@FreeBSD.org, portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Mon, 7 Jul 2003 00:35:46 -0700

 On Mon, Jul 07, 2003 at 03:03:49PM +0900, Jun Kuriyama wrote:
 > Should we go to next stage?
 > 
 > > > : revision 1.58 of sys.mk makes it possible to fix this problem by setting
 > > > : __MAKE_CONF=/dev/null in bsd.port.mk.  This needs to be merged to -STABLE.
 
 And what is the next stage?
 
 Kris

From: kuriyama@FreeBSD.org
To: freebsd-gnats-submit@FreeBSD.org, reg@FreeBSD.org
Cc: portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Mon, 21 Jul 2003 16:37:20 +0900 (JST)

 We need to add __MAKE_CONF=/dev/null to ${MAKE_ENV} to use
 sys.mk's modification.
 
 Jeremy, is this enough?
 
 
 Index: bsd.port.mk
 ===================================================================
 RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
 retrieving revision 1.456
 diff -u -r1.456 bsd.port.mk
 --- bsd.port.mk	11 Jul 2003 06:30:43 -0000	1.456
 +++ bsd.port.mk	21 Jul 2003 03:50:23 -0000
 @@ -1533,7 +1533,7 @@
  
  MAKE_FLAGS?=	-f
  MAKEFILE?=		Makefile
 -MAKE_ENV+=		PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" LIBDIR="${LIBDIR}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" MANPREFIX="${MANPREFIX}"
 +MAKE_ENV+=		PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" LIBDIR="${LIBDIR}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" MANPREFIX="${MANPREFIX}" __MAKE_CONF=/dev/null
  
  .if ${OSVERSION} < 500016
  PTHREAD_CFLAGS=	-D_THREAD_SAFE
 

From: Kris Kennaway <kris@obsecurity.org>
To: kuriyama@FreeBSD.org
Cc: freebsd-gnats-submit@FreeBSD.org, reg@FreeBSD.org,
	portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Mon, 21 Jul 2003 02:47:24 -0700

 On Mon, Jul 21, 2003 at 04:37:20PM +0900, kuriyama@FreeBSD.org wrote:
 > We need to add __MAKE_CONF=/dev/null to ${MAKE_ENV} to use
 > sys.mk's modification.
 > 
 > Jeremy, is this enough?
 
 I replied to your earlier message requesting further clarification of
 why this is required, but I didn't see a response.
 
 Kris
 
 > 
 > 
 > Index: bsd.port.mk
 > ===================================================================
 > RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
 > retrieving revision 1.456
 > diff -u -r1.456 bsd.port.mk
 > --- bsd.port.mk	11 Jul 2003 06:30:43 -0000	1.456
 > +++ bsd.port.mk	21 Jul 2003 03:50:23 -0000
 > @@ -1533,7 +1533,7 @@
 >  
 >  MAKE_FLAGS?=	-f
 >  MAKEFILE?=		Makefile
 > -MAKE_ENV+=		PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" LIBDIR="${LIBDIR}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" MANPREFIX="${MANPREFIX}"
 > +MAKE_ENV+=		PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" LIBDIR="${LIBDIR}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" MANPREFIX="${MANPREFIX}" __MAKE_CONF=/dev/null
 >  
 >  .if ${OSVERSION} < 500016
 >  PTHREAD_CFLAGS=	-D_THREAD_SAFE

From: Jun Kuriyama <kuriyama@imgsrc.co.jp>
To: Kris Kennaway <kris@obsecurity.org>
Cc: kuriyama@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org,
	reg@FreeBSD.org, portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Mon, 21 Jul 2003 19:43:24 +0900

 At Mon, 21 Jul 2003 02:47:24 -0700,
 Kris Kennaway wrote:
 > I replied to your earlier message requesting further clarification of
 > why this is required, but I didn't see a response.
 
 Sorry my previous mail failure.
 
 As Jeremy wrote in ths PR, ports Makefile cannot add $CFLAGS when
 users set $CFLAGS in /etc/make.conf.  What do you think about this?

From: Kris Kennaway <kris@obsecurity.org>
To: Jun Kuriyama <kuriyama@imgsrc.co.jp>
Cc: Kris Kennaway <kris@obsecurity.org>, kuriyama@FreeBSD.org,
	freebsd-gnats-submit@FreeBSD.org, reg@FreeBSD.org,
	portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Mon, 21 Jul 2003 06:27:08 -0700

 On Mon, Jul 21, 2003 at 07:43:24PM +0900, Jun Kuriyama wrote:
 > At Mon, 21 Jul 2003 02:47:24 -0700,
 > Kris Kennaway wrote:
 > > I replied to your earlier message requesting further clarification of
 > > why this is required, but I didn't see a response.
 > 
 > Sorry my previous mail failure.
 > 
 > As Jeremy wrote in ths PR, ports Makefile cannot add $CFLAGS when
 > users set $CFLAGS in /etc/make.conf.  What do you think about this?
 
 I don't understand the problem.  Adding CFLAGS+=-DFOO to port
 makefiles indeed seems to work as expected.
 
 Besides, it seems to me that setting __MAKE_CONF=/dev/null to prevent
 ports from reading /etc/make.conf would cause a number of problems,
 because some ports (those that use the share/mk makefiles) *rely* on
 including /etc/make.conf to read settings like NOPROFILE.
 
 Kris
 

From: Jeremy Lea <jlea@lantic.net>
To: Kris Kennaway <kris@obsecurity.org>
Cc: Jun Kuriyama <kuriyama@imgsrc.co.jp>, kuriyama@FreeBSD.org,
	freebsd-gnats-submit@FreeBSD.org, reg@FreeBSD.org,
	portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Mon, 21 Jul 2003 20:53:34 +0200

 Hi Guys,
 
 Sorry, but I'm very much out of FreeBSD stuff at the moment...  Lost two
 harddisks in a move, then didn't have internet for 3 months (lost my commit
 bit during that time...), then 5.x trashed what was left of my harddisks...
 And life has a way of filling up one's free time...
 
 Kris Kennaway wrote:
 
 > On Mon, Jul 21, 2003 at 07:43:24PM +0900, Jun Kuriyama wrote:
 > > At Mon, 21 Jul 2003 02:47:24 -0700, Kris Kennaway wrote:
 > > > I replied to your earlier message requesting further clarification of
 > > > why this is required, but I didn't see a response.
 > > As Jeremy wrote in ths PR, ports Makefile cannot add $CFLAGS when
 > > users set $CFLAGS in /etc/make.conf.  What do you think about this?
 >
 > I don't understand the problem.  Adding CFLAGS+=-DFOO to port
 > makefiles indeed seems to work as expected.
 >
 > Besides, it seems to me that setting __MAKE_CONF=/dev/null to prevent
 > ports from reading /etc/make.conf would cause a number of problems,
 > because some ports (those that use the share/mk makefiles) *rely* on
 > including /etc/make.conf to read settings like NOPROFILE.
 
 The problem is only in some ports.  If you look at the history of this PR
 you'll see an example that I've posted.  Kris, look through the PR - I'm no
 idiot - there's a real problem, although it can be (and is) worked around in
 a number of ways.  The problem is only with ports that use bmake  (i.e. the
 very ports using share/mk).  It is not a problem for ports which use
 configure scripts or gmake, or several other techniques...
 
 I think that your thinking is wrong on the NOPROFILE thing...  bsd.port.mk
 should always set NOPROFILE=yes, because the packaging lists do not include
 libfoo_p.a.  bsd.port.mk should set everything that can be set in make.conf
 and is revelant to ports (most of make.conf should be in a file called
 make.world.conf ;-), and not allow the port's makefiles to include
 make.conf...  i.e. bsd.port.mk should be in total control of the build
 environment of a port.  Although it should be controlled by make.conf, the
 actual build of the port should not depend on any users settings other than
 those past by bsd.port.mk.
 
 Regards,
   -Jeremy
 
 

From: Kris Kennaway <kris@obsecurity.org>
To: Jeremy Lea <jlea@lantic.net>
Cc: Kris Kennaway <kris@obsecurity.org>,
	Jun Kuriyama <kuriyama@imgsrc.co.jp>, kuriyama@FreeBSD.org,
	freebsd-gnats-submit@FreeBSD.org, reg@FreeBSD.org,
	portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Mon, 21 Jul 2003 14:26:29 -0700

 On Mon, Jul 21, 2003 at 08:53:34PM +0200, Jeremy Lea wrote:
 
 > The problem is only in some ports.  If you look at the history of this PR
 > you'll see an example that I've posted.  Kris, look through the PR - I'm no
 > idiot - there's a real problem, although it can be (and is) worked around in
 > a number of ways.  The problem is only with ports that use bmake  (i.e. the
 > very ports using share/mk).  It is not a problem for ports which use
 > configure scripts or gmake, or several other techniques...
 
 I have read the PR and attempted to reproduce it with ports that use
 bmake (the popd port), and I cannot see the problem.
 
 root@rot13:/usr/ports/mail/popd	cvs -Rq diff -u
 Index: Makefile
 ===================================================================
 RCS file: /mnt2/ncvs/ports/mail/popd/Makefile,v
 retrieving revision 1.15
 diff -u -u -r1.15 Makefile
 --- Makefile	24 Mar 2003 08:59:12 -0000	1.15
 +++ Makefile	21 Jul 2003 13:25:21 -0000
 @@ -16,6 +16,8 @@
  MAN5=	popd.conf.5
  MAN8=	popd.8
  
 +CFLAGS+=	-DFOO
 +
  INSTALLS_SHLIB=	yes
  MANCOMPRESSED=	maybe
  .if defined(NOPROFILE)
 root@rot13:/usr/ports/mail/popd	make -V CFLAGS
 -O -pipe -march=pentium3 -DFOO
 
 > I think that your thinking is wrong on the NOPROFILE thing...  bsd.port.mk
 > should always set NOPROFILE=yes, because the packaging lists do not include
 > libfoo_p.a.
 
 No, most port plists handle NOPROFILE correctly.  For example, the
 popd port again.
 
 > bsd.port.mk should set everything that can be set in make.conf
 > and is revelant to ports (most of make.conf should be in a file called
 > make.world.conf ;-), and not allow the port's makefiles to include
 > make.conf...  i.e. bsd.port.mk should be in total control of the build
 > environment of a port.  Although it should be controlled by make.conf, the
 > actual build of the port should not depend on any users settings other than
 > those past by bsd.port.mk.
 
 I disagree.  bsd.port.mk and individual ports have dozens of build
 knobs that need to be controllable by a configuration file.
 
 Kris

From: Jun Kuriyama <kuriyama@imgsrc.co.jp>
To: Kris Kennaway <kris@obsecurity.org>
Cc: kuriyama@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org,
	reg@FreeBSD.org, portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Tue, 22 Jul 2003 06:56:39 +0900

 At Mon, 21 Jul 2003 14:26:29 -0700,
 Kris Kennaway wrote:
 > I have read the PR and attempted to reproduce it with ports that use
 > bmake (the popd port), and I cannot see the problem.
 > 
 > root@rot13:/usr/ports/mail/popd	cvs -Rq diff -u
 > Index: Makefile
 > ===================================================================
 > RCS file: /mnt2/ncvs/ports/mail/popd/Makefile,v
 > retrieving revision 1.15
 > diff -u -u -r1.15 Makefile
 > --- Makefile	24 Mar 2003 08:59:12 -0000	1.15
 > +++ Makefile	21 Jul 2003 13:25:21 -0000
 > @@ -16,6 +16,8 @@
 >  MAN5=	popd.conf.5
 >  MAN8=	popd.8
 >  
 > +CFLAGS+=	-DFOO
 > +
 >  INSTALLS_SHLIB=	yes
 >  MANCOMPRESSED=	maybe
 >  .if defined(NOPROFILE)
 > root@rot13:/usr/ports/mail/popd	make -V CFLAGS
 > -O -pipe -march=pentium3 -DFOO
 
 Please try to build with this.  In my environment, -DFOO is not used
 in do-build stage.
 
 ...
 ===>  Building for popd-2.2.2a_1
 ===> lib           
 Warning: Object directory not changed from original /usr/ports/mail/popd/work/popd-2.2.2a/lib
 cc -pipe -g -O -mcpu=pentiumpro -Wall -DUSE_SSL   -c funcs.c
 ...

From: Kris Kennaway <kris@obsecurity.org>
To: Jun Kuriyama <kuriyama@imgsrc.co.jp>
Cc: Kris Kennaway <kris@obsecurity.org>, kuriyama@FreeBSD.org,
	freebsd-gnats-submit@FreeBSD.org, reg@FreeBSD.org,
	portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Mon, 21 Jul 2003 15:06:31 -0700

 On Tue, Jul 22, 2003 at 06:56:39AM +0900, Jun Kuriyama wrote:
 > At Mon, 21 Jul 2003 14:26:29 -0700,
 > Kris Kennaway wrote:
 > > I have read the PR and attempted to reproduce it with ports that use
 > > bmake (the popd port), and I cannot see the problem.
 > >=20
 > > root@rot13:/usr/ports/mail/popd	cvs -Rq diff -u
 > > Index: Makefile
 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 > > RCS file: /mnt2/ncvs/ports/mail/popd/Makefile,v
 > > retrieving revision 1.15
 > > diff -u -u -r1.15 Makefile
 > > --- Makefile	24 Mar 2003 08:59:12 -0000	1.15
 > > +++ Makefile	21 Jul 2003 13:25:21 -0000
 > > @@ -16,6 +16,8 @@
 > >  MAN5=3D	popd.conf.5
 > >  MAN8=3D	popd.8
 > > =20
 > > +CFLAGS+=3D	-DFOO
 > > +
 > >  INSTALLS_SHLIB=3D	yes
 > >  MANCOMPRESSED=3D	maybe
 > >  .if defined(NOPROFILE)
 > > root@rot13:/usr/ports/mail/popd	make -V CFLAGS
 > > -O -pipe -march=3Dpentium3 -DFOO
 >=20
 > Please try to build with this.  In my environment, -DFOO is not used
 > in do-build stage.
 
 I did, but omitted them from the email.
 
 Script started on Mon Jul 21 14:23:11 2003
 root@rot13:/usr/ports/mail/popd	cvs -Rq diff -u
 Index: Makefile
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /mnt2/ncvs/ports/mail/popd/Makefile,v
 retrieving revision 1.15
 diff -u -u -r1.15 Makefile
 --- Makefile	24 Mar 2003 08:59:12 -0000	1.15
 +++ Makefile	21 Jul 2003 13:25:21 -0000
 @@ -16,6 +16,8 @@
  MAN5=3D	popd.conf.5
  MAN8=3D	popd.8
 =20
 +CFLAGS+=3D	-DFOO
 +
  INSTALLS_SHLIB=3D	yes
  MANCOMPRESSED=3D	maybe
  .if defined(NOPROFILE)
 root@rot13:/usr/ports/mail/popd	make clean
 =3D=3D=3D>  Cleaning for popd-2.2.2a
 root@rot13:/usr/ports/mail/popd	make
 =3D=3D=3D>  Extracting for popd-2.2.2a
 >> Checksum OK for popd-2.2.2a.tar.gz.
 =3D=3D=3D>  Patching for popd-2.2.2a
 =3D=3D=3D>  Configuring for popd-2.2.2a
 =3D=3D=3D>  Building for popd-2.2.2a
 =3D=3D=3D> lib
 Warning: Object directory not changed from original /usr/ports/mail/popd/wo=
 rk/popd-2.2.2a/lib
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DUSE_SSL   -c =
 funcs.c
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DUSE_SSL   -c =
 lockfile.c
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DUSE_SSL   -c =
 mailbox.c
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DUSE_SSL   -c =
 mbox_maildir.c
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DUSE_SSL   -c =
 mbox_mailidx.c
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DUSE_SSL   -c =
 mbox_mbf.c
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DUSE_SSL   -c =
 mbox_bulletin.c
 building static poputil library
 ranlib libpoputil.a
 cc -fpic -DPIC -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DU=
 SE_SSL   -c funcs.c -o funcs.So
 cc -fpic -DPIC -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DU=
 SE_SSL   -c lockfile.c -o lockfile.So
 cc -fpic -DPIC -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DU=
 SE_SSL   -c mailbox.c -o mailbox.So
 cc -fpic -DPIC -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DU=
 SE_SSL   -c mbox_maildir.c -o mbox_maildir.So
 cc -fpic -DPIC -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DU=
 SE_SSL   -c mbox_mailidx.c -o mbox_mailidx.So
 cc -fpic -DPIC -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DU=
 SE_SSL   -c mbox_mbf.c -o mbox_mbf.So
 cc -fpic -DPIC -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -DU=
 SE_SSL   -c mbox_bulletin.c -o mbox_bulletin.So
 building shared library libpoputil.so.1
 =3D=3D=3D> src
 Warning: Object directory not changed from original /usr/ports/mail/popd/wo=
 rk/popd-2.2.2a/src
 yacc -t -d -o parser.y.c parser.y
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -I../lib -L../l=
 ib  -DUSE_SSL -DUSE_IPV6 -DUSE_PAM     -c parser.y.c
 lex -oparser.l.c parser.l
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -I../lib -L../l=
 ib  -DUSE_SSL -DUSE_IPV6 -DUSE_PAM     -c parser.l.c
 parser.l.c:1786: warning: `yyunput' defined but not used
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -I../lib -L../l=
 ib  -DUSE_SSL -DUSE_IPV6 -DUSE_PAM     -c popd.c
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -I../lib -L../l=
 ib  -DUSE_SSL -DUSE_IPV6 -DUSE_PAM     -c authenticate.c
 authenticate.c: In function `radius_pass':
 authenticate.c:234: warning: deprecated use of label at end of compound sta=
 tement
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -I../lib -L../l=
 ib  -DUSE_SSL -DUSE_IPV6 -DUSE_PAM     -c transaction.c
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -I../lib -L../l=
 ib  -DUSE_SSL -DUSE_IPV6 -DUSE_PAM     -c signals.c
 signals.c: In function `dosigchld':
 signals.c:106: warning: unused variable `facility'
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -I../lib -L../l=
 ib  -DUSE_SSL -DUSE_IPV6 -DUSE_PAM     -c proxy.c
 cc -O -pipe -march=3Dpentium3 -DFOO -march=3Dpentium3 -Wall -I../lib -L../l=
 ib  -DUSE_SSL -DUSE_IPV6 -DUSE_PAM      -o popd parser.y.o parser.l.o popd.=
 o authenticate.o transaction.o signals.o proxy.o -lcrypt -lmd -lradius -lpo=
 putil -lssl -lcrypto -lpam
 /usr/lib/libradius.so: warning: srandomdev() used
 /usr/lib/libradius.so: warning: random() used
 gzip -cn popd.conf.5 > popd.conf.5.gz
 gzip -cn popd.8 > popd.8.gz
 root@rot13:/usr/ports/mail/popd	make -V CFLAGS
 -O -pipe -march=3Dpentium3 -DFOO
 root@rot13:/usr/ports/mail/popd	^D=08=08exit
 
 Script done on Mon Jul 21 14:23:32 2003
 
 Kris

From: Jun Kuriyama <kuriyama@imgsrc.co.jp>
To: Kris Kennaway <kris@obsecurity.org>
Cc: kuriyama@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org,
	reg@FreeBSD.org, portmgr@FreeBSD.org
Subject: Re: ports/16343: bsd.port.mk cannot override make.conf.
Date: Tue, 22 Jul 2003 07:14:58 +0900

 At Mon, 21 Jul 2003 15:06:31 -0700,
 Kris Kennaway wrote:
 > > Please try to build with this.  In my environment, -DFOO is not used
 > > in do-build stage.
 > 
 > I did, but omitted them from the email.
 
 Oops, I forgot to mention that my environment have CFLAGS="-pipe -g
 -O" in /etc/make.conf (and this is what for this PR).
 
 Does your make.conf have CFLAGS setting?
Responsible-Changed-From-To: reg->portmgr 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Nov 3 02:18:41 PST 2003 
Responsible-Changed-Why:  
With some trepidation, reassign this to portmgr@ as it seems 
to be a systemic problem.  The previous assignee seems unlikely 
at this late date to be interested in working on it.  This is 
a _very_ stale PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=16343 
State-Changed-From-To: feedback->closed 
State-Changed-By: will 
State-Changed-When: Thu Jun 3 19:04:20 PDT 2004 
State-Changed-Why:  
Close this PR since the originator never showed an actual case where this 
was a problem (and neither could kuriyama@).  I originally answered in 
this way more than 4 years ago and what I see remains true to this day. 
Kris seems to concur.  There's no reason for this PR to remain open. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=16343 
>Unformatted:
