From owner-freebsd-arch Thu Mar 8 19:52:33 2001 Delivered-To: freebsd-arch@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id E1BE837B718 for ; Thu, 8 Mar 2001 19:52:28 -0800 (PST) (envelope-from imp@billy-club.village.org) Received: from billy-club.village.org (billy-club.village.org [10.0.0.3]) by rover.village.org (8.11.2/8.11.0) with ESMTP id f293qGX44754; Thu, 8 Mar 2001 20:52:19 -0700 (MST) (envelope-from imp@billy-club.village.org) Received: from billy-club.village.org (localhost [127.0.0.1]) by billy-club.village.org (8.11.2/8.8.3) with ESMTP id f293nGs04577; Thu, 8 Mar 2001 20:49:16 -0700 (MST) Message-Id: <200103090349.f293nGs04577@billy-club.village.org> To: "Rodney W. Grimes" Subject: Re: Breaking up make.conf Cc: fullermd@futuresouth.com (Matthew D. Fuller), kris@obsecurity.org (Kris Kennaway), arch@FreeBSD.ORG In-reply-to: Your message of "Thu, 08 Mar 2001 18:41:52 PST." <200103090241.SAA27525@gndrsh.dnsmgr.net> References: <200103090241.SAA27525@gndrsh.dnsmgr.net> Date: Thu, 08 Mar 2001 20:49:16 -0700 From: Warner Losh Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : > Putting something like that in src/ seems a bit dangerous. I don't think it would be any more dangerous than having the things we have in src. In message <200103090241.SAA27525@gndrsh.dnsmgr.net> "Rodney W. Grimes" writes: : There would never be a src/make.conf in the repository, perhaps a : src/make.conf.defaults, but never src/make.conf. My pet peeve is that : /etc/make.conf is global and affects all src trees on systems, but src : trees may have quite different needs. IIRC bde shares this view. I share this view strongly. It would solve a whole class of problems. That class is variaions on the "my /etc/make.conf isn't the same as on the machine I builtworld on, so installworld fails." Of course including bsd.cpu.mk and bsd.own.mk from sys.mk is likely the wrong thing to do in the first place. It might be better to search ${.CURDIR}, ${.CURDIR}/.., etc for etc/defaults/make.conf (note no leading shash so it is relative to the dirs listed) and pull that in. You'll eventually hit / in which case you pull in /etc/defaults/make.conf. FreeBSD's etc/default/make.conf should be modified to do the same search except looking for etc/make.conf. We should have no etc/make.conf in the tree. People can edit that, or put it in /etc/make.conf as they see fit. Something like the following patch, included after my sig. Note, I'd also go for nuking bsd.own.mk and bsd.cpu.mk and moving them into etc/defaults/make.conf so we stop polluting the global make space with them. .for loops are hard to terminate in make, so I didn't try. Maybe setting __d equal to -- would be enough to effectively terminate the loop. Maybe hacking make to grok .for loop termination would be better. The efficiency freaks would likely want to write this as a series of if .exists .elif exists.... You likely could not do that with the for loop, however :-(. Warner Index: share/mk/sys.mk =================================================================== RCS file: /home/imp/FreeBSD/CVS/src/share/mk/sys.mk,v retrieving revision 1.50 diff -u -r1.50 sys.mk --- share/mk/sys.mk 2001/02/22 11:14:25 1.50 +++ share/mk/sys.mk 2001/03/09 03:43:58 @@ -236,20 +236,15 @@ .endif -.if exists(/etc/defaults/make.conf) -.include +__d := ${.CURDIR} +.for __i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +.if exists(${__d}/etc/defaults/make.conf) +.include "${__d}/etc/defaults/make.conf" .endif +__d:=${__d}/.. +.endfor +.undef __d -.if exists(/etc/make.conf) -.include -.endif - .include - -.if exists(/etc/make.conf.local) -.error Error, original /etc/make.conf should be moved to the /etc/defaults/ directory and /etc/make.conf.local should be renamed to /etc/make.conf. -.include -.endif - .include Index: etc/defaults/make.conf =================================================================== RCS file: /home/imp/FreeBSD/CVS/src/etc/defaults/make.conf,v retrieving revision 1.147 diff -u -r1.147 make.conf --- etc/defaults/make.conf 2001/02/27 11:21:47 1.147 +++ etc/defaults/make.conf 2001/03/09 03:44:11 @@ -366,3 +366,11 @@ #SENDMAIL_LDFLAGS= #SENDMAIL_LDADD= #SENDMAIL_DPADD= +__d := ${.CURDIR} +.for __i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 +.if exists(${__d}/etc/make.conf) +.include "${__d}/etc/make.conf" +.endif +__d:=${__d}/.. +.endfor +.undef __d To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message