From owner-freebsd-arch Sat Jul 20 9:45:41 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E7A4B37B400; Sat, 20 Jul 2002 09:45:38 -0700 (PDT) Received: from thuvia.demon.co.uk (thuvia.demon.co.uk [193.237.34.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id D84CE43E3B; Sat, 20 Jul 2002 09:45:36 -0700 (PDT) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (dotar.thuvia.org [10.0.0.4]) by phaidor.thuvia.org (8.11.6/8.11.6) with ESMTP id g6KGjVb76184; Sat, 20 Jul 2002 17:45:31 +0100 (BST) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (localhost [IPv6:::1]) by dotar.thuvia.org (8.12.3/8.12.3) with ESMTP id g6KGjVKC085420; Sat, 20 Jul 2002 17:45:31 +0100 (BST) (envelope-from mark@dotar.thuvia.org) Received: (from mark@localhost) by dotar.thuvia.org (8.12.3/8.12.3/Submit) id g6KGjUvS085419; Sat, 20 Jul 2002 17:45:30 +0100 (BST) Date: Sat, 20 Jul 2002 17:45:30 +0100 (BST) From: Mark Valentine Message-Id: <200207201645.g6KGjUvS085419@dotar.thuvia.org> In-Reply-To: <20020719074504.GC39934@sunbay.com> X-Disclaimer: tequila X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: Ruslan Ermilov Subject: Re: [POLL] need a good name for share/mk API versioning Cc: arch@freebsd.org Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > From: Ruslan Ermilov > Date: Fri 19 Jul, 2002 > Subject: Re: [POLL] need a good name for share/mk API versioning > Yes, sys.mk is not the best place, but technically it's the only place > sufficient for what I need, and I need some variable defined before we > include bsd.lib.mk; this is only possible with sys.mk. The real problem is a design issue with the FreeBSD build system, in that the Makefile doesn't know which version of the bsd.*.mk files it's going to get before it includes one of them. PARAMETER = some value .include A better design might have been to include build system default parameters seperately: .include .if defined(_WHATEVER_) PARAMETER = some value .else OTHERPARAMETER = other value .endif .include The present design assumes that make(1)'s ``?='' feature allowing defaults to be set as "fallback" values is sufficient, but we now see that this isn't good enough to cope with architectural changes (but supporting multiple build system versions probably wasn't a design goal). However, it's obviously too late to change every Makefile in the world to correct that design issue now. Putting information about bsd.*.mk in sys.mk, however, is also insufficient, since sys.mk doesn't know which versions of bsd.*.mk the makefile will pick up, if any (consider using ``-m'' or ``-I'' options to pick up bsd.*.mk from a directory other than the one containing sys.mk, which should be legitimate). One possible workaround might be to have sys.mk include a file defined by a variable (if defined, perhaps in the environment), which for the FreeBSD build system could be set to "bsd.sys.mk" or similar. This allows any build system to have a component included before the Makefile is read. .if defined(__BUILD_SYS_MK) .include "${__BUILD_SYS_MK}" .endif If really needed for compatibility/POLA reasons, sys.mk could default the variable: __BUILD_SYS_MK?=bsd.sys.mk The user could set the variable to /dev/null to avoid the existing pollution to his own build system. This mechanism would allow the make.conf stuff, etc. to be moved out of sys.mk. Cheers, Mark. -- Mark Valentine, Thuvia Labs "Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses "We're kind of stupid that way." *munch* *munch* and endorses FreeBSD -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message