Re: Need to override KRNLCONFDIR variable in command line of make (file /usr/src/Makefile.inc1).

[ Available lists | Index of freebsd-hackers | Month of Dec 2002 | Week of 3 Dec 2002 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Peter Pentchev <roam@ringlet.net>
Date
3 Dec 2002 06:49:47
Subject
Re: Need to override KRNLCONFDIR variable in command line of make (file /usr/src/Makefile.inc1).
Message-ID
20021203144918.GJ365@straylight.oblivion.bg

In reply to
References to

[ Hide this part ]
On Tue, Dec 03, 2002 at 05:37:34PM +0300, Andrey Beresovsky wrote:
>
> Hello,
>
> I am developing a program which will allow me to build worlds and kernels for
> several hosts with different options (make.conf files, kernel configs and so on).
> I need to be able to override some variables in /usr/src/Makefile.inc1. For the
> moment they are defined with '=', and I suggest defining them with '?='. The
> variables I need to override are KRNLSRCDIR, KRNLCONFDIR, KRNLOBJDIR. I have
> sent PR (misc/45961) with patch to solve my request.
>
> Please, anyone who has a commit rights, commit this patch.

I was wondering about that when I saw your PR; actually, I think that
the current FreeBSD kernel building infrastructure is quite sufficient
for what you want to do, without any more modifications.

To use different make.conf settings, you have three options:
- use the same make.conf file, but with .ifdef FOO ... .endif blocks,
containing per-host configuration variables;
- use a single simple make.conf file with .ifdef FOO /
.include make.foo.conf / .endif blocks, with different make.foo.conf
files for the different hosts;
- set the (slightly underdocumented) __MAKE_CONF variable to a different
value.

To use different kernel configs, just set the KERNCONF variable to the
value you need.

The object directory is set according to the KERNCONF value - if you
have different kernel config file names, you will have different object
directories.

Why do you need different source trees and kernel config dirs? I see no
problem with keeping all kernel configs for the same version of FreeBSD
in the same src/sys/<arch>/conf/ directory, or at least keeping symlinks
to different files in the same src/sys/<arch>/conf/ directory.

Different source trees - if you have a source tree checked out to use
for building the kernel, what is stopping you from invoking the
'buildkernel' target from the corresponding src/ directory, the one
directly above the sys/ directory?

Of course, I am probably overlooking some aspects, or missing
information about your particular configuration. Still, I believe that
for most configurations, the already-provided variables and build
infrastructure are quite sufficient.

G'luck,
Peter

--
Peter Pentchev roam@ringlet.net roam@FreeBSD.org
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553
What would this sentence be like if pi were 3?


[ Show this part (application/pgp-signature) ]

Elapsed time: 0.156 seconds