Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Mar 2001 21:30:38 -0700
From:      Warner Losh <imp@village.org>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net>, "Matthew D. Fuller" <fullermd@futuresouth.com>, arch@FreeBSD.ORG
Subject:   Re: Breaking up make.conf 
Message-ID:  <200103090430.f294Ucs04824@billy-club.village.org>
In-Reply-To: Your message of "Thu, 08 Mar 2001 20:14:22 PST." <20010308201422.A94052@mollari.cthul.hu> 
References:  <20010308201422.A94052@mollari.cthul.hu>  <200103090241.SAA27525@gndrsh.dnsmgr.net> <200103090349.f293nGs04577@billy-club.village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20010308201422.A94052@mollari.cthul.hu> Kris Kennaway writes:
: All that searching sounds like it would slow things down given the
: number of times make runs during a make world.  On the other hand,
: recursively including parent Makefile.incs until there are no more
: parents, and then pulling in a config file also adds more work.

I think it would be a wash.  Also, recursively including the parents
is going to need this same sort of searching because you can't just
include ${.CURDIR}/../Makefile.inc, since ${.CURDIR} isn't where
Makefile.inc lives, but where Makefile lives (trust me on this, I've
tried it before and it blows up).  We have makefiles at too many
different levels in the tree for things to work right all the time
(and these Makefile.incs are therefore interpreted in many different
contexts and your ../../ in the .include recursive part mess things
up, I've been down this path).

: That also is a bit funky in that /usr/src/etc/defaults/make.conf
: controls default settings for /usr/src, but it is also installed as
: /etc/defaults/make.conf and applies to all makes, so it still has
: global scope.

That's not all that funky.  It should be a simple file that really
doesn't set anything anyway.  More likely it should be called
etc/defaults/make.allow-things-to-be-overridden-in-a-sane-way.cf since
it really won't have any settings in it.

If we want a freebsd specific one, we should have a freebsd specific
one that we don't install.  Actaully, I'd make a make.conf.freebsd and
put the current contents of /etc/defaults/make.conf in that and have
etc/defaults/make.conf just be the + lines from my patch below.

: Perhaps you meant to say ./src.conf.defaults or something (i.e. there
: would be a /usr/src/src.conf.defaults in the repo which has all of the
: NO_* crap currently in make.conf, etc., and you can overrride this for
: any subtree of /usr/src by sticking a src.conf there.

No, I ment to say exactly what I said.  I don't want to override
things on a per tree basis.  I think that's asking for trouble.  I
really did mean that I want to have the ability to have a tree of
trees.  I do that all the time.

The tree is too intertwined to change options in the middle of it and
expect it to work.  We shouldn't give our users that much rope.

: Anyway, the only real question here is whether to go for the iterative
: .for search, or a recursive include.  Both can give the same
: behaviour, so it comes down to which is more efficient.

You have to do the searching no matter what.

: > 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.
: 
: You can't put bsd.cpu.mk in /etc/defaults/make.conf or I would have
: done this from the beginning. It has to be included AFTER
: /etc/make.conf, because thats where CPUTYPE is set.

Yes, you can.  Here's an updated version that eliminates things.

Note, we can and should likely do something different than having
every single possible option commented out in
/etc/defaults/make.conf.  I've not tried to address that in my
patches.

Also, we can have usr.bin/make install the /etc/defaults/make.conf
that is just the + lines in the make.conf part of the patch below.
That way it will be radically different than the one we have in
src/etc/defaults/make.conf.  We would then not install
src/etc/defaults/make.conf.  Alternatively, we could install it as
/etc/defaults/make.conf.freebsd and add a
.if defined(__freebsd_world) && .exists (/etc/defaults/make.conf.freebsd)
.include "/etc/defaults/make.conf.freebsd"
.endif
to /etc/defaults/make.conf.  /etc/defaults/make.conf.freebsd could
then include /etc/make.conf.freebsd if it existed.

Right now /etc/defaults/make.conf doesn't follow the same rules of
including /etc/make.conf.  It also doesn't define anything except
BDEFLAGS.

I really do want to see a generic mechanism in place.  I don't want to
see another set of hacks just for FreeBSD.  If we have a generic
mechanism in place, we can document it and other projects can use or
not use it as they see fit.

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 04:22:49
@@ -236,20 +236,11 @@
 
 .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
+.if exists(${__d}/etc/defaults/make.conf)
+.include "${__d}/etc/defaults/make.conf"
 .endif
-
-.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>
+__d:=${__d}/..
+.endfor
+.undef __d
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 04:23:06
@@ -366,3 +366,16 @@
 #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
+
+.include <bsd.cpu.mk>
+
+.include <bsd.own.mk>

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?200103090430.f294Ucs04824>