Subject: bin/1970: bsd.own.mk must be modified to set parameters. this is bad.
To: None <gnats-bugs@gnats.netbsd.org>
From: Chris G. Demetriou <cgd@sun-lamp.pc.cs.cmu.edu>
List: netbsd-bugs
Date: 01/22/1996 18:03:04
>Number:         1970
>Category:       bin
>Synopsis:       bsd.own.mk includes no way to set params w/o modifying it.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 22 18:35:01 1996
>Last-Modified:
>Originator:     Chris G. Demetriou
>Organization:
Kernel Hackers 'r' Us
>Release:        NetBSD-current, up to date as of Jan. 22, 1996, 6:00 PM EST.
>Environment:
System: NetBSD sun-lamp.pc.cs.cmu.edu 1.1A NetBSD 1.1A (SUN_LAMP) #34: Thu Jan 18 20:53:30 EST 1996 cgd@sun-lamp.pc.cs.cmu.edu:/usr/src/sys/arch/i386/compile/SUN_LAMP i386


>Description:
	bsd.own.mk includes system configuration parameters, but provides
	no way for them to be easily changed without modifying bsd.own.mk
	itself.

	A simple example is the BSDSRCDIR variable.  If I want to put
	/usr/src on a different partition using a symlink, and want 'make obj'
	to work, then i need to set BSDSRCDIR to the correct location
	of the source tree.  This means that either i have to set it
	in my environment (which doesn't work if there are multiple people
	working on the source tree), or edit bsd.own.mk, which is obviously
	a bad thing (because my mods would get clobbered when supping from
	the master sources, for instance).

	In general, there's no way _other_ than modifying bsd.own.mk to
	set the configuration parameters that need to be set there.

	There is also no way for users with private source trees seperate
	from /usr/src to easily specify their _own_ sets of configuration
	parameters (e.g. BSDSRCDIR).

>How-To-Repeat:
	get the -current sources.
	move /usr/src to somewhere else.
	cd there.
	try to 'make obj' correctly without:
		(1) setting anything special in your environment or on
		    the make command line, or
		(2) editing bsd.own.mk.

>Fix:
	The following patch fixes this problem.  It causes bsd.own.mk
	to include the file "${MAKECONF}", if that variable is set and
	file exists, or, if that isn't done, to include "/etc/mk.conf",
	if that file exists.

	This allows a global system configuration file, and allows
	users to easily specify their own configuration files.

	In my opinion, there should be no default /etc/mk.conf.

Index: share/mk/bsd.README
===================================================================
RCS file: /cvsroot/src/share/mk/bsd.README,v
retrieving revision 1.2
diff -c -r1.2 bsd.README
*** bsd.README	1996/01/22 22:41:56	1.2
--- bsd.README	1996/01/22 22:53:25
***************
*** 97,109 ****
  
  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  
! The include file <bsd.own.mk> contains the owners, groups, etc. for both
! manual pages and binaries.
  
  It has no targets.
  
! It sets the following variables, if they are not already defined (defaults
! are in brackets):
  
  BSDSRCDIR	The real path to the system sources, so that 'make obj'
  		will work correctly. [/usr/src]
--- 97,115 ----
  
  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  
! The include file <bsd.own.mk> contains source tree configuration parameters,
! such as the owners, groups, etc. for both manual pages and binaries, and
! a few global "feature configuration" parameters.
  
  It has no targets.
  
! To get system-specific configuration parameters, bsd.own.mk will try to
! include the file specified by the "MAKECONF" variable.  If MAKECONF is not
! set, or no such file exists, the system make configuration file, /etc/mk.conf
! is included.  These files may define any of the variables described below.
! 
! bsd.own.mk sets the following variables, if they are not already defined
! (defaults are in brackets):
  
  BSDSRCDIR	The real path to the system sources, so that 'make obj'
  		will work correctly. [/usr/src]
***************
*** 166,174 ****
  		can either be installed with copies, or with moves using
  		a single knob. [-c]
  
! Additionally, the following variables may be set to modify the behaviour
! of the system build process (default values are in brackets along with
! comments, if set by bsd.own.mk):
  
  EXPORTABLE_SYSTEM
  		Do not build /usr/src/domestic, even if it is present.
--- 172,181 ----
  		can either be installed with copies, or with moves using
  		a single knob. [-c]
  
! Additionally, the following variables may be set by bsd.own.mk or in a
! make configuration file to modify the behaviour of the system build
! process (default values are in brackets along with comments, if set by
! bsd.own.mk):
  
  EXPORTABLE_SYSTEM
  		Do not build /usr/src/domestic, even if it is present.
***************
*** 194,200 ****
  
  NOLINT		Do not build lint libraries. [set, set unconditionally]
  
! This file is generally useful when building your own Makefiles so that
  they use the same default owners etc. as the rest of the tree.
  
  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--- 201,207 ----
  
  NOLINT		Do not build lint libraries. [set, set unconditionally]
  
! bsd.own.mk is generally useful when building your own Makefiles so that
  they use the same default owners etc. as the rest of the tree.
  
  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Index: share/mk/bsd.own.mk
===================================================================
RCS file: /cvsroot/src/share/mk/bsd.own.mk,v
retrieving revision 1.1
diff -c -r1.1 bsd.own.mk
*** bsd.own.mk	1996/01/20 07:23:24	1.1
--- bsd.own.mk	1996/01/22 22:49:47
***************
*** 1,5 ****
--- 1,11 ----
  #	$NetBSD: bsd.own.mk,v 1.23 1995/11/03 23:33:33 cgd Exp $
  
+ .if defined(MAKECONF) && exists(${MAKECONF})
+ .include "${MAKECONF}"
+ .elif exists(/etc/mk.conf)
+ .include "/etc/mk.conf"
+ .endif
+ 
  # Defining `SKEY' causes support for S/key authentication to be compiled in.
  SKEY=		yes
  # Defining `KERBEROS' causes support for Kerberos authentication to be
>Audit-Trail:
>Unformatted: