Module Name: src
Committed By: yamt
Date: Thu May 22 13:23:26 UTC 2014
Modified Files:
src [yamt-pagecache]: BUILDING Makefile UPDATING build.sh
Log Message:
sync with head.
for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
To generate a diff of this commit:
cvs rdiff -u -r1.96.2.3 -r1.96.2.4 src/BUILDING
cvs rdiff -u -r1.289.2.4 -r1.289.2.5 src/Makefile
cvs rdiff -u -r1.229.2.3 -r1.229.2.4 src/UPDATING
cvs rdiff -u -r1.251.2.4 -r1.251.2.5 src/build.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/BUILDING
diff -u src/BUILDING:1.96.2.3 src/BUILDING:1.96.2.4
--- src/BUILDING:1.96.2.3 Wed Jan 16 05:25:52 2013
+++ src/BUILDING Thu May 22 13:23:26 2014
@@ -1,4 +1,4 @@
-BUILDING(8) NetBSD System Manager's Manual BUILDING(8)
+BUILDING(8) System Manager's Manual BUILDING(8)
NAME
BUILDING -- Procedure for building NetBSD from source code.
@@ -43,16 +43,16 @@ FILES
recompiled regularly.
crypto/dist/, dist/, gnu/dist/
- Sources imported verbatim from third parties, without man-
- gling the existing build structure. Other source trees in
- bin through usr.sbin use the NetBSD make(1) ``reachover''
- Makefile semantics when building these programs for a
- native host.
+ Sources imported verbatim from third parties, without
+ mangling the existing build structure. Other source trees
+ in bin through usr.sbin use the NetBSD make(1)
+ ``reachover'' Makefile semantics when building these
+ programs for a native host.
distrib/, etc/
- Sources for items used when making a full release snap-
- shot, such as files installed in DESTDIR/etc on the desti-
- nation system, boot media, and release notes.
+ Sources for items used when making a full release
+ snapshot, such as files installed in DESTDIR/etc on the
+ destination system, boot media, and release notes.
tests/, regress/
Regression test harness. Can be cross-compiled, but only
@@ -63,8 +63,8 @@ FILES
sys/ NetBSD kernel sources.
tools/ ``Reachover'' build structure for the host build tools.
- This has a special method of determining out-of-date sta-
- tus.
+ This has a special method of determining out-of-date
+ status.
bin/ ... usr.sbin/
Sources to the NetBSD userland (non-kernel) programs. If
@@ -87,18 +87,18 @@ CONFIGURATION
system requires a modern Bourne-like shell with POSIX-
compliant features, and also requires support for the
``local'' keyword to declare local variables in shell
- functions (which is a widely-implemented but non-stan-
- dardised feature).
+ functions (which is a widely-implemented but non-
+ standardised feature).
Depending on the host system, a suitable shell may be
/bin/sh, /usr/xpg4/bin/sh, /bin/ksh (provided it is a
variant of ksh that supports the ``local'' keyword,
such as ksh88, but not ksh93), or /usr/local/bin/bash.
- Most parts of the build require HOST_SH to be an abso-
- lute path; however, build.sh allows it to be a simple
- command name, which will be converted to an absolute
- path by searching the PATH.
+ Most parts of the build require HOST_SH to be an
+ absolute path; however, build.sh allows it to be a
+ simple command name, which will be converted to an
+ absolute path by searching the PATH.
HOST_CC Path name to C compiler used to create the toolchain.
@@ -111,19 +111,20 @@ CONFIGURATION
MAKE Path name to invoke make(1) as.
MAKEFLAGS Flags to invoke make(1) with. Note that build.sh
- ignores the value of MAKEFLAGS passed in the environ-
- ment, but allows MAKEFLAGS to be set via the -V option.
-
- MAKEOBJDIR Directory to use as the .OBJDIR for the current direc-
- tory. The value is subjected to variable expansion by
- make(1). Typical usage is to set this variable to a
- value involving the use of `${.CURDIR:S...}' or
- `${.CURDIR:C...}', to derive the value of .OBJDIR from
- the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is
- not defined. MAKEOBJDIR can be provided only in the
- environment or via the -O flag of build.sh; it cannot
- usefully be set inside a Makefile, including mk.conf or
- ${MAKECONF}.
+ ignores the value of MAKEFLAGS passed in the
+ environment, but allows MAKEFLAGS to be set via the -V
+ option.
+
+ MAKEOBJDIR Directory to use as the .OBJDIR for the current
+ directory. The value is subjected to variable
+ expansion by make(1). Typical usage is to set this
+ variable to a value involving the use of
+ `${.CURDIR:S...}' or `${.CURDIR:C...}', to derive the
+ value of .OBJDIR from the value of .CURDIR. Used only
+ if MAKEOBJDIRPREFIX is not defined. MAKEOBJDIR can be
+ provided only in the environment or via the -O flag of
+ build.sh; it cannot usefully be set inside a Makefile,
+ including mk.conf or ${MAKECONF}.
MAKEOBJDIRPREFIX Top level directory of the object directory tree. The
value is subjected to variable expansion by make(1).
@@ -131,43 +132,44 @@ CONFIGURATION
if necessary, but if make(1) is used without build.sh,
then rules in <bsd.obj.mk> will abort the build if the
${MAKEOBJDIRPREFIX} directory does not exist. If the
- value is defined and valid, then ${MAKEOBJDIRPRE-
- FIX}/${.CURDIR} is used as the .OBJDIR for the current
- directory. The current directory may be read only.
- MAKEOBJDIRPREFIX can be provided only in the environ-
- ment or via the -M flag of build.sh; it cannot usefully
- be set inside a Makefile, including mk.conf or
- ${MAKECONF}.
+ value is defined and valid, then
+ ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the .OBJDIR
+ for the current directory. The current directory may
+ be read only. MAKEOBJDIRPREFIX can be provided only in
+ the environment or via the -M flag of build.sh; it
+ cannot usefully be set inside a Makefile, including
+ mk.conf or ${MAKECONF}.
"make" variables
- Several variables control the behavior of NetBSD builds. Unless other-
- wise specified, these variables may be set in either the process environ-
- ment or the make(1) configuration file specified by MAKECONF.
+ Several variables control the behavior of NetBSD builds. Unless
+ otherwise specified, these variables may be set in either the process
+ environment or the make(1) configuration file specified by MAKECONF.
BUILDID Identifier for the build. The identifier will be appended to
object directory names, and can be consulted in the make(1)
- configuration file in order to set additional build parame-
- ters, such as compiler flags.
+ configuration file in order to set additional build
+ parameters, such as compiler flags.
- BUILDSEED GCC uses random numbers when compiling C++ code. This vari-
- able seeds the gcc random number generator using the -fran-
- dom-seed flag with this value. By default, it is set to
- NetBSD-(majorversion). Using a fixed value causes C++ bina-
- ries to be the same when built from the same sources, result-
- ing in identical (reproducible) builds. Additional informa-
- tion is available in the GCC documentation of -frandom-seed.
-
- DESTDIR Directory to contain the built NetBSD system. If set, spe-
- cial options are passed to the compilation tools to prevent
- their default use of the host system's /usr/include,
+ BUILDSEED GCC uses random numbers when compiling C++ code. This
+ variable seeds the gcc random number generator using the
+ -frandom-seed flag with this value. By default, it is set to
+ NetBSD-(majorversion). Using a fixed value causes C++
+ binaries to be the same when built from the same sources,
+ resulting in identical (reproducible) builds. Additional
+ information is available in the GCC documentation of
+ -frandom-seed.
+
+ DESTDIR Directory to contain the built NetBSD system. If set,
+ special options are passed to the compilation tools to
+ prevent their default use of the host system's /usr/include,
/usr/lib, and so forth. This pathname must be an absolute
path, and should not end with a slash (/) character. (For
installation into the system's root directory, set DESTDIR to
an empty string, not to ``/''). The directory must reside on
a file system which supports long file names and hard links.
- Default: Empty string if USETOOLS is ``yes''; unset other-
- wise.
+ Default: Empty string if USETOOLS is ``yes''; unset
+ otherwise.
Note: build.sh will provide a default of destdir.MACHINE (in
the top-level .OBJDIR) unless run in `expert' mode.
@@ -184,8 +186,8 @@ CONFIGURATION
are shown.
1 Brief messages are shown describing what is being done,
- but the actual commands executed by make(1) are not dis-
- played.
+ but the actual commands executed by make(1) are not
+ displayed.
2 Descriptive messages are shown as above (prefixed with a
`#'), and ordinary commands performed by make(1) are
@@ -201,16 +203,17 @@ CONFIGURATION
Default: 2
- MKCATPAGES Can be set to ``yes'' or ``no''. Indicates whether prefor-
- matted plaintext manual pages will be created during a build.
+ MKCATPAGES Can be set to ``yes'' or ``no''. Indicates whether
+ preformatted plaintext manual pages will be created during a
+ build.
Default: ``no''
- MKCRYPTO Can be set to ``yes'' or ``no''. Indicates whether crypto-
- graphic code will be included in a build; provided for the
- benefit of countries that do not allow strong cryptography.
- Will not affect use of the standard low-security password
- encryption system, crypt(3).
+ MKCRYPTO Can be set to ``yes'' or ``no''. Indicates whether
+ cryptographic code will be included in a build; provided for
+ the benefit of countries that do not allow strong
+ cryptography. Will not affect use of the standard low-
+ security password encryption system, crypt(3).
Default: ``yes''
@@ -220,8 +223,8 @@ CONFIGURATION
Default: ``yes''
- MKHTML Can be set to ``yes'' or ``no''. Indicates whether prefor-
- matted HTML manual pages will be built and installed
+ MKHTML Can be set to ``yes'' or ``no''. Indicates whether
+ preformatted HTML manual pages will be built and installed
Default: ``yes''
@@ -280,8 +283,8 @@ CONFIGURATION
build. If set to ``no'', the entire built system will be
statically linked.
- Default: Platform dependent. As of this writing, all plat-
- forms except sh3 default to ``yes''.
+ Default: Platform dependent. As of this writing, all
+ platforms except sh3 default to ``yes''.
MKPICINSTALL
Can be set to ``yes'' or ``no''. Indicates whether the ar(1)
@@ -314,14 +317,14 @@ CONFIGURATION
MKSTRIPIDENT
Can be set to ``yes'' or ``no''. Indicates whether RCS IDs,
- for use with ident(1), should be stripped from program bina-
- ries and shared libraries.
+ for use with ident(1), should be stripped from program
+ binaries and shared libraries.
Default: ``no''
MKUNPRIVED Can be set to ``yes'' or ``no''. Indicates whether an
- unprivileged install will occur. The user, group, permis-
- sions, and file flags, will not be set on the installed
+ unprivileged install will occur. The user, group,
+ permissions, and file flags, will not be set on the installed
items; instead the information will be appended to a file
called METALOG in DESTDIR. The contents of METALOG are used
during the generation of the distribution tar files to ensure
@@ -344,11 +347,11 @@ CONFIGURATION
TOOLDIR Directory to hold the host tools, once built. If specified,
must be an absolute path. This directory should be unique to
- a given host system and NetBSD source tree. (However, multi-
- ple targets may share the same TOOLDIR; the target-dependent
- files have unique names.) If unset, a default based on the
- uname(1) information of the host platform will be created in
- the .OBJDIR of src.
+ a given host system and NetBSD source tree. (However,
+ multiple targets may share the same TOOLDIR; the target-
+ dependent files have unique names.) If unset, a default
+ based on the uname(1) information of the host platform will
+ be created in the .OBJDIR of src.
Default: Unset.
@@ -363,12 +366,12 @@ CONFIGURATION
specific for that tool.
never Do not use the tools from TOOLDIR, even when building
- native tool components. This is similar to the tradi-
- tional NetBSD build method, but does not verify that
- the compilation tools in use are up-to-date enough in
- order to build the tree successfully. This may cause
- build or runtime problems when building the whole
- NetBSD source tree.
+ native tool components. This is similar to the
+ traditional NetBSD build method, but does not verify
+ that the compilation tools in use are up-to-date
+ enough in order to build the tree successfully. This
+ may cause build or runtime problems when building the
+ whole NetBSD source tree.
Default: ``yes'', unless TOOLCHAIN_MISSING is set to ``yes''.
@@ -406,10 +409,10 @@ CONFIGURATION
If using build.sh, the default is ``yes''. This may be
set back to ``no'' by giving build.sh the -o option.
- MKUPDATE Can be set to ``yes'' or ``no''. If set, then in addi-
- tion to the effects described for MKUPDATE=yes above,
- this implies the effects of NOCLEANDIR (i.e., ``make
- cleandir'' is avoided).
+ MKUPDATE Can be set to ``yes'' or ``no''. If set, then in
+ addition to the effects described for MKUPDATE=yes
+ above, this implies the effects of NOCLEANDIR (i.e.,
+ ``make cleandir'' is avoided).
Default: ``no''
@@ -466,11 +469,11 @@ BUILDING
use .WAIT or have explicit dependencies as necessary to
enforce build ordering.
- -m dir Specify the default directory for searching for system Make-
- file segments, mainly the <bsd.*.mk> files. When building any
- full NetBSD source tree, this should be set to the
- ``share/mk'' directory in the source tree. This is set auto-
- matically when building from the top level, or when using
+ -m dir Specify the default directory for searching for system
+ Makefile segments, mainly the <bsd.*.mk> files. When building
+ any full NetBSD source tree, this should be set to the
+ ``share/mk'' directory in the source tree. This is set
+ automatically when building from the top level, or when using
build.sh.
-n Display the commands that would have been executed, but do not
@@ -480,9 +483,9 @@ BUILDING
-V var Print make(1)'s idea of the value of var. Does not build any
targets.
- var=value Set the variable var to value, overriding any setting speci-
- fied by the process environment, the MAKECONF configuration
- file, or the system Makefile segments.
+ var=value Set the variable var to value, overriding any setting
+ specified by the process environment, the MAKECONF
+ configuration file, or the system Makefile segments.
"make" targets
These default targets may be built by running make(1) in any subtree of
@@ -544,8 +547,8 @@ BUILDING
installworld Install the distribution from DESTDIR to INSTALLWORLDDIR,
which defaults to the root directory. Ensures that
- INSTALLWORLDDIR is not the root directory if cross compil-
- ing.
+ INSTALLWORLDDIR is not the root directory if cross
+ compiling.
The INSTALLSETS environment variable may be set to a space-
separated list of distribution sets to be installed. By
@@ -584,24 +587,25 @@ BUILDING
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 installa-
- tion program, which can be used to install or upgrade a
- NetBSD system. Bootable CD-ROMs also contain tools that
- may be useful in repairing a damaged NetBSD installation.
+ will automatically run the sysinst(8) menu-based
+ installation program, which can be used to install or
+ upgrade a NetBSD system. Bootable CD-ROMs also contain
+ tools that may be useful in repairing a damaged NetBSD
+ installation.
Before ``make iso-image'' is attempted, RELEASEDIR must be
populated by ``make release'' or equivalent.
Note that other, smaller, CD-ROM images may be created in
- the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc-
- tory by ``make release''. These smaller images usually
- contain the same tools as the larger images in
+ 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.
Note that the mac68k port still uses an older method of
- creating CD-ROM images. This requires the mkisofs(1) util-
- ity, which is not part of NetBSD, but which can be
+ creating CD-ROM images. This requires the mkisofs(1)
+ utility, which is not part of NetBSD, but which can be
installed from pkgsrc/sysutils/cdrtools.
iso-image-source
@@ -611,25 +615,26 @@ BUILDING
level directories for the machine type and source.
For most machine types, the CD-ROM will be bootable, and
- will automatically run the sysinst(8) menu-based installa-
- tion program, which can be used to install or upgrade a
- NetBSD system. Bootable CD-ROMs also contain tools that
- may be useful in repairing a damaged NetBSD installation.
+ will automatically run the sysinst(8) menu-based
+ installation program, which can be used to install or
+ upgrade a NetBSD system. Bootable CD-ROMs also contain
+ tools that may be useful in repairing a damaged NetBSD
+ installation.
Before ``make iso-image-source'' is attempted, RELEASEDIR
- must be populated by ``make sourcesets release'' or equiva-
- lent.
+ must be populated by ``make sourcesets release'' or
+ equivalent.
Note that other, smaller, CD-ROM images may be created in
- the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc-
- tory by ``make release''. These smaller images usually
- contain the same tools as the larger images in
+ 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.
Note that the mac68k port still uses an older method of
- creating CD-ROM images. This requires the mkisofs(1) util-
- ity, which is not part of NetBSD, but which can be
+ creating CD-ROM images. This requires the mkisofs(1)
+ utility, which is not part of NetBSD, but which can be
installed from pkgsrc/sysutils/cdrtools.
install-image
@@ -653,15 +658,15 @@ BUILDING
install-image'' relies on information in DESTDIR/METALOG.
live-image Create NetBSD live images in the
- RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage direc-
- tory. 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 disklabel,
- bootloaders, etc.
-
- The live image is suitable for use as a disk image in vir-
- tual machine environments such as QEMU, and also useful to
- boot NetBSD from a USB flash memory stick on a real
+ RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage
+ 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
+ disklabel, bootloaders, etc.
+
+ The live image is suitable for use as a disk image in
+ virtual machine environments such as QEMU, and also useful
+ to boot NetBSD from a USB flash memory stick on a real
machine, without the need for installation.
Before ``make live-image'' is attempted, RELEASEDIR must be
@@ -672,15 +677,15 @@ BUILDING
regression-tests
Can only be run after building the regression tests in the
directory ``regress''. Runs those compiled regression
- tests on the local host. Note that most tests are now man-
- aged instead using atf(7); this target should probably run
- those as well but currently does not.
+ tests on the local host. Note that most tests are now
+ managed instead using atf(7); this target should probably
+ run those as well but currently does not.
The "build.sh" script
This script file is a shell script designed to build the entire NetBSD
- system on any host with a suitable modern shell and some common utili-
- ties. The required shell features are described under the HOST_SH vari-
- able.
+ system on any host with a suitable modern shell and some common
+ utilities. The required shell features are described under the HOST_SH
+ variable.
If a host system's default shell does support the required features, then
we suggest that you explicitly specify a suitable shell using a command
@@ -705,8 +710,8 @@ BUILDING
All cross-compile builds, and most native builds, of the entire system
should make use of build.sh rather than just running ``make''. This way,
- the make(1) program will be bootstrapped properly, in case the host sys-
- tem has an older or incompatible ``make'' program.
+ the make(1) program will be bootstrapped properly, in case the host
+ system has an older or incompatible ``make'' program.
When compiling the entire system via build.sh, many make(1) variables are
set for you in order to help encapsulate the build process. In the list
@@ -727,17 +732,17 @@ BUILDING
release Build a full release as per ``make release''. This command
first runs the distribution operation.
- makewrapper Create the nbmake-MACHINE wrapper. This operation is auto-
- matically performed for any of the other operations.
+ makewrapper Create the nbmake-MACHINE wrapper. This operation is
+ automatically performed for any of the other operations.
cleandir Perform ``make cleandir''.
obj Perform ``make obj''.
- tools Build and install the host tools from src/tools. This com-
- mand will first run ``make obj'' and ``make cleandir'' in
- the tools subdirectory unless the -o or -u options (respec-
- tively) are given.
+ tools Build and install the host tools from src/tools. This
+ command will first run ``make obj'' and ``make cleandir''
+ in the tools subdirectory unless the -o or -u options
+ (respectively) are given.
install=idir Install the contents of DESTDIR to idir, using ``make
installworld''. Note that files that are part of the
@@ -766,8 +771,8 @@ BUILDING
Install a gzip(1)ed copy of the kernel previously built by
kernel=kconf into
RELEASEDIR/RELEASEMACHINEDIR/binary/kernel, usually as
- netbsd-kconf.gz, although the ``netbsd'' prefix is deter-
- mined from the ``config'' directives in kconf.
+ netbsd-kconf.gz, although the ``netbsd'' prefix is
+ determined from the ``config'' directives in kconf.
sets Perform ``make sets''.
@@ -797,9 +802,9 @@ BUILDING
``nbmake-MACHINE-BUILDID''.
-C cdextras
- Append cdextras to the CDEXTRA variable, which is a space-sepa-
- rated list of files or directories that will be added to the
- CD-ROM image that may be create by the ``iso-image'' or
+ Append cdextras to the CDEXTRA variable, which is a space-
+ separated list of files or directories that will be added to
+ the CD-ROM image that may be create by the ``iso-image'' or
``iso-image-source'' operations. Files will be added to the
root of the CD-ROM image, whereas directories will be copied
recursively. If relative paths are specified, they will be
@@ -807,14 +812,14 @@ BUILDING
may be specified via multiple -C options, or via a single
option whose argument contains multiple space-separated paths.
- -D dest Set the value of DESTDIR to dest. If a relative path is speci-
- fied, it will be converted to an absolute path before being
- used.
+ -D dest Set the value of DESTDIR to dest. If a relative path is
+ specified, it will be converted to an absolute path before
+ being used.
-E Set `expert' mode. This overrides various sanity checks, and
allows: DESTDIR does not have to be set to a non-root path for
- builds, and MKUNPRIVED=yes does not have to be set when build-
- ing as a non-root user.
+ builds, and MKUNPRIVED=yes does not have to be set when
+ building as a non-root user.
Note: It is highly recommended that you know what you are doing
when you use this option.
@@ -823,12 +828,13 @@ BUILDING
-j njob Run up to njob make(1) subjobs in parallel; passed through to
make(1). If you see failures for reasons other than running
- out of memory while using build.sh with -j, please save com-
- plete build logs so the failures can be analyzed.
+ out of memory while using build.sh with -j, please save
+ complete build logs so the failures can be analyzed.
- To achieve the fastest builds, -j values between (1 + the num-
- ber of CPUs) and (2 * the number of CPUs) are recommended. Use
- lower values on machines with limited memory or I/O bandwidth.
+ To achieve the fastest builds, -j values between (1 + the
+ number of CPUs) and (2 * the number of CPUs) are recommended.
+ Use lower values on machines with limited memory or I/O
+ bandwidth.
-M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. See ``-O
-obj'' for more information.
@@ -839,12 +845,12 @@ BUILDING
/usr/obj/usr/src/usr.bin, and so forth.
If a relative path is specified, it will be converted to an
- absolute path before being used. build.sh imposes the restric-
- tion that the argument to the -M option must not begin with a
- ``$'' (dollar sign) character; otherwise it would be too diffi-
- cult to determine whether the value is an absolute or a rela-
- tive path. If the directory does not already exist, build.sh
- will create it.
+ absolute path before being used. build.sh imposes the
+ restriction that the argument to the -M option must not begin
+ with a ``$'' (dollar sign) character; otherwise it would be too
+ difficult to determine whether the value is an absolute or a
+ 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
@@ -888,9 +894,9 @@ BUILDING
and so forth.
If a relative path is specified, it will be converted to an
- absolute path before being used. build.sh imposes the restric-
- tion that the argument to the -O option must not contain a
- ``$'' (dollar sign) character. If the directory does not
+ absolute path before being used. build.sh imposes the
+ restriction that the argument to the -O option must not contain
+ a ``$'' (dollar sign) character. If the directory does not
already exist, build.sh will create it.
In normal use, exactly one of the -M or -O options should be
@@ -916,10 +922,10 @@ BUILDING
-S seed Change the value of BUILDSEED to seed. This should rarely be
necessary.
- -T tools Set the value of TOOLDIR to tools. If a relative path is spec-
- ified, it will be converted to an absolute path before being
- used. If set, the bootstrap ``make'' will only be rebuilt if
- the source files for make(1) have changed.
+ -T tools Set the value of TOOLDIR to tools. If a relative path is
+ specified, it will be converted to an absolute path before
+ being used. If set, the bootstrap ``make'' will only be
+ rebuilt if the source files for make(1) have changed.
-U Set MKUNPRIVED=yes.
@@ -930,8 +936,8 @@ BUILDING
propagated to the nbmake wrapper.
-w wrapper
- Create the nbmake wrapper script (see below) in a custom loca-
- tion, specified by wrapper. This allows, for instance, to
+ Create the nbmake wrapper script (see below) in a custom
+ location, specified by wrapper. This allows, for instance, to
place the wrapper in PATH automatically. Note that wrapper is
the full name of the file, not just a directory name. If a
relative path is specified, it will be converted to an absolute
@@ -953,10 +959,10 @@ BUILDING
subtrees on a cross-compile host.
nbmake-MACHINE can be invoked in lieu of make(1), and will instead call
- the up-to-date version of ``nbmake'' installed into TOOLDIR/bin with sev-
- eral key variables pre-set, including MACHINE, MACHINE_ARCH, and TOOLDIR.
- nbmake-MACHINE will also set variables specified with -V, and unset vari-
- ables specified with -Z.
+ the up-to-date version of ``nbmake'' installed into TOOLDIR/bin with
+ several key variables pre-set, including MACHINE, MACHINE_ARCH, and
+ TOOLDIR. nbmake-MACHINE will also set variables specified with -V, and
+ unset variables specified with -Z.
This script can be symlinked into a directory listed in PATH, or called
with an absolute path.
@@ -975,9 +981,9 @@ EXAMPLES
3. # ./build.sh [options] -U install=/
As root, install to / the distribution that was built by example 2.
- Even though this is run as root, -U is required so that the permis-
- sions stored in DESTDIR/METALOG are correctly applied to the files
- as they're copied to /.
+ Even though this is run as root, -U is required so that the
+ permissions stored in DESTDIR/METALOG are correctly applied to the
+ files as they're copied to /.
4. % ./build.sh [options] -U -u release
@@ -1002,4 +1008,4 @@ 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 September 19, 2012 NetBSD
+NetBSD November 8, 2012 NetBSD
Index: src/Makefile
diff -u src/Makefile:1.289.2.4 src/Makefile:1.289.2.5
--- src/Makefile:1.289.2.4 Wed Jan 16 05:25:52 2013
+++ src/Makefile Thu May 22 13:23:26 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.289.2.4 2013/01/16 05:25:52 yamt Exp $
+# $NetBSD: Makefile,v 1.289.2.5 2014/05/22 13:23:26 yamt Exp $
#
# This is the top-level makefile for building NetBSD. For an outline of
@@ -139,7 +139,8 @@ _SRC_TOP_OBJ_=
#
_SUBDIR= tools lib include gnu external crypto/external bin games
_SUBDIR+= libexec sbin usr.bin
-_SUBDIR+= usr.sbin share rescue sys etc tests compat .WAIT distrib regress
+_SUBDIR+= usr.sbin share sys etc tests compat
+_SUBDIR+= .WAIT rescue .WAIT distrib regress
.for dir in ${_SUBDIR}
.if "${dir}" == ".WAIT" \
@@ -204,7 +205,7 @@ BUILD_CC_LIB_BASEDIR= gnu/lib
BUILD_CC_LIB_BASETARGET= gnu-lib
.else
LIBGCC_EXT=
-BUILD_CC_LIB_BASEDIR= external/gpl3/gcc/lib
+BUILD_CC_LIB_BASEDIR= external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib
BUILD_CC_LIB_BASETARGET= external-gpl3-gcc-lib
.endif
.endif
@@ -523,7 +524,6 @@ install-${dir}: .PHONY
dependall-distrib depend-distrib all-distrib: .PHONY
@true
-.include <bsd.sys.mk>
.include <bsd.obj.mk>
.include <bsd.kernobj.mk>
.include <bsd.subdir.mk>
Index: src/UPDATING
diff -u src/UPDATING:1.229.2.3 src/UPDATING:1.229.2.4
--- src/UPDATING:1.229.2.3 Tue Oct 30 18:46:04 2012
+++ src/UPDATING Thu May 22 13:23:26 2014
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.229.2.3 2012/10/30 18:46:04 yamt Exp $
+$NetBSD: UPDATING,v 1.229.2.4 2014/05/22 13:23:26 yamt Exp $
This file (UPDATING) is intended to be a brief reference to recent
changes that might cause problems in the build process, and a guide for
@@ -16,6 +16,50 @@ See also: BUILDING, build.sh, Makefile.
Recent changes:
^^^^^^^^^^^^^^^
+20140131:
+ The new compiler_rt/libc integration moved a few things. It is strongly
+ advised to do a clean build. At least lib/libc, the compat version(s)
+ of libc, libkern, rump and the kernels need to be cleaned.
+
+20131227:
+ 1. The new ntpd runs in a restricted mode to prevent amplification
+ attacks. If you need ntpdc to work you need to explicitly enable
+ mode7 in your config file. Make sure you put the necessary restrict
+ statements to avoid being exposed.
+ 2. strncat has moved from lib/libc to common/lib/libc; you might need
+ to make clean in libc
+
+20131129:
+ The GMP sources were updated, and builds will likely fail without
+ cleaning their build trees for both tools and in-tree, like below.
+
+20131128:
+ The MPC and MPFR sources were updated, and builds may require their
+ tools and in-tree directories cleaned for successful updates.
+
+20130605:
+ The kernel option FAST_IPSEC no longer exists, it's been renamed
+ to IPSEC (and the older IPSEC version removed).
+
+20130605:
+ Previous freetype installations eroneously installed private
+ header files. If you are building against a non-empty $DESTDIR,
+ please remove ${DESTDIR}//usr/X11R7/include/freetype2/freetype/.
+
+20130531:
+ The xdm update may cause build failure due to xdm.man being
+ in the obj tree. Make sure to ensure any like this:
+ nbmake: nbmake: don't know how to make xdm.man. Stop
+ is fixed by deleting the xdm.man in the obj tree.
+
+20130530:
+ Updates of many xsrc packages will leave old .pc files around.
+ Best to clean out the xsrc objdir entirely before rebuilds.
+
+20130301:
+ The removal of netiso requires manual removal of /usr/include/netiso
+ prior to the build and make cleandir in /usr/src/usr.bin/{ktruss,kdump}
+
20120726:
The update of OpenSSL requires cleaning both the OpenSSL build
directory and DESTDIR. *Even non-update builds require cleaning
Index: src/build.sh
diff -u src/build.sh:1.251.2.4 src/build.sh:1.251.2.5
--- src/build.sh:1.251.2.4 Wed Jan 23 00:04:04 2013
+++ src/build.sh Thu May 22 13:23:26 2014
@@ -1,5 +1,5 @@
#! /usr/bin/env sh
-# $NetBSD: build.sh,v 1.251.2.4 2013/01/23 00:04:04 yamt Exp $
+# $NetBSD: build.sh,v 1.251.2.5 2014/05/22 13:23:26 yamt Exp $
#
# Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -508,6 +508,7 @@ initdefaults()
do_iso_image_source=false
do_live_image=false
do_install_image=false
+ do_disk_image=false
do_params=false
do_rump=false
@@ -579,16 +580,32 @@ MACHINE=arc MACHINE_ARCH=mipsel DEFAULT
MACHINE=atari MACHINE_ARCH=m68k
MACHINE=bebox MACHINE_ARCH=powerpc
MACHINE=cats MACHINE_ARCH=arm DEFAULT
-MACHINE=cats MACHINE_ARCH=earm
+MACHINE=cats MACHINE_ARCH=earmv4 ALIAS=ecats
MACHINE=cesfic MACHINE_ARCH=m68k
MACHINE=cobalt MACHINE_ARCH=mips64el ALIAS=cobalt64
MACHINE=cobalt MACHINE_ARCH=mipsel DEFAULT
MACHINE=dreamcast MACHINE_ARCH=sh3el
MACHINE=emips MACHINE_ARCH=mipseb
+MACHINE=epoc32 MACHINE_ARCH=arm
MACHINE=evbarm MACHINE_ARCH=arm ALIAS=evbarm-el DEFAULT
MACHINE=evbarm MACHINE_ARCH=armeb ALIAS=evbarm-eb
MACHINE=evbarm MACHINE_ARCH=earm ALIAS=evbearm-el
MACHINE=evbarm MACHINE_ARCH=earmeb ALIAS=evbearm-eb
+MACHINE=evbarm MACHINE_ARCH=earmhf ALIAS=evbearmhf-el
+MACHINE=evbarm MACHINE_ARCH=earmhfeb ALIAS=evbearmhf-eb
+MACHINE=evbarm MACHINE_ARCH=earmv4 ALIAS=evbearmv4-el
+MACHINE=evbarm MACHINE_ARCH=earmv4eb ALIAS=evbearmv4-eb
+MACHINE=evbarm MACHINE_ARCH=earmv5 ALIAS=evbearmv5-el
+MACHINE=evbarm MACHINE_ARCH=earmv5eb ALIAS=evbearmv5-eb
+MACHINE=evbarm MACHINE_ARCH=earmv6 ALIAS=evbearmv6-el
+MACHINE=evbarm MACHINE_ARCH=earmv6hf ALIAS=evbearmv6hf-el
+MACHINE=evbarm MACHINE_ARCH=earmv6eb ALIAS=evbearmv6-eb
+MACHINE=evbarm MACHINE_ARCH=earmv6hfeb ALIAS=evbearmv6hf-eb
+MACHINE=evbarm MACHINE_ARCH=earmv7 ALIAS=evbearmv7-el
+MACHINE=evbarm MACHINE_ARCH=earmv7eb ALIAS=evbearmv7-eb
+MACHINE=evbarm MACHINE_ARCH=earmv7hf ALIAS=evbearmv7hf-el
+MACHINE=evbarm MACHINE_ARCH=earmv7hfeb ALIAS=evbearmv7hf-eb
+MACHINE=evbcf MACHINE_ARCH=coldfire
MACHINE=evbmips MACHINE_ARCH= NO_DEFAULT
MACHINE=evbmips MACHINE_ARCH=mips64eb ALIAS=evbmips64-eb
MACHINE=evbmips MACHINE_ARCH=mips64el ALIAS=evbmips64-el
@@ -601,15 +618,16 @@ MACHINE=evbsh3 MACHINE_ARCH=sh3eb ALIAS
MACHINE=evbsh3 MACHINE_ARCH=sh3el ALIAS=evbsh3-el
MACHINE=ews4800mips MACHINE_ARCH=mipseb
MACHINE=hp300 MACHINE_ARCH=m68k
-MACHINE=hp700 MACHINE_ARCH=hppa
-MACHINE=hpcarm MACHINE_ARCH=arm
+MACHINE=hppa MACHINE_ARCH=hppa
+MACHINE=hpcarm MACHINE_ARCH=arm DEFAULT
+MACHINE=hpcarm MACHINE_ARCH=earm ALIAS=hpcearm
MACHINE=hpcmips MACHINE_ARCH=mipsel
MACHINE=hpcsh MACHINE_ARCH=sh3el
MACHINE=i386 MACHINE_ARCH=i386
MACHINE=ia64 MACHINE_ARCH=ia64
MACHINE=ibmnws MACHINE_ARCH=powerpc
MACHINE=iyonix MACHINE_ARCH=arm DEFAULT
-MACHINE=iyonix MACHINE_ARCH=earm
+MACHINE=iyonix MACHINE_ARCH=earm ALIAS=eiyonix
MACHINE=landisk MACHINE_ARCH=sh3el
MACHINE=luna68k MACHINE_ARCH=m68k
MACHINE=mac68k MACHINE_ARCH=m68k
@@ -620,12 +638,13 @@ MACHINE=mmeye MACHINE_ARCH=sh3eb
MACHINE=mvme68k MACHINE_ARCH=m68k
MACHINE=mvmeppc MACHINE_ARCH=powerpc
MACHINE=netwinder MACHINE_ARCH=arm DEFAULT
-MACHINE=netwinder MACHINE_ARCH=earm
+MACHINE=netwinder MACHINE_ARCH=earmv4 ALIAS=enetwinder
MACHINE=news68k MACHINE_ARCH=m68k
MACHINE=newsmips MACHINE_ARCH=mipseb
MACHINE=next68k MACHINE_ARCH=m68k
MACHINE=ofppc MACHINE_ARCH=powerpc DEFAULT
MACHINE=ofppc MACHINE_ARCH=powerpc64 ALIAS=ofppc64
+MACHINE=playstation2 MACHINE_ARCH=mipsel
MACHINE=pmax MACHINE_ARCH=mips64el ALIAS=pmax64
MACHINE=pmax MACHINE_ARCH=mipsel DEFAULT
MACHINE=prep MACHINE_ARCH=powerpc
@@ -639,7 +658,7 @@ MACHINE=sbmips MACHINE_ARCH=mipsel ALIA
MACHINE=sgimips MACHINE_ARCH=mips64eb ALIAS=sgimips64
MACHINE=sgimips MACHINE_ARCH=mipseb DEFAULT
MACHINE=shark MACHINE_ARCH=arm DEFAULT
-MACHINE=shark MACHINE_ARCH=earm
+MACHINE=shark MACHINE_ARCH=earmv4 ALIAS=eshark
MACHINE=sparc MACHINE_ARCH=sparc
MACHINE=sparc64 MACHINE_ARCH=sparc64
MACHINE=sun2 MACHINE_ARCH=m68000
@@ -647,7 +666,7 @@ MACHINE=sun3 MACHINE_ARCH=m68k
MACHINE=vax MACHINE_ARCH=vax
MACHINE=x68k MACHINE_ARCH=m68k
MACHINE=zaurus MACHINE_ARCH=arm DEFAULT
-MACHINE=zaurus MACHINE_ARCH=earm
+MACHINE=zaurus MACHINE_ARCH=earm ALIAS=ezaurus
'
# getarch -- find the default MACHINE_ARCH for a MACHINE,
@@ -903,6 +922,8 @@ Usage: ${progname} [-EhnorUuxy] [-a arch
install=idir Run "make installworld" to \`idir' to install all sets
except \`etc'. Useful after "distribution" or "release"
kernel=conf Build kernel with config file \`conf'
+ kernel.gdb=conf Build kernel (including netbsd.gdb) with config
+ file \`conf'
releasekernel=conf Install kernel built by kernel=conf to RELEASEDIR.
installmodules=idir Run "make installmodules" to \`idir' to install all
kernel modules.
@@ -920,6 +941,8 @@ Usage: ${progname} [-EhnorUuxy] [-a arch
RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage.
install-image Create bootable installation image in
RELEASEDIR/RELEASEMACHINEDIR/installation/installimage.
+ disk-image=target Creae bootable disk image in
+ RELEASEDIR/RELEASEMACHINEDIR/binary/gzimg/target.img.gz.
params Display various make(1) parameters.
Options:
@@ -1199,13 +1222,21 @@ parseoptions()
op=install_image # used as part of a variable name
;;
- kernel=*|releasekernel=*)
+ kernel=*|releasekernel=*|kernel.gdb=*)
arg=${op#*=}
op=${op%%=*}
[ -n "${arg}" ] ||
bomb "Must supply a kernel name with \`${op}=...'"
;;
+ disk-image=*)
+ arg=${op#*=}
+ op=disk_image
+ [ -n "${arg}" ] ||
+ bomb "Must supply a target name with \`${op}=...'"
+
+ ;;
+
modules)
op=modules
;;
@@ -1254,14 +1285,6 @@ parseoptions()
#
sanitycheck()
{
- # Non-root should always use either the -U or -E flag.
- #
- if ! ${do_expertmode} && \
- [ "$id_u" -ne 0 ] && \
- [ "${MKUNPRIVED}" = "no" ] ; then
- bomb "-U or -E must be set for build as an unprivileged user."
- fi
-
# Install as non-root is a bad idea.
#
if ${do_install} && [ "$id_u" -ne 0 ] ; then
@@ -1421,7 +1444,7 @@ print_tooldir_make()
# 1. build a new version of nbmake in a temporary directory;
# 2. use the temporary nbmake to create the top level obj directory;
# 3. use $(getmakevar TOOLDIR) with the temporary nbmake to
-# get the corect value of TOOLDIR;
+# get the correct value of TOOLDIR;
# 4. move the temporary nbmake to ${TOOLDIR}/bin/nbmake.
#
# However, people don't like building nbmake unnecessarily if their
@@ -1455,7 +1478,8 @@ rebuildmake()
${runcmd} env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" \
CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \
${HOST_SH} "${TOP}/tools/make/configure" ||
- bomb "Configure of ${toolprefix}make failed"
+ ( cp ${tmpdir}/config.log ${tmpdir}-config.log
+ bomb "Configure of ${toolprefix}make failed, see ${tmpdir}-config.log for details" )
${runcmd} ${HOST_SH} buildmake.sh ||
bomb "Build of ${toolprefix}make failed"
make="${tmpdir}/${toolprefix}make"
@@ -1486,6 +1510,22 @@ validatemakeparams()
statusmsg2 "MAKECONF file:" "${MAKECONF} (File not found)"
fi
+ # Normalise MKOBJDIRS, MKUNPRIVED, and MKUPDATE.
+ # These may be set as build.sh options or in "mk.conf".
+ # Don't export them as they're only used for tests in build.sh.
+ #
+ MKOBJDIRS=$(getmakevar MKOBJDIRS)
+ MKUNPRIVED=$(getmakevar MKUNPRIVED)
+ MKUPDATE=$(getmakevar MKUPDATE)
+
+ # Non-root should always use either the -U or -E flag.
+ #
+ if ! ${do_expertmode} && \
+ [ "$id_u" -ne 0 ] && \
+ [ "${MKUNPRIVED}" = "no" ] ; then
+ bomb "-U or -E must be set for build as an unprivileged user."
+ fi
+
if [ "${runcmd}" = "echo" ]; then
TOOLCHAIN_MISSING=no
EXTERNAL_TOOLCHAIN=""
@@ -1507,14 +1547,6 @@ validatemakeparams()
exit 1
fi
- # Normalise MKOBJDIRS, MKUNPRIVED, and MKUPDATE
- # These may be set as build.sh options or in "mk.conf".
- # Don't export them as they're only used for tests in build.sh.
- #
- MKOBJDIRS=$(getmakevar MKOBJDIRS)
- MKUNPRIVED=$(getmakevar MKUNPRIVED)
- MKUPDATE=$(getmakevar MKUPDATE)
-
if [ "${MKOBJDIRS}" != "no" ]; then
# Create the top-level object directory.
#
@@ -1716,7 +1748,7 @@ createmakewrapper()
eval cat <<EOF ${makewrapout}
#! ${HOST_SH}
# Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from: \$NetBSD: build.sh,v 1.251.2.4 2013/01/23 00:04:04 yamt Exp $
+# Generated from: \$NetBSD: build.sh,v 1.251.2.5 2014/05/22 13:23:26 yamt Exp $
# with these arguments: ${_args}
#
@@ -1796,6 +1828,18 @@ getkernelconf()
kernelbuildpath="${KERNOBJDIR}/${kernelconfname}"
}
+diskimage()
+{
+ ARG="$(echo $1 | tr '[:lower:]' '[:upper:]')"
+ [ -f "${DESTDIR}/etc/mtree/set.base" ] ||
+ bomb "The release binaries must be built first"
+ kerneldir="${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel"
+ kernel="${kerneldir}/netbsd-${ARG}.gz"
+ [ -f "${kernel}" ] ||
+ bomb "The kernel ${kernel} must be built first"
+ make_in_dir "${NETBSDSRCDIR}/etc" "smp_${1}"
+}
+
buildkernel()
{
if ! ${do_tools} && ! ${buildkernelwarned:-false}; then
@@ -1819,7 +1863,7 @@ buildkernel()
[ -x "${TOOLDIR}/bin/${toolprefix}config" ] \
|| bomb "${TOOLDIR}/bin/${toolprefix}config does not exist. You need to \"$0 tools\" first."
${runcmd} "${TOOLDIR}/bin/${toolprefix}config" -b "${kernelbuildpath}" \
- -s "${TOP}/sys" "${kernelconfpath}" ||
+ ${ksymopts} -s "${TOP}/sys" "${kernelconfpath}" ||
bomb "${toolprefix}config failed for ${kernelconf}"
make_in_dir "${kernelbuildpath}" depend
make_in_dir "${kernelbuildpath}" all
@@ -1932,6 +1976,7 @@ dorump()
[ "${1}" != "rumptest" ] && bomb 'build.sh rump not yet functional. ' \
'did you mean "rumptest"?'
+ export RUMPKERN_ONLY=1
# create obj and distrib dirs
if [ "${MKOBJDIRS}" != "no" ]; then
make_in_dir "${NETBSDSRCDIR}/etc/mtree" obj
@@ -1972,7 +2017,7 @@ dorump()
/undefined reference/ &&
!/more undefined references.*follow/{
if (match($NF,
- "`(rumpuser_|__" quirks ")") == 0)
+ "`(rumpuser_|rumpcomp_|__" quirks ")") == 0)
fails[NR] = $0
}
/cannot find -l/{fails[NR] = $0}
@@ -2057,12 +2102,21 @@ main()
arg=${op#*=}
buildkernel "${arg}"
;;
-
+ kernel.gdb=*)
+ arg=${op#*=}
+ ksymopts="-D DEBUG=-g"
+ buildkernel "${arg}"
+ ;;
releasekernel=*)
arg=${op#*=}
releasekernel "${arg}"
;;
+ disk-image=*)
+ arg=${op#*=}
+ diskimage "${arg}"
+ ;;
+
modules)
buildmodules
;;