1 .\" $NetBSD: config.1,v 1.9 2009/08/31 03:39:00 cube Exp $
3 .\" Copyright (c) 1980, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" from: @(#)config.8 8.2 (Berkeley) 4/19/94
37 .Nd build kernel compilation directories
53 In its first synopsis form,
55 creates a kernel build directory from the machine description file
57 which describes the system to configure.
59 .Sx KERNEL BUILD CONFIGURATION
60 for the details of that use
64 In its second synopsis form,
66 takes the binary kernel
68 as its single argument (aside from the mandatory
70 flag), then extracts the embedded configuration file (if any) and
71 writes it to standard output.
77 Configuration data will be available if the given kernel was compiled
79 .Va INCLUDE_CONFIG_FILE
81 .Va INCLUDE_JUST_CONFIG
84 In its third synopsis form,
86 is a tool for the kernel developer and generates a
88 configuration file to be used during regression testing.
90 .Sx LINT CONFIGURATION
91 for the details of that use of
95 accepts the following parameters:
96 .Bl -tag -width indent
100 as the kernel build directory, instead of computing and creating one
103 Generate a lint configuration.
105 .Sx LINT CONFIGURATION
108 Pack locators to save space in the resulting kernel binary.
109 The amount of space saved that way is so small that this option should
110 be considered historical, and of no actual use.
112 Generate a build directory suited for kernel profiling.
113 However, this options should be avoided in favor of the relevant options
114 inside the configuration file as described in section
115 .Sx KERNEL BUILD CONFIGURATION .
117 Point to the top of the kernel source tree.
118 It must be an absolute path when
120 is used to prepare a kernel build directory, but can be relative
121 when it is used in combination with the
125 Increase verbosity by enabling some more warnings.
127 Extract the configuration embedded in a kernel binary.
129 .Ss KERNEL BUILD CONFIGURATION
130 There are several different ways to run the
133 The traditional way is to run
137 subdirectory of the machine-specific directory of the system source
139 .Pa /sys/arch/MACHINE/conf ,
145 and so forth), and to specify as the
147 the name of a machine description file located in that directory.
149 will by default create files in the directory
150 .Pa ../compile/SYSTEMNAME ,
153 is the last path component of
156 will assume that the top-level kernel source directory is located four
157 directories above the build directory.
159 Another way is to create the build directory yourself, place the
160 machine description file in the build directory with the name
164 from within the build directory without specifying a
167 will then by default create files in the current directory.
170 this way, you must specify the location of the top-level kernel source
173 option or by using the
175 directive at the beginning of the machine description file.
177 Finally, you can specify the build directory for
179 and run it from anywhere.
180 You can specify a build directory with the
182 option or by using the
184 directive at the beginning of the machine description file.
185 You must specify the location of the top-level kernel source directory if you
186 specify a build directory.
192 will try to extract the configuration file embedded into it, which will
193 be present if that kernel was built either with
194 .Va INCLUDE_CONFIG_FILE
196 .Va INCLUDE_JUST_CONFIG
198 This work mode requires you to manually specify a build directory with
201 option, which implies the need to provide a source tree too.
207 is appended to the default compilation directory name, and
210 .Dq Li makeoptions PROF="-pg"
213 appeared in the machine description file.
214 This will build a system that includes profiling code; see
220 flag is expected to be used for
222 profiles of existing systems; for regular profiling, it is probably
223 wiser to create a separate machine description file containing the
229 flag is no longer supported.
231 .Dq Li makeoptions DEBUG="-g"
233 .Dq Li options KGDB .
237 consists of a number of files, principally
239 a description of I/O devices that may be attached to the system; and a
243 in building the kernel.
249 in the directory where the new makefile
252 prints a reminder of this when it completes.
256 stops due to errors, the problems reported should be corrected and
260 attempts to avoid changing the compilation directory
261 if there are configuration errors,
262 but this code is not well-tested,
263 and some problems (such as running out of disk space)
265 .Ss LINT CONFIGURATION
268 configuration should include everything from the kernel that can
269 possibly be selected.
270 The rationale is to provide a way to reach all the code a user might
271 select, in order to make sure all options and drivers compile without
272 error for a given source tree.
278 takes the regular configuration file
280 and prints on the standard output a configuration file that includes
282 selects all options and file-systems the user can possibly select,
283 and defines an instance of every possible attachment as described by
284 the kernel option definition files used by
287 The resulting configuration file is meant as a way to select all
288 possible features in order to test that each of them compiles.
289 It is not meant to result in a kernel binary that can run on any
292 Unlike the first synopsis form, the provided
294 is relative to the current working directory.
295 In the first synopsis form, it is relative to the build directory.
297 The SYNOPSIS portion of each device in section 4.
299 .\" .%T "Building 4.4 BSD Systems with Config"
300 .\" .%T "Device Support in 4.4BSD"
311 It was completely revised in