Subject: Re: More config changes, for ro source tree and disjoint build trees
To: None <>
From: Ignatios Souvatzis <>
List: tech-kern
Date: 08/13/1996 21:50:30
   Date: Tue, 13 Aug 96 10:54:57 EDT
   From: Mike Long <>
   Cc: tech-kern@NetBSD.ORG
   Organization: Analog Devices CPD
   Reply-To: Mike Long <>
   Sender: owner-tech-kern@NetBSD.ORG
   Precedence: list
   X-Loop: tech-kern@NetBSD.ORG

   >From: Jason Thorpe <>
   >Date: Mon, 12 Aug 1996 20:40:16 -0700
   >On 12 Aug 1996 23:05:56 -0400 
   > Michael Graff <> wrote:
   > > To be honest, I would rather see something which allowd you to nearly
   > > build a kernel config file from a running kernel.  I would love to see
   > > some sort of "supported options" list in the kernel itself, with names
   > > and status info.
   >That's certainly possible to implement.  However, doing so could lead to 
   >bloat that's not universally useful.
   >I guess you'd have to make it an option :-)

   You could solve the LKM #ifdef problem and the supported-options
   problem at the same time:

   1) Options for which LKMs exist, and other "supported" options, are
   declared in /sys/.../files* .  Part of the declaration is a variable
   name, e.g. compat_freebsd for the COMPAT_FREEBSD option.

   2) Config generates an options.c file in the kernel build directory
   which defines a variable for each supported option.  The variable is
   nonzero if the option is requested in the user's kernel config file:

   int	compat_freebsd	= 1;

   If the option is not requested, the flag is set to zero.  Unsupported
   options (e.g. driver debug options) end up in IDENT as usual.
   options.c is (obviously) compiled into the kernel.

   3) Replace #ifdefs for supported options with flag checks:

   #ifdef COMPAT_FREEBSD		if (compat_freebsd) {
   ...			->	...
   #endif				}

I hope you are aware that options are used at the moment to define
which of two console fonts are compiled into NetBSD/amiga kernel


#ifdef KFONT_8X11

u_int8_t kf8x11data[] = { ...};


in one place and

#ifdef KFNOT_8x11

#define fontdata kf8x11data


in another. Any better method for similar stuff which 
which fits with your proposal?