From owner-freebsd-current Sat May 30 10:37:24 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA05825 for freebsd-current-outgoing; Sat, 30 May 1998 10:37:24 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA05784; Sat, 30 May 1998 10:36:52 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.8.8/8.8.8/Spinner) with ESMTP id BAA24556; Sun, 31 May 1998 01:36:32 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199805301736.BAA24556@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: current@FreeBSD.ORG cc: committers@FreeBSD.ORG Subject: elf vs. bsd.*.mk Date: Sun, 31 May 1998 01:36:32 +0800 From: Peter Wemm Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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