1.\" $OpenBSD: config.8,v 1.6 1998/03/16 07:46:04 deraadt Exp $ 2.\" $NetBSD: config.8,v 1.10 1996/08/31 20:58:16 mycroft Exp $ 3.\" 4.\" Copyright (c) 1980, 1991, 1993 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. All advertising materials mentioning features or use of this software 16.\" must display the following acknowledgement: 17.\" This product includes software developed by the University of 18.\" California, Berkeley and its contributors. 19.\" 4. Neither the name of the University nor the names of its contributors 20.\" may be used to endorse or promote products derived from this software 21.\" without specific prior written permission. 22.\" 23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" from: @(#)config.8 8.2 (Berkeley) 4/19/94 36.\" 37.Dd April 19, 1994 38.Dt CONFIG 8 39.Os BSD 4 40.Sh NAME 41.Nm config 42.Nd build kernel compilation directories 43.Sh SYNOPSIS 44.Nm config 45.Op Fl b Ar builddir 46.Op Fl s Ar srcdir 47.Op Fl p 48.Op Ar config-file 49.Sh DESCRIPTION 50.Pp 51.Nm Config 52creates a kernel build directory from the file 53.Ar config-file , 54which describes the system to configure. 55.Pp 56There are several different ways to run the 57.Nm config 58program. The traditional way is to run 59.Nm config 60from the 61.Pa conf 62subdirectory of the machine-specific directory of the system source 63(usually 64.Pa /sys/arch/MACHINE/conf , 65where 66.Pa MACHINE 67is one of 68.Pa vax , 69.Pa tahoe , 70.Pa hp300 , 71and so forth), and to specify as the 72.Ar config-file 73the name of a file located in that directory. 74.Nm config 75will by default create files in the directory 76.Pa ../compile/SYSTEMNAME , 77where 78.Pa SYSTEMNAME 79is the last path component of 80.Ar config-file . 81.Nm Config 82will assume that the top-level kernel source directory is located four 83directories above the build directory. 84.Pp 85Another way is to create the build directory yourself, place the 86configuration file in the build directory with the name 87.Pa CONFIG , 88and run 89.Nm config 90from within the build directory without specifying a 91.Ar config-file . 92.Nm Config 93will then by default create files in the current directory. If you 94run 95.Nm config 96this way, you must specify the location of the top-level kernel source 97directory using the 98.Fl s 99option or by using the 100.Dq Li source 101directive at the beginning of the system configuration file. 102.Pp 103Finally, you can specify the build directory for 104.Nm config 105and run it from anywhere. You can specify a build directory with the 106.Fl b 107option or by using the 108.Dq Li build 109directive at the beginning of the system configuration file. You must 110specify the location of the top-level kernel source directory if you 111specify a build directory. 112.Pp 113If the 114.Fl p 115option is supplied, 116.Pa .PROF 117is appended to the default compilation directory name, and 118.Nm config 119acts as if the lines 120.Dq Li makeoptions PROF="-pg" 121and 122.Dq Li options GPROF 123appeared in the configuration file. 124This will build a system that includes profiling code; see 125.Xr kgmon 8 126and 127.Xr gprof 1 . 128The 129.Fl p 130flag is expected to be used for 131.Dq one-shot 132profiles of existing systems; 133for regular profiling, 134it is probably wiser to make a separate configuration 135containing the 136.Li makeoptions 137line. 138.Pp 139The old undocumented 140.Fl g 141flag is no longer supported. 142Instead, use 143.Dq Li makeoptions DEBUG="-g" 144and (typically) 145.Dq Li options KGDB . 146.Pp 147The output of 148.Nm config 149consists of a number of files, principally 150.Pa ioconf.c , 151a description of I/O devices that may be attached to the system; and a 152.Pa Makefile , 153used by 154.Xr make 1 155in building the kernel. 156.Pp 157After running 158.Nm config , 159it is wise to run 160.Dq Li make depend 161in the directory where the new makefile 162was created. 163.Nm Config 164prints a reminder of this when it completes. 165.Pp 166If 167.Nm config 168stops due to errors, the problems reported should be corrected and 169.Nm config 170should be run again. 171.Nm Config 172attempts to avoid changing the compilation directory 173if there are configuration errors, 174but this code is not well-tested, 175and some problems (such as running out of disk space) 176are unrecoverable. 177.Sh SEE ALSO 178.Xr options 4 . 179.Pp 180The SYNOPSIS portion of each device in section 4. 181.Rs 182.%T "Building 4.4 BSD Systems with Config" 183.\" .%T "Device Support in 4.4BSD" 184.Re 185.sp 186.Sh HISTORY 187The 188.Nm config 189command appeared in 190.Bx 4.1 . 191It was completely revised in 192.Bx 4.4 . 193