From owner-freebsd-current Sat May 30 15:49:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA18606 for freebsd-current-outgoing; Sat, 30 May 1998 15:49:00 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from time.cdrom.com (root@time.cdrom.com [204.216.27.226]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA18555; Sat, 30 May 1998 15:48:53 -0700 (PDT) (envelope-from jkh@time.cdrom.com) Received: from time.cdrom.com (jkh@localhost.cdrom.com [127.0.0.1]) by time.cdrom.com (8.8.8/8.8.8) with ESMTP id PAA00442; Sat, 30 May 1998 15:48:04 -0700 (PDT) (envelope-from jkh@time.cdrom.com) To: Peter Wemm cc: current@FreeBSD.ORG, committers@FreeBSD.ORG Subject: Re: elf vs. bsd.*.mk In-reply-to: Your message of "Sun, 31 May 1998 01:36:32 +0800." <199805301736.BAA24556@spinner.netplex.com.au> Date: Sat, 30 May 1998 15:48:04 -0700 Message-ID: <438.896568484@time.cdrom.com> From: "Jordan K. Hubbard" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I suggest you leverage the work you've done so far and simply finish it. We know our build system is full of warts, we've just not had anyone dedicated (with $$ incentive :) to go after them until now(?). - Jordan > I've been having a good fight trying to get the world and all the > permutations of the binary formats doing something sensible. > > Along the way I've found some things in the *.mk files which scare the > hell out of me. > > For starters, sys.mk is automatically pulled in at make(1) startup time to > setup the base, posix and generally widely accepted default rules and > variables. > > However, at the end, it's now pulling in bsd.own.mk and /etc/make.conf (!). > This is polluting the default make environment up with all sorts of crap. > Sure, it means more when the .include stuff is activated at the > end, but there's no reason for it to be there when using non-bmake > Makefiles. > > The reason I ran into this was because there are certain things in the > tree that *must* be compiled with a given object format and cannot use the > system default - eg: the a.out ld.so must be a.out, libgcc.a needs to be > compiled twice, once in a.out and once in elf format etc. > > Ideally, this could be fixed by overriding things in the Makefile, eg: > sticking in a BINFORMAT=elf or BINFORMAT=aout as needed.. But at that > point, it's too late as certain .ifs have already been "done" in > bsd.own.mk (LIBDIR in particular). > > The other *BSD's don't have this problem. They pull in make.conf in > bsd.own.mk, and all the public bsd.{prog,lib,doc,..etc..}.mk files are > responsible for pulling in bsd.own.mk (instead of sys.mk). This means > that STRIP, BINOWN etc are not defined until the bsd.prog.mk (or whatever) > pulls it in. > > This is actually not much of a problem, except for a few cases where > things like usr.bin/strip/Makefile do conditional rules based on variables > that are not yet defined and hence don't work. A simple reordering of > rules fixes it. > > Anyway, I manged to get it (pretty much) working although it nearly cost > me my remaining sanity. I've now got the world building again, although I > know of a handful of minor problems still. > > However, I've just realized another way of doing it that doesn't cause > such a dramatic disturbance to the *.mk files, and hence is less likely to > badly break things.... and is much simpler (damn!!!!!). > > So, I thought I'd see what general feelings were on the subject. Do we > really want things like ${LIBDIR} defined for *all* makefiles, including > non bsd.prog.mk etc Makefiles. Also, make.conf is also globally visible > as well. I'm sure this can't be good for posix compliance etc. Since > I've finished 95% of the work so far, should I press on and clean up the > loose ends, or should I put it in the 'too hard' basket for the time being > and try the simple way out :-). > > Cheers, > -Peter > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message