Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/BUILDING,v rcsdiff: /ftp/cvs/cvsroot/src/BUILDING,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.108 retrieving revision 1.123 diff -u -p -r1.108 -r1.123 --- src/BUILDING 2014/08/03 09:28:43 1.108 +++ src/BUILDING 2017/02/16 17:15:26 1.123 @@ -1,7 +1,7 @@ BUILDING(8) System Manager's Manual BUILDING(8) NAME - BUILDING -- Procedure for building NetBSD from source code. + BUILDING - Procedure for building NetBSD from source code. REQUIREMENTS NetBSD is designed to be buildable on most POSIX-compliant host systems. @@ -77,8 +77,12 @@ FILES any of these directories are missing, they will be skipped during the build. - x11/ ``Reachover'' build structure for X11R6; the source is in - X11SRCDIR. + external/mit/xorg/ + ``Reachover'' build structure for modular Xorg; the source + is in X11SRCDIR. + + extsrc/ ``Reachover'' build structure for externally added + programs and libraries; the source is in EXTSRCSRCDIR. Build tree layout The NetBSD build tree is described in hier(7), and the release layout is @@ -197,6 +201,13 @@ CONFIGURATION Note: build.sh will provide a default of destdir.MACHINE (in the top-level .OBJDIR) unless run in `expert' mode. + EXTSRCSRCDIR + Directory containing sources of externally added programs and + libraries. If specified, must be an absolute path. + + Default: NETBSDRCDIR/../extsrc, if that exists; otherwise + /usr/extsrc. + MAKECONF The name of the make(1) configuration file. Only settable in the process environment. @@ -264,6 +275,11 @@ CONFIGURATION Default: ``yes'' + MKEXTSRC Can be set to ``yes'' or ``no''. Indicates whether extsrc is + built from EXTSRCSRCDIR. + + Default: ``no'' + MKHTML Can be set to ``yes'' or ``no''. Indicates whether preformatted HTML manual pages will be built and installed @@ -333,7 +349,7 @@ CONFIGURATION statically linked. Default: Platform dependent. As of this writing, all - platforms except sh3 default to ``yes''. + platforms except m68000 default to ``yes''. MKPICINSTALL Can be set to ``yes'' or ``no''. Indicates whether the ar(1) @@ -356,6 +372,12 @@ CONFIGURATION Default: ``no'' + MKREPRO_TIMESTAMP + Unix timestamp. When MKREPRO is set, the timestamp of all + files in the sets will be set to this value. + + Default: Unset. + MKSHARE Can be set to ``yes'' or ``no''. Indicates whether files destined to reside in DESTDIR/usr/share will be built and installed during a build. If set to ``no'', then all of @@ -427,19 +449,13 @@ CONFIGURATION USETOOLS is also set to ``no'' when using outside the NetBSD source tree. - X11SRCDIR Directory containing the X11R6 source. If specified, must be - an absolute path. The main X11R6 source is found in - X11SRCDIR/xfree/xc. + X11SRCDIR Directory containing the modular Xorg source. If specified, + must be an absolute path. The main modular Xorg source is + found in X11SRCDIR/external/mit. Default: NETBSDRCDIR/../xsrc, if that exists; otherwise /usr/xsrc. - X11FLAVOUR The style of X11 cross-built, set to either ``Xorg'' or - ``XFree86''. - - Default: ``Xorg'' on amd64, i386, macppc, shark and sparc64 - platforms, ``XFree86'' on everything else. - "make" variables for full builds These variables only affect the top level ``Makefile'' and do not affect manually building subtrees of the NetBSD source code. @@ -632,8 +648,8 @@ BUILDING set (see above). iso-image Create a NetBSD installation CD-ROM image in the - RELEASEDIR/iso directory. The CD-ROM file system will have - a layout as described in release(7). + RELEASEDIR/images directory. The CD-ROM file system will + have a layout as described in release(7). For most machine types, the CD-ROM will be bootable, and will automatically run the sysinst(8) menu-based @@ -649,8 +665,8 @@ BUILDING the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in - RELEASEDIR/iso, but do not contain additional content such - as the distribution sets. + RELEASEDIR/images, but do not contain additional content + such as the distribution sets. Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the mkisofs(1) @@ -659,8 +675,8 @@ BUILDING iso-image-source Create a NetBSD installation CD-ROM image in the - RELEASEDIR/iso directory. The CD-ROM file system will have - a layout as described in release(7). It will have top + RELEASEDIR/images directory. The CD-ROM file system will + have a layout as described in release(7). It will have top level directories for the machine type and source. For most machine types, the CD-ROM will be bootable, and @@ -678,8 +694,8 @@ BUILDING the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory by ``make release''. These smaller images usually contain the same tools as the larger images in - RELEASEDIR/iso, but do not contain additional content such - as the distribution sets. + RELEASEDIR/images, but do not contain additional content + such as the distribution sets. Note that the mac68k port still uses an older method of creating CD-ROM images. This requires the mkisofs(1) @@ -706,8 +722,7 @@ BUILDING must have been performed with MKUNPRIVED=yes because ``make install-image'' relies on information in DESTDIR/METALOG. - live-image Create NetBSD live images in the - RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage + live-image Create NetBSD live images in the RELEASEDIR/images directory. The live image contains all necessary files to boot NetBSD up to multi-user mode, including all files which should be extracted during installation, NetBSD @@ -820,6 +835,12 @@ BUILDING symbol table and can be used for debugging (for example with a cross-gdb built by MKCROSSGDB). + kernels This command will build all kernels defined in port + specific release build procedure. + + This command internally calls the kernel=kconf operation + for each found kernel configuration file. + modules This command will build kernel modules and install them into DESTDIR. @@ -846,10 +867,21 @@ BUILDING live-image Perform ``make live-image''. + list-arch Prints a list of valid MACHINE and MACHINE_ARCH settings, + the default MACHINE_ARCH for each MACHINE, and aliases for + MACHINE/MACHINE_ARCH pairs, and then exits. The -m or -a + options (or both) may be used to specify glob patterns that + will be used to narrow the list of results; for example, + ``build.sh -m 'evm*' -a '*arm*' list-arch'' will list all + known MACHINE/MACHINE_ARCH values in which either MACHINE + or ALIAS matches the pattern `evb*', and MACHINE_ARCH + matches the pattern `*arm*'. + The following command line options alter the behaviour of the build.sh operations described above: - -a arch Set the value of MACHINE_ARCH to arch. + -a arch Set the value of MACHINE_ARCH to arch. See the -m option for + more information. -B buildid Set the value of BUILDID to buildid. This will also append the @@ -908,30 +940,19 @@ BUILDING relative path. If the directory does not already exist, build.sh will create it. - -m mach Set the value of MACHINE to mach, except in some special cases - listed below. This will also override any value of - MACHINE_ARCH in the process environment with a value deduced - from mach, unless -a is specified. All cross builds require - -m, but if unset on a NetBSD host, the host's value of MACHINE - will be detected and used automatically. - - Some machines support multiple values for MACHINE_ARCH. The - following special cases for the mach argument are defined to - set the listed values of MACHINE and MACHINE_ARCH: - - mach MACHINE MACHINE_ARCH - evbarm evbarm (not set) - evbarm-eb evbarm armeb - evbarm-el evbarm arm - evbmips evbmips (not set) - evbmips-eb evbmips mipseb - evbmips-el evbmips mipsel - evbsh3 evbsh3 (not set) - evbsh3-eb evbsh3 sh3eb - evbsh3-el evbsh3 sh3el - sbmips sbmips (not set) - sbmips-eb sbmips mipseb - sbmips-el sbmips mipsel + -m mach Set the value of MACHINE to mach, unless the mach argument is + an alias that refers to a MACHINE/MACHINE_ARCH pair, in which + case both MACHINE and MACHINE_ARCH are set from the alias. + Such aliases are interpreted entirely by build.sh; they are not + used by any other part of the build system. The MACHINE_ARCH + setting implied by mach will override any value of MACHINE_ARCH + in the process environment, but will not override a value set + by the -a option. All cross builds require -m, but if unset on + a NetBSD host, the host's value of MACHINE will be detected and + used automatically. + + See the list-arch operation for a way to get a list of valid + MACHINE and MACHINE_ARCH settings. -N noiselevel Set the ``noisyness'' level of the build, by setting @@ -963,6 +984,16 @@ BUILDING by the values of several variables and by the location of the source directory. + Note that placing the obj directory location outside of the + default source tree hierarchy makes it easier to manually clear + out old files in the event the ``make cleandir'' operation is + unable to do so. (See CAVEATS below.) + + Note also that use of one of -M or -O is the only means of + building multiple machine architecture userlands from the same + source tree without cleaning between builds (in which case, one + would specify distinct obj locations for each). + -o Set the value of MKOBJDIRS to ``no''. Otherwise, it will be automatically set to ``yes''. This default is opposite to the behaviour when not using build.sh. @@ -1006,6 +1037,13 @@ BUILDING -x Set MKX11=yes. + -Y extsrcdir + Set the value of EXTSRCSRCDIR to extsrcdir. If a relative path + is specified, it will be converted to an absolute path before + being used. + + -y Set MKEXTSRC=yes. + -Z var Unset ("zap") the environment variable var. This is propagated to the nbmake wrapper. @@ -1064,4 +1102,10 @@ HISTORY The build.sh based build scheme was introduced for NetBSD 1.6 as USE_NEW_TOOLCHAIN, and re-worked to TOOLCHAIN_MISSING after that. -NetBSD August 3, 2014 NetBSD +CAVEATS + After significant updates to third-party components in the source tree, + the ``make cleandir'' operation may be insufficient to clean out old + files in object directories. Instead, one may have to manually remove + the files. Consult the UPDATING file for notices concerning this. + +NetBSD February 16, 2017 NetBSD