Date: Thu, 08 Mar 2001 20:49:16 -0700 From: Warner Losh <imp@village.org> To: "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net> Cc: fullermd@futuresouth.com (Matthew D. Fuller), kris@obsecurity.org (Kris Kennaway), arch@FreeBSD.ORG Subject: Re: Breaking up make.conf Message-ID: <200103090349.f293nGs04577@billy-club.village.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>
next in thread | previous in thread | raw e-mail | index | archive | help
: > 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 </etc/defaults/make.conf> +__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 </etc/make.conf> -.endif - .include <bsd.cpu.mk> - -.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 </etc/make.conf.local> -.endif - .include <bsd.own.mk> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103090349.f293nGs04577>