History log of /netbsd-current/doc/BUILDING.mdoc
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.150 26-Apr-2024 rillig

BUILDING: fix typo


# 1.149 22-Jul-2023 lukem

BUILDING: list known mk.conf vars. tweak section headers

List known supported and obsolete mk.conf(5) variables,
so that searches in this document at least find them.
This partially reverts my revision 1.144 on 2023-06-12
which completely removed the duplication with mk.conf(5).

Remove quote characters from some section headings;
it makes it harder to search for a section by known name
when rendering in markup variations that use smart quotes.


# 1.148 21-Jul-2023 lukem

BUILDING: clarify environ vs mk.conf behaviour

Document that variables set in the environment or the
nbmake-MACHINE wrapper script don't override variable
assignments in mk.conf(5), and that using ?= in mk.conf
allows environment / nbmake-MACHINE variables to override
mk.conf.

Consistently refer to "nbmake-MACHINE wrapper script".


# 1.147 19-Jul-2023 lukem

BUILDING: consistency fix


# 1.146 18-Jul-2023 lukem

build.sh: use mk.conf (if present) as MAKECONF

Set MAKECONF to mk.conf in the same directory as build.sh
(i.e., the top of the source tree) if mk.conf is present.
This means unprivileged users can benefit from mk.conf(5)
semantics without write privileges to /etc/mk.conf, and
also simplifies per-source-directory configuration.

Fail early if $MAKECONF is empty, since build.sh will fail
anyway after rebuilding nbmake.

Ensure that the computed MAKECONF isn't empty, and then
always set MAKECONF in the makewrapper (nbmake-$MACHINE).

Improve some formatting consistency in BUILDING.mdoc,
(even if BUILDING is generated without markup).


# 1.145 05-Jul-2023 lukem

BUILDING: wording tweaks


# 1.144 11-Jun-2023 lukem

BUILDING: remove duplication from mk.conf(5)

Remove all "make" variables / mk.conf(5) variables already documented
in mk.conf(5). The duplication was a maintenance headache, as I've
experienced over recent weeks getting the build documentation up to
date.

Add notes clarifying that manual page references are to the NetBSD
manual pages, not to the host manual pages, and how to format from
source, or find online at https://man.netbsd.org.

Add explicit links to the mdoc(7) in-tree source for mk.conf(5),
hier(7), and release(7) because those are directly relevant to the host
build information in BUILDING.

Note: We don't normally need these notes for native documentation,
but BUILDING is intended for users on host systems which might not
be NetBSD(-current).

Add missing defaults.


# 1.143 11-Jun-2023 lukem

BUILDING: update from mk.conf(5). reorder

Sync variable entries from mk.conf(5).

Merge the "make variables for full builds" section into the previous.
Having two separate sections and some entries duplicated was confusing
when searching for variables.


# 1.142 11-Jun-2023 lukem

more NBUILDJOBS deprecation

The NBUILDJOBS option was deprecated in 2002;
there's no need to keep warning about it,
remove from params / show-params,
and only document as obsolete.


# 1.141 05-Jun-2023 lukem

BUILDING: editorial

MKX11=yes wants MKINET6=yes

Change the width of the variable lists to 14n (from 15n)
so that when the lists are rendered and then left aligned,
the column is 16 characters (aka 2 tabs) which makes
copypasta to bsd.README easier.


# 1.140 04-Jun-2023 lukem

BUILDING: update from canonical mk.conf(5)

Incorporate content and styles updates for mk.conf entries
from share/man/man5/mk.conf.5, which is the canonical
reference for mk.conf.

Add: BSDOBJDIR, BSDSRCDIR, EXTERNAL_TOOLCHAIN, MKDEBUGKERNEL,
MKDEBUGTOOLS, MKHTML, MKLINKLIB, MKOBJDIRS, TOOLCHAIN_MISSING,
NETBSDSRCDIR

It's for further study as to whether we just replace the
most of subsection "make" variables with a link to mk.conf(5).

Style:
- Add more .de macros per mk.conf.5.
- Order list items alphabetically. When multiple items are present
in a list item, sort within the item first.
- More cross-references.


# 1.139 02-Jun-2023 lukem

build.sh: MAKECONF and mk.conf(5) improvements

Move MAKECONF to the Environment variables section.
Add mk.conf(5) cross-references.
Make Notes more obvious.
Fix mandoc lint.


# 1.138 18-May-2023 lukem

BUILDING: TMPDIR must not be noexec

Describe $TMPDIR as used by build.sh, and
add a note that it can't be mounted noexec.

PR toolchain/44459


# 1.137 16-May-2023 lukem

build.sh, BUILDING: consistency improvements

Consistently use "show", instead of sometimes using "display" or "print".
Fix mdoc markup (even though BUILDING is raw text).
Document help, -P, -?


# 1.136 16-May-2023 lukem

BUILDING: update upstream, regen

doc/BUILDING.mdoc is the upstream for BUILDING, so add recent changes
in the latter to the former, formatting correctly.

Move INSTALLBOOT_UBOOT_PATHS to Environment variables.
Move INSTALLBOOT_BOARDS to "make" variables for full builds.
Add installboot(8) cross-reference.


Revision tags: netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.135 21-Aug-2022 lukem

Deprecate extsrc/, EXTSRCSRCDIR, MKEXTSRC

Remove support for building extsrc/:
1. Makefile: remove do-extsrc target.
2. build.sh: remove options -y and -Y extsrcdir.
3. distrib/sets: remove support for extsrc in various tools
including the options -L ext and -y, and the extsrc sets.
4. doc/BUILDING.mdoc: remove docs for extsrc/, EXTSRCSRCDIR, MKEXTSRC (etc)
5. bsd.own.mk and various Makefiles: remove support for extsrc/,
EXTSRCSRCDIR, MKEXTSRC.

As proposed on tech-kern and tech-userlevel on 2022-01-07
and followed up on 2022-08-21.


# 1.134 28-May-2022 andvar

s/knowlege/knowledge/


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.133 10-Nov-2020 kamil

Reintroduce the support of MKCATPAGES

Requested by <mrg>


# 1.132 08-Nov-2020 kamil

Remove the support for MKCATPAGES

It was optional since 1999 and disabled by default since 2012.

Proposed on tech-userlevel@.


# 1.131 13-Oct-2020 thorpej

Document CPUFLAGS here (it's already documented in share/mk/bsd.README).
This will address the initial concern in PR port-alpha/55545.


# 1.130 12-Oct-2020 uwe

Mention HOST_CFLAGS and HOST_CXXFLAGS.


# 1.129 12-Oct-2020 uwe

If this file is processed with real roff (doc.tmac) tweak things to
make ascii output as close to the mandoc output as possible.
There are only two diffs:
- groff renders em-dash as -- in the NAME section
- mandoc misses "NetBSD" in the "NetBSD System Manager's Manual"
section header


# 1.128 12-Oct-2020 uwe

Bump date and regen for BUILDING.mdoc revision 1.127
that introduced build.sh -c <compiler> option.


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.149 22-Jul-2023 lukem

BUILDING: list known mk.conf vars. tweak section headers

List known supported and obsolete mk.conf(5) variables,
so that searches in this document at least find them.
This partially reverts my revision 1.144 on 2023-06-12
which completely removed the duplication with mk.conf(5).

Remove quote characters from some section headings;
it makes it harder to search for a section by known name
when rendering in markup variations that use smart quotes.


# 1.148 21-Jul-2023 lukem

BUILDING: clarify environ vs mk.conf behaviour

Document that variables set in the environment or the
nbmake-MACHINE wrapper script don't override variable
assignments in mk.conf(5), and that using ?= in mk.conf
allows environment / nbmake-MACHINE variables to override
mk.conf.

Consistently refer to "nbmake-MACHINE wrapper script".


# 1.147 19-Jul-2023 lukem

BUILDING: consistency fix


# 1.146 18-Jul-2023 lukem

build.sh: use mk.conf (if present) as MAKECONF

Set MAKECONF to mk.conf in the same directory as build.sh
(i.e., the top of the source tree) if mk.conf is present.
This means unprivileged users can benefit from mk.conf(5)
semantics without write privileges to /etc/mk.conf, and
also simplifies per-source-directory configuration.

Fail early if $MAKECONF is empty, since build.sh will fail
anyway after rebuilding nbmake.

Ensure that the computed MAKECONF isn't empty, and then
always set MAKECONF in the makewrapper (nbmake-$MACHINE).

Improve some formatting consistency in BUILDING.mdoc,
(even if BUILDING is generated without markup).


# 1.145 05-Jul-2023 lukem

BUILDING: wording tweaks


# 1.144 11-Jun-2023 lukem

BUILDING: remove duplication from mk.conf(5)

Remove all "make" variables / mk.conf(5) variables already documented
in mk.conf(5). The duplication was a maintenance headache, as I've
experienced over recent weeks getting the build documentation up to
date.

Add notes clarifying that manual page references are to the NetBSD
manual pages, not to the host manual pages, and how to format from
source, or find online at https://man.netbsd.org.

Add explicit links to the mdoc(7) in-tree source for mk.conf(5),
hier(7), and release(7) because those are directly relevant to the host
build information in BUILDING.

Note: We don't normally need these notes for native documentation,
but BUILDING is intended for users on host systems which might not
be NetBSD(-current).

Add missing defaults.


# 1.143 11-Jun-2023 lukem

BUILDING: update from mk.conf(5). reorder

Sync variable entries from mk.conf(5).

Merge the "make variables for full builds" section into the previous.
Having two separate sections and some entries duplicated was confusing
when searching for variables.


# 1.142 11-Jun-2023 lukem

more NBUILDJOBS deprecation

The NBUILDJOBS option was deprecated in 2002;
there's no need to keep warning about it,
remove from params / show-params,
and only document as obsolete.


# 1.141 05-Jun-2023 lukem

BUILDING: editorial

MKX11=yes wants MKINET6=yes

Change the width of the variable lists to 14n (from 15n)
so that when the lists are rendered and then left aligned,
the column is 16 characters (aka 2 tabs) which makes
copypasta to bsd.README easier.


# 1.140 04-Jun-2023 lukem

BUILDING: update from canonical mk.conf(5)

Incorporate content and styles updates for mk.conf entries
from share/man/man5/mk.conf.5, which is the canonical
reference for mk.conf.

Add: BSDOBJDIR, BSDSRCDIR, EXTERNAL_TOOLCHAIN, MKDEBUGKERNEL,
MKDEBUGTOOLS, MKHTML, MKLINKLIB, MKOBJDIRS, TOOLCHAIN_MISSING,
NETBSDSRCDIR

It's for further study as to whether we just replace the
most of subsection "make" variables with a link to mk.conf(5).

Style:
- Add more .de macros per mk.conf.5.
- Order list items alphabetically. When multiple items are present
in a list item, sort within the item first.
- More cross-references.


# 1.139 02-Jun-2023 lukem

build.sh: MAKECONF and mk.conf(5) improvements

Move MAKECONF to the Environment variables section.
Add mk.conf(5) cross-references.
Make Notes more obvious.
Fix mandoc lint.


# 1.138 18-May-2023 lukem

BUILDING: TMPDIR must not be noexec

Describe $TMPDIR as used by build.sh, and
add a note that it can't be mounted noexec.

PR toolchain/44459


# 1.137 16-May-2023 lukem

build.sh, BUILDING: consistency improvements

Consistently use "show", instead of sometimes using "display" or "print".
Fix mdoc markup (even though BUILDING is raw text).
Document help, -P, -?


# 1.136 16-May-2023 lukem

BUILDING: update upstream, regen

doc/BUILDING.mdoc is the upstream for BUILDING, so add recent changes
in the latter to the former, formatting correctly.

Move INSTALLBOOT_UBOOT_PATHS to Environment variables.
Move INSTALLBOOT_BOARDS to "make" variables for full builds.
Add installboot(8) cross-reference.


Revision tags: netbsd-10-base
# 1.135 21-Aug-2022 lukem

Deprecate extsrc/, EXTSRCSRCDIR, MKEXTSRC

Remove support for building extsrc/:
1. Makefile: remove do-extsrc target.
2. build.sh: remove options -y and -Y extsrcdir.
3. distrib/sets: remove support for extsrc in various tools
including the options -L ext and -y, and the extsrc sets.
4. doc/BUILDING.mdoc: remove docs for extsrc/, EXTSRCSRCDIR, MKEXTSRC (etc)
5. bsd.own.mk and various Makefiles: remove support for extsrc/,
EXTSRCSRCDIR, MKEXTSRC.

As proposed on tech-kern and tech-userlevel on 2022-01-07
and followed up on 2022-08-21.


# 1.134 28-May-2022 andvar

s/knowlege/knowledge/


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.133 10-Nov-2020 kamil

Reintroduce the support of MKCATPAGES

Requested by <mrg>


# 1.132 08-Nov-2020 kamil

Remove the support for MKCATPAGES

It was optional since 1999 and disabled by default since 2012.

Proposed on tech-userlevel@.


# 1.131 13-Oct-2020 thorpej

Document CPUFLAGS here (it's already documented in share/mk/bsd.README).
This will address the initial concern in PR port-alpha/55545.


# 1.130 12-Oct-2020 uwe

Mention HOST_CFLAGS and HOST_CXXFLAGS.


# 1.129 12-Oct-2020 uwe

If this file is processed with real roff (doc.tmac) tweak things to
make ascii output as close to the mandoc output as possible.
There are only two diffs:
- groff renders em-dash as -- in the NAME section
- mandoc misses "NetBSD" in the "NetBSD System Manager's Manual"
section header


# 1.128 12-Oct-2020 uwe

Bump date and regen for BUILDING.mdoc revision 1.127
that introduced build.sh -c <compiler> option.


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.149 22-Jul-2023 lukem

BUILDING: list known mk.conf vars. tweak section headers

List known supported and obsolete mk.conf(5) variables,
so that searches in this document at least find them.
This partially reverts my revision 1.144 on 2023-06-12
which completely removed the duplication with mk.conf(5).

Remove quote characters from some section headings;
it makes it harder to search for a section by known name
when rendering in markup variations that use smart quotes.


# 1.148 21-Jul-2023 lukem

BUILDING: clarify environ vs mk.conf behaviour

Document that variables set in the environment or the
nbmake-MACHINE wrapper script don't override variable
assignments in mk.conf(5), and that using ?= in mk.conf
allows environment / nbmake-MACHINE variables to override
mk.conf.

Consistently refer to "nbmake-MACHINE wrapper script".


# 1.147 19-Jul-2023 lukem

BUILDING: consistency fix


# 1.146 18-Jul-2023 lukem

build.sh: use mk.conf (if present) as MAKECONF

Set MAKECONF to mk.conf in the same directory as build.sh
(i.e., the top of the source tree) if mk.conf is present.
This means unprivileged users can benefit from mk.conf(5)
semantics without write privileges to /etc/mk.conf, and
also simplifies per-source-directory configuration.

Fail early if $MAKECONF is empty, since build.sh will fail
anyway after rebuilding nbmake.

Ensure that the computed MAKECONF isn't empty, and then
always set MAKECONF in the makewrapper (nbmake-$MACHINE).

Improve some formatting consistency in BUILDING.mdoc,
(even if BUILDING is generated without markup).


# 1.145 05-Jul-2023 lukem

BUILDING: wording tweaks


# 1.144 11-Jun-2023 lukem

BUILDING: remove duplication from mk.conf(5)

Remove all "make" variables / mk.conf(5) variables already documented
in mk.conf(5). The duplication was a maintenance headache, as I've
experienced over recent weeks getting the build documentation up to
date.

Add notes clarifying that manual page references are to the NetBSD
manual pages, not to the host manual pages, and how to format from
source, or find online at https://man.netbsd.org.

Add explicit links to the mdoc(7) in-tree source for mk.conf(5),
hier(7), and release(7) because those are directly relevant to the host
build information in BUILDING.

Note: We don't normally need these notes for native documentation,
but BUILDING is intended for users on host systems which might not
be NetBSD(-current).

Add missing defaults.


# 1.143 11-Jun-2023 lukem

BUILDING: update from mk.conf(5). reorder

Sync variable entries from mk.conf(5).

Merge the "make variables for full builds" section into the previous.
Having two separate sections and some entries duplicated was confusing
when searching for variables.


# 1.142 11-Jun-2023 lukem

more NBUILDJOBS deprecation

The NBUILDJOBS option was deprecated in 2002;
there's no need to keep warning about it,
remove from params / show-params,
and only document as obsolete.


# 1.141 05-Jun-2023 lukem

BUILDING: editorial

MKX11=yes wants MKINET6=yes

Change the width of the variable lists to 14n (from 15n)
so that when the lists are rendered and then left aligned,
the column is 16 characters (aka 2 tabs) which makes
copypasta to bsd.README easier.


# 1.140 04-Jun-2023 lukem

BUILDING: update from canonical mk.conf(5)

Incorporate content and styles updates for mk.conf entries
from share/man/man5/mk.conf.5, which is the canonical
reference for mk.conf.

Add: BSDOBJDIR, BSDSRCDIR, EXTERNAL_TOOLCHAIN, MKDEBUGKERNEL,
MKDEBUGTOOLS, MKHTML, MKLINKLIB, MKOBJDIRS, TOOLCHAIN_MISSING,
NETBSDSRCDIR

It's for further study as to whether we just replace the
most of subsection "make" variables with a link to mk.conf(5).

Style:
- Add more .de macros per mk.conf.5.
- Order list items alphabetically. When multiple items are present
in a list item, sort within the item first.
- More cross-references.


# 1.139 02-Jun-2023 lukem

build.sh: MAKECONF and mk.conf(5) improvements

Move MAKECONF to the Environment variables section.
Add mk.conf(5) cross-references.
Make Notes more obvious.
Fix mandoc lint.


# 1.138 18-May-2023 lukem

BUILDING: TMPDIR must not be noexec

Describe $TMPDIR as used by build.sh, and
add a note that it can't be mounted noexec.

PR toolchain/44459


# 1.137 16-May-2023 lukem

build.sh, BUILDING: consistency improvements

Consistently use "show", instead of sometimes using "display" or "print".
Fix mdoc markup (even though BUILDING is raw text).
Document help, -P, -?


# 1.136 16-May-2023 lukem

BUILDING: update upstream, regen

doc/BUILDING.mdoc is the upstream for BUILDING, so add recent changes
in the latter to the former, formatting correctly.

Move INSTALLBOOT_UBOOT_PATHS to Environment variables.
Move INSTALLBOOT_BOARDS to "make" variables for full builds.
Add installboot(8) cross-reference.


Revision tags: netbsd-10-base
# 1.135 21-Aug-2022 lukem

Deprecate extsrc/, EXTSRCSRCDIR, MKEXTSRC

Remove support for building extsrc/:
1. Makefile: remove do-extsrc target.
2. build.sh: remove options -y and -Y extsrcdir.
3. distrib/sets: remove support for extsrc in various tools
including the options -L ext and -y, and the extsrc sets.
4. doc/BUILDING.mdoc: remove docs for extsrc/, EXTSRCSRCDIR, MKEXTSRC (etc)
5. bsd.own.mk and various Makefiles: remove support for extsrc/,
EXTSRCSRCDIR, MKEXTSRC.

As proposed on tech-kern and tech-userlevel on 2022-01-07
and followed up on 2022-08-21.


# 1.134 28-May-2022 andvar

s/knowlege/knowledge/


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.133 10-Nov-2020 kamil

Reintroduce the support of MKCATPAGES

Requested by <mrg>


# 1.132 08-Nov-2020 kamil

Remove the support for MKCATPAGES

It was optional since 1999 and disabled by default since 2012.

Proposed on tech-userlevel@.


# 1.131 13-Oct-2020 thorpej

Document CPUFLAGS here (it's already documented in share/mk/bsd.README).
This will address the initial concern in PR port-alpha/55545.


# 1.130 12-Oct-2020 uwe

Mention HOST_CFLAGS and HOST_CXXFLAGS.


# 1.129 12-Oct-2020 uwe

If this file is processed with real roff (doc.tmac) tweak things to
make ascii output as close to the mandoc output as possible.
There are only two diffs:
- groff renders em-dash as -- in the NAME section
- mandoc misses "NetBSD" in the "NetBSD System Manager's Manual"
section header


# 1.128 12-Oct-2020 uwe

Bump date and regen for BUILDING.mdoc revision 1.127
that introduced build.sh -c <compiler> option.


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.147 19-Jul-2023 lukem

BUILDING: consistency fix


# 1.146 18-Jul-2023 lukem

build.sh: use mk.conf (if present) as MAKECONF

Set MAKECONF to mk.conf in the same directory as build.sh
(i.e., the top of the source tree) if mk.conf is present.
This means unprivileged users can benefit from mk.conf(5)
semantics without write privileges to /etc/mk.conf, and
also simplifies per-source-directory configuration.

Fail early if $MAKECONF is empty, since build.sh will fail
anyway after rebuilding nbmake.

Ensure that the computed MAKECONF isn't empty, and then
always set MAKECONF in the makewrapper (nbmake-$MACHINE).

Improve some formatting consistency in BUILDING.mdoc,
(even if BUILDING is generated without markup).


# 1.145 05-Jul-2023 lukem

BUILDING: wording tweaks


# 1.144 11-Jun-2023 lukem

BUILDING: remove duplication from mk.conf(5)

Remove all "make" variables / mk.conf(5) variables already documented
in mk.conf(5). The duplication was a maintenance headache, as I've
experienced over recent weeks getting the build documentation up to
date.

Add notes clarifying that manual page references are to the NetBSD
manual pages, not to the host manual pages, and how to format from
source, or find online at https://man.netbsd.org.

Add explicit links to the mdoc(7) in-tree source for mk.conf(5),
hier(7), and release(7) because those are directly relevant to the host
build information in BUILDING.

Note: We don't normally need these notes for native documentation,
but BUILDING is intended for users on host systems which might not
be NetBSD(-current).

Add missing defaults.


# 1.143 11-Jun-2023 lukem

BUILDING: update from mk.conf(5). reorder

Sync variable entries from mk.conf(5).

Merge the "make variables for full builds" section into the previous.
Having two separate sections and some entries duplicated was confusing
when searching for variables.


# 1.142 11-Jun-2023 lukem

more NBUILDJOBS deprecation

The NBUILDJOBS option was deprecated in 2002;
there's no need to keep warning about it,
remove from params / show-params,
and only document as obsolete.


# 1.141 05-Jun-2023 lukem

BUILDING: editorial

MKX11=yes wants MKINET6=yes

Change the width of the variable lists to 14n (from 15n)
so that when the lists are rendered and then left aligned,
the column is 16 characters (aka 2 tabs) which makes
copypasta to bsd.README easier.


# 1.140 04-Jun-2023 lukem

BUILDING: update from canonical mk.conf(5)

Incorporate content and styles updates for mk.conf entries
from share/man/man5/mk.conf.5, which is the canonical
reference for mk.conf.

Add: BSDOBJDIR, BSDSRCDIR, EXTERNAL_TOOLCHAIN, MKDEBUGKERNEL,
MKDEBUGTOOLS, MKHTML, MKLINKLIB, MKOBJDIRS, TOOLCHAIN_MISSING,
NETBSDSRCDIR

It's for further study as to whether we just replace the
most of subsection "make" variables with a link to mk.conf(5).

Style:
- Add more .de macros per mk.conf.5.
- Order list items alphabetically. When multiple items are present
in a list item, sort within the item first.
- More cross-references.


# 1.139 02-Jun-2023 lukem

build.sh: MAKECONF and mk.conf(5) improvements

Move MAKECONF to the Environment variables section.
Add mk.conf(5) cross-references.
Make Notes more obvious.
Fix mandoc lint.


# 1.138 18-May-2023 lukem

BUILDING: TMPDIR must not be noexec

Describe $TMPDIR as used by build.sh, and
add a note that it can't be mounted noexec.

PR toolchain/44459


# 1.137 16-May-2023 lukem

build.sh, BUILDING: consistency improvements

Consistently use "show", instead of sometimes using "display" or "print".
Fix mdoc markup (even though BUILDING is raw text).
Document help, -P, -?


# 1.136 16-May-2023 lukem

BUILDING: update upstream, regen

doc/BUILDING.mdoc is the upstream for BUILDING, so add recent changes
in the latter to the former, formatting correctly.

Move INSTALLBOOT_UBOOT_PATHS to Environment variables.
Move INSTALLBOOT_BOARDS to "make" variables for full builds.
Add installboot(8) cross-reference.


Revision tags: netbsd-10-base
# 1.135 21-Aug-2022 lukem

Deprecate extsrc/, EXTSRCSRCDIR, MKEXTSRC

Remove support for building extsrc/:
1. Makefile: remove do-extsrc target.
2. build.sh: remove options -y and -Y extsrcdir.
3. distrib/sets: remove support for extsrc in various tools
including the options -L ext and -y, and the extsrc sets.
4. doc/BUILDING.mdoc: remove docs for extsrc/, EXTSRCSRCDIR, MKEXTSRC (etc)
5. bsd.own.mk and various Makefiles: remove support for extsrc/,
EXTSRCSRCDIR, MKEXTSRC.

As proposed on tech-kern and tech-userlevel on 2022-01-07
and followed up on 2022-08-21.


# 1.134 28-May-2022 andvar

s/knowlege/knowledge/


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.133 10-Nov-2020 kamil

Reintroduce the support of MKCATPAGES

Requested by <mrg>


# 1.132 08-Nov-2020 kamil

Remove the support for MKCATPAGES

It was optional since 1999 and disabled by default since 2012.

Proposed on tech-userlevel@.


# 1.131 13-Oct-2020 thorpej

Document CPUFLAGS here (it's already documented in share/mk/bsd.README).
This will address the initial concern in PR port-alpha/55545.


# 1.130 12-Oct-2020 uwe

Mention HOST_CFLAGS and HOST_CXXFLAGS.


# 1.129 12-Oct-2020 uwe

If this file is processed with real roff (doc.tmac) tweak things to
make ascii output as close to the mandoc output as possible.
There are only two diffs:
- groff renders em-dash as -- in the NAME section
- mandoc misses "NetBSD" in the "NetBSD System Manager's Manual"
section header


# 1.128 12-Oct-2020 uwe

Bump date and regen for BUILDING.mdoc revision 1.127
that introduced build.sh -c <compiler> option.


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.145 05-Jul-2023 lukem

BUILDING: wording tweaks


# 1.144 11-Jun-2023 lukem

BUILDING: remove duplication from mk.conf(5)

Remove all "make" variables / mk.conf(5) variables already documented
in mk.conf(5). The duplication was a maintenance headache, as I've
experienced over recent weeks getting the build documentation up to
date.

Add notes clarifying that manual page references are to the NetBSD
manual pages, not to the host manual pages, and how to format from
source, or find online at https://man.netbsd.org.

Add explicit links to the mdoc(7) in-tree source for mk.conf(5),
hier(7), and release(7) because those are directly relevant to the host
build information in BUILDING.

Note: We don't normally need these notes for native documentation,
but BUILDING is intended for users on host systems which might not
be NetBSD(-current).

Add missing defaults.


# 1.143 11-Jun-2023 lukem

BUILDING: update from mk.conf(5). reorder

Sync variable entries from mk.conf(5).

Merge the "make variables for full builds" section into the previous.
Having two separate sections and some entries duplicated was confusing
when searching for variables.


# 1.142 11-Jun-2023 lukem

more NBUILDJOBS deprecation

The NBUILDJOBS option was deprecated in 2002;
there's no need to keep warning about it,
remove from params / show-params,
and only document as obsolete.


# 1.141 05-Jun-2023 lukem

BUILDING: editorial

MKX11=yes wants MKINET6=yes

Change the width of the variable lists to 14n (from 15n)
so that when the lists are rendered and then left aligned,
the column is 16 characters (aka 2 tabs) which makes
copypasta to bsd.README easier.


# 1.140 04-Jun-2023 lukem

BUILDING: update from canonical mk.conf(5)

Incorporate content and styles updates for mk.conf entries
from share/man/man5/mk.conf.5, which is the canonical
reference for mk.conf.

Add: BSDOBJDIR, BSDSRCDIR, EXTERNAL_TOOLCHAIN, MKDEBUGKERNEL,
MKDEBUGTOOLS, MKHTML, MKLINKLIB, MKOBJDIRS, TOOLCHAIN_MISSING,
NETBSDSRCDIR

It's for further study as to whether we just replace the
most of subsection "make" variables with a link to mk.conf(5).

Style:
- Add more .de macros per mk.conf.5.
- Order list items alphabetically. When multiple items are present
in a list item, sort within the item first.
- More cross-references.


# 1.139 02-Jun-2023 lukem

build.sh: MAKECONF and mk.conf(5) improvements

Move MAKECONF to the Environment variables section.
Add mk.conf(5) cross-references.
Make Notes more obvious.
Fix mandoc lint.


# 1.138 18-May-2023 lukem

BUILDING: TMPDIR must not be noexec

Describe $TMPDIR as used by build.sh, and
add a note that it can't be mounted noexec.

PR toolchain/44459


# 1.137 16-May-2023 lukem

build.sh, BUILDING: consistency improvements

Consistently use "show", instead of sometimes using "display" or "print".
Fix mdoc markup (even though BUILDING is raw text).
Document help, -P, -?


# 1.136 16-May-2023 lukem

BUILDING: update upstream, regen

doc/BUILDING.mdoc is the upstream for BUILDING, so add recent changes
in the latter to the former, formatting correctly.

Move INSTALLBOOT_UBOOT_PATHS to Environment variables.
Move INSTALLBOOT_BOARDS to "make" variables for full builds.
Add installboot(8) cross-reference.


Revision tags: netbsd-10-base
# 1.135 21-Aug-2022 lukem

Deprecate extsrc/, EXTSRCSRCDIR, MKEXTSRC

Remove support for building extsrc/:
1. Makefile: remove do-extsrc target.
2. build.sh: remove options -y and -Y extsrcdir.
3. distrib/sets: remove support for extsrc in various tools
including the options -L ext and -y, and the extsrc sets.
4. doc/BUILDING.mdoc: remove docs for extsrc/, EXTSRCSRCDIR, MKEXTSRC (etc)
5. bsd.own.mk and various Makefiles: remove support for extsrc/,
EXTSRCSRCDIR, MKEXTSRC.

As proposed on tech-kern and tech-userlevel on 2022-01-07
and followed up on 2022-08-21.


# 1.134 28-May-2022 andvar

s/knowlege/knowledge/


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.133 10-Nov-2020 kamil

Reintroduce the support of MKCATPAGES

Requested by <mrg>


# 1.132 08-Nov-2020 kamil

Remove the support for MKCATPAGES

It was optional since 1999 and disabled by default since 2012.

Proposed on tech-userlevel@.


# 1.131 13-Oct-2020 thorpej

Document CPUFLAGS here (it's already documented in share/mk/bsd.README).
This will address the initial concern in PR port-alpha/55545.


# 1.130 12-Oct-2020 uwe

Mention HOST_CFLAGS and HOST_CXXFLAGS.


# 1.129 12-Oct-2020 uwe

If this file is processed with real roff (doc.tmac) tweak things to
make ascii output as close to the mandoc output as possible.
There are only two diffs:
- groff renders em-dash as -- in the NAME section
- mandoc misses "NetBSD" in the "NetBSD System Manager's Manual"
section header


# 1.128 12-Oct-2020 uwe

Bump date and regen for BUILDING.mdoc revision 1.127
that introduced build.sh -c <compiler> option.


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.144 11-Jun-2023 lukem

BUILDING: remove duplication from mk.conf(5)

Remove all "make" variables / mk.conf(5) variables already documented
in mk.conf(5). The duplication was a maintenance headache, as I've
experienced over recent weeks getting the build documentation up to
date.

Add notes clarifying that manual page references are to the NetBSD
manual pages, not to the host manual pages, and how to format from
source, or find online at https://man.netbsd.org.

Add explicit links to the mdoc(7) in-tree source for mk.conf(5),
hier(7), and release(7) because those are directly relevant to the host
build information in BUILDING.

Note: We don't normally need these notes for native documentation,
but BUILDING is intended for users on host systems which might not
be NetBSD(-current).

Add missing defaults.


# 1.143 11-Jun-2023 lukem

BUILDING: update from mk.conf(5). reorder

Sync variable entries from mk.conf(5).

Merge the "make variables for full builds" section into the previous.
Having two separate sections and some entries duplicated was confusing
when searching for variables.


# 1.142 11-Jun-2023 lukem

more NBUILDJOBS deprecation

The NBUILDJOBS option was deprecated in 2002;
there's no need to keep warning about it,
remove from params / show-params,
and only document as obsolete.


# 1.141 05-Jun-2023 lukem

BUILDING: editorial

MKX11=yes wants MKINET6=yes

Change the width of the variable lists to 14n (from 15n)
so that when the lists are rendered and then left aligned,
the column is 16 characters (aka 2 tabs) which makes
copypasta to bsd.README easier.


# 1.140 04-Jun-2023 lukem

BUILDING: update from canonical mk.conf(5)

Incorporate content and styles updates for mk.conf entries
from share/man/man5/mk.conf.5, which is the canonical
reference for mk.conf.

Add: BSDOBJDIR, BSDSRCDIR, EXTERNAL_TOOLCHAIN, MKDEBUGKERNEL,
MKDEBUGTOOLS, MKHTML, MKLINKLIB, MKOBJDIRS, TOOLCHAIN_MISSING,
NETBSDSRCDIR

It's for further study as to whether we just replace the
most of subsection "make" variables with a link to mk.conf(5).

Style:
- Add more .de macros per mk.conf.5.
- Order list items alphabetically. When multiple items are present
in a list item, sort within the item first.
- More cross-references.


# 1.139 02-Jun-2023 lukem

build.sh: MAKECONF and mk.conf(5) improvements

Move MAKECONF to the Environment variables section.
Add mk.conf(5) cross-references.
Make Notes more obvious.
Fix mandoc lint.


# 1.138 18-May-2023 lukem

BUILDING: TMPDIR must not be noexec

Describe $TMPDIR as used by build.sh, and
add a note that it can't be mounted noexec.

PR toolchain/44459


# 1.137 16-May-2023 lukem

build.sh, BUILDING: consistency improvements

Consistently use "show", instead of sometimes using "display" or "print".
Fix mdoc markup (even though BUILDING is raw text).
Document help, -P, -?


# 1.136 16-May-2023 lukem

BUILDING: update upstream, regen

doc/BUILDING.mdoc is the upstream for BUILDING, so add recent changes
in the latter to the former, formatting correctly.

Move INSTALLBOOT_UBOOT_PATHS to Environment variables.
Move INSTALLBOOT_BOARDS to "make" variables for full builds.
Add installboot(8) cross-reference.


Revision tags: netbsd-10-base
# 1.135 21-Aug-2022 lukem

Deprecate extsrc/, EXTSRCSRCDIR, MKEXTSRC

Remove support for building extsrc/:
1. Makefile: remove do-extsrc target.
2. build.sh: remove options -y and -Y extsrcdir.
3. distrib/sets: remove support for extsrc in various tools
including the options -L ext and -y, and the extsrc sets.
4. doc/BUILDING.mdoc: remove docs for extsrc/, EXTSRCSRCDIR, MKEXTSRC (etc)
5. bsd.own.mk and various Makefiles: remove support for extsrc/,
EXTSRCSRCDIR, MKEXTSRC.

As proposed on tech-kern and tech-userlevel on 2022-01-07
and followed up on 2022-08-21.


# 1.134 28-May-2022 andvar

s/knowlege/knowledge/


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.133 10-Nov-2020 kamil

Reintroduce the support of MKCATPAGES

Requested by <mrg>


# 1.132 08-Nov-2020 kamil

Remove the support for MKCATPAGES

It was optional since 1999 and disabled by default since 2012.

Proposed on tech-userlevel@.


# 1.131 13-Oct-2020 thorpej

Document CPUFLAGS here (it's already documented in share/mk/bsd.README).
This will address the initial concern in PR port-alpha/55545.


# 1.130 12-Oct-2020 uwe

Mention HOST_CFLAGS and HOST_CXXFLAGS.


# 1.129 12-Oct-2020 uwe

If this file is processed with real roff (doc.tmac) tweak things to
make ascii output as close to the mandoc output as possible.
There are only two diffs:
- groff renders em-dash as -- in the NAME section
- mandoc misses "NetBSD" in the "NetBSD System Manager's Manual"
section header


# 1.128 12-Oct-2020 uwe

Bump date and regen for BUILDING.mdoc revision 1.127
that introduced build.sh -c <compiler> option.


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.135 21-Aug-2022 lukem

Deprecate extsrc/, EXTSRCSRCDIR, MKEXTSRC

Remove support for building extsrc/:
1. Makefile: remove do-extsrc target.
2. build.sh: remove options -y and -Y extsrcdir.
3. distrib/sets: remove support for extsrc in various tools
including the options -L ext and -y, and the extsrc sets.
4. doc/BUILDING.mdoc: remove docs for extsrc/, EXTSRCSRCDIR, MKEXTSRC (etc)
5. bsd.own.mk and various Makefiles: remove support for extsrc/,
EXTSRCSRCDIR, MKEXTSRC.

As proposed on tech-kern and tech-userlevel on 2022-01-07
and followed up on 2022-08-21.


# 1.134 28-May-2022 andvar

s/knowlege/knowledge/


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.133 10-Nov-2020 kamil

Reintroduce the support of MKCATPAGES

Requested by <mrg>


# 1.132 08-Nov-2020 kamil

Remove the support for MKCATPAGES

It was optional since 1999 and disabled by default since 2012.

Proposed on tech-userlevel@.


# 1.131 13-Oct-2020 thorpej

Document CPUFLAGS here (it's already documented in share/mk/bsd.README).
This will address the initial concern in PR port-alpha/55545.


# 1.130 12-Oct-2020 uwe

Mention HOST_CFLAGS and HOST_CXXFLAGS.


# 1.129 12-Oct-2020 uwe

If this file is processed with real roff (doc.tmac) tweak things to
make ascii output as close to the mandoc output as possible.
There are only two diffs:
- groff renders em-dash as -- in the NAME section
- mandoc misses "NetBSD" in the "NetBSD System Manager's Manual"
section header


# 1.128 12-Oct-2020 uwe

Bump date and regen for BUILDING.mdoc revision 1.127
that introduced build.sh -c <compiler> option.


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.134 28-May-2022 andvar

s/knowlege/knowledge/


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.133 10-Nov-2020 kamil

Reintroduce the support of MKCATPAGES

Requested by <mrg>


# 1.132 08-Nov-2020 kamil

Remove the support for MKCATPAGES

It was optional since 1999 and disabled by default since 2012.

Proposed on tech-userlevel@.


# 1.131 13-Oct-2020 thorpej

Document CPUFLAGS here (it's already documented in share/mk/bsd.README).
This will address the initial concern in PR port-alpha/55545.


# 1.130 12-Oct-2020 uwe

Mention HOST_CFLAGS and HOST_CXXFLAGS.


# 1.129 12-Oct-2020 uwe

If this file is processed with real roff (doc.tmac) tweak things to
make ascii output as close to the mandoc output as possible.
There are only two diffs:
- groff renders em-dash as -- in the NAME section
- mandoc misses "NetBSD" in the "NetBSD System Manager's Manual"
section header


# 1.128 12-Oct-2020 uwe

Bump date and regen for BUILDING.mdoc revision 1.127
that introduced build.sh -c <compiler> option.


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.133 10-Nov-2020 kamil

Reintroduce the support of MKCATPAGES

Requested by <mrg>


# 1.132 08-Nov-2020 kamil

Remove the support for MKCATPAGES

It was optional since 1999 and disabled by default since 2012.

Proposed on tech-userlevel@.


# 1.131 13-Oct-2020 thorpej

Document CPUFLAGS here (it's already documented in share/mk/bsd.README).
This will address the initial concern in PR port-alpha/55545.


# 1.130 12-Oct-2020 uwe

Mention HOST_CFLAGS and HOST_CXXFLAGS.


# 1.129 12-Oct-2020 uwe

If this file is processed with real roff (doc.tmac) tweak things to
make ascii output as close to the mandoc output as possible.
There are only two diffs:
- groff renders em-dash as -- in the NAME section
- mandoc misses "NetBSD" in the "NetBSD System Manager's Manual"
section header


# 1.128 12-Oct-2020 uwe

Bump date and regen for BUILDING.mdoc revision 1.127
that introduced build.sh -c <compiler> option.


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.131 13-Oct-2020 thorpej

Document CPUFLAGS here (it's already documented in share/mk/bsd.README).
This will address the initial concern in PR port-alpha/55545.


# 1.130 12-Oct-2020 uwe

Mention HOST_CFLAGS and HOST_CXXFLAGS.


# 1.129 12-Oct-2020 uwe

If this file is processed with real roff (doc.tmac) tweak things to
make ascii output as close to the mandoc output as possible.
There are only two diffs:
- groff renders em-dash as -- in the NAME section
- mandoc misses "NetBSD" in the "NetBSD System Manager's Manual"
section header


# 1.128 12-Oct-2020 uwe

Bump date and regen for BUILDING.mdoc revision 1.127
that introduced build.sh -c <compiler> option.


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.127 30-Jun-2020 riastradh

New build.sh option: -c <compiler>

Could never remember what the incantation is to do a clang build, so
now it's just `build.sh -c clang'.


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2; 1.124.4;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.126 08-May-2019 leot

Fix a typo

Reported by Tobias Ulmer via netbsd-docs@ ML, thanks!


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.125 29-Jul-2018 sevan

Spelling mistake.
Reword MKINFO description.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.124 16-Feb-2018 leot

branches: 1.124.2;
Fix a typo.

Pointed out by aalm in #NetBSD@Freenode.


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.123 29-Dec-2017 sevan

While SH3 is no longer an exception, m68000 still is.


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.122 21-Oct-2017 sevan

Direct reader to use build.sh for building NetBSD in favour of using make directly.
Give an example of why build.sh is better to use.


# 1.121 21-Oct-2017 sevan

SH3 is no longer an exception for MKPIC, in src/share/mk/bsd.own.mk we set MKPIC
to yes by default.
Kill trailing whitespace.


Revision tags: matt-nb8-mediatek-base netbsd-8-base
# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.120 21-May-2017 riastradh

Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export. The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated. I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet... That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


Revision tags: prg-localcount2-base pgoyette-localcount-20170426
# 1.119 22-Apr-2017 plunky

state correct location for install-image (RELEASEDIR/images)


Revision tags: bouyer-socketcan-base1
# 1.118 20-Apr-2017 wiz

Use Fl and Xr. New sentence, new line.


# 1.117 20-Apr-2017 ozaki-r

Introduce MKSTRIPSYM build option

If it's yes, all local symbols of shared libraries are stripped
(default). If it's no, only temporary local symbols are stripped;
for example, symbols of static functions are kept. Keeping such
symbols is useful on using DTrace for userland libraries and
getting a backtrace from a rump server loading modules (shared
libraries).

Proposed and discussed on tech-kern and tech-toolchain


Revision tags: pgoyette-localcount-20170320
# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

branches: 1.115.2; 1.115.4;
Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.116 20-Feb-2017 christos

document -P


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 07-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 08-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 16-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 16-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 06-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 18-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 29-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 28-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 18-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 30-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 12-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 26-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 25-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 08-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 18-Jul-2003 lukem

fix warning found by new groff


# 1.23 03-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 30-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 26-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 26-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 25-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


Revision tags: pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.115 29-Jan-2016 wiz

Document MKREPRO_TIMESTAMP.


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 06-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 07-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 15-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 15-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 05-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 13-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


Revision tags: yamt-pagecache-base6
# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.88 23-Feb-2012 tsutsui

Add a missing period.


Revision tags: netbsd-6-base
# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


Revision tags: yamt-pagecache-base6
# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


Revision tags: matt-premerge-20091211
# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 27-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 11-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


Revision tags: netbsd-5-base matt-mips64-base2 mjf-devfs2-base
# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


Revision tags: wrstuden-revivesa-base-3
# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


Revision tags: wrstuden-revivesa-base-2
# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 17-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.58 28-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 27-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.56 17-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 29-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


Revision tags: matt-mips64-base
# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


Revision tags: netbsd-4-base
# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


Revision tags: abandoned-netbsd-4-base
# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 11-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.35 18-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 18-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 25-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 24-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 07-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 18-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 17-Jul-2003 lukem

fix warning found by new groff


# 1.23 02-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 24-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 01-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 29-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 25-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 25-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 03-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


Revision tags: fvdl_fs64_base
# 1.7 24-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.114 23-Jul-2015 mrg

remove the xfree86 reachover makefiles and the vast majority of
the support in the rest of the source tree.

X11 sets could use some cleaning up perhaps (just deletion, as
we've never really marked the old X11R6 as obsolete for native
xorg using platforms so far either.)


# 1.113 06-Jun-2015 pgoyette

Update location of live-images to reflect changes made in rev 1.398 of
src/etc/Makefile


# 1.112 07-Apr-2015 wiz

Update Xorg defaults description. From Joachim Henke on netbsd-docs.


# 1.111 08-Jan-2015 riastradh

Use `It Sy', not just `It', for live-image, to match other targets.

No change to plain-text BUILDING file.


# 1.110 30-Nov-2014 uebayasi

Add a new build make variable, CONFIGOPTS, which is passed to config(1)
when building kernels. Revert "mkernel=*" and "mkernels" in favor of
this option.

Diff posted on source-changes-d@, approved by (null).


# 1.109 15-Nov-2014 uebayasi

Document build.sh mkernels.


# 1.108 15-Nov-2014 uebayasi

Document mkernel=*.


# 1.107 13-Nov-2014 apb

Document "extsrc". This was added to src/BUILDING in revision 1.90
dated 2009-11-30, but was not added to src/doc/BUILDING.mdoc,
so the changes were lost.

The original log message was:
- - - -
revision 1.90
date: 2009-11-30 16:13:22 +0000; author: uebayasi; state: Exp; lines: +22 -0;
Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org. (These sets are not included as TNF releases.)
- - - -


# 1.106 05-Nov-2014 uebayasi

Document the "kernels" operation.


# 1.105 05-Nov-2014 snj

sync with reality: iso -> images


# 1.104 07-Aug-2014 apb

branches: 1.104.2;
Add advice about avoiding common pitfalls.

This is taken from the patch in PR 48741, by David H. Gutteridge,
but I made small changes to wording and markup.


# 1.103 07-Aug-2014 apb

Document build.sh list-arch


# 1.102 03-Aug-2014 apb

Bump date for previous


# 1.101 03-Aug-2014 apb

BUILDINFO part 5: Document BUILDINFO in doc/BUILDING.mdoc.


# 1.100 14-Jun-2014 apb

Improve documentation for BUILDID.


# 1.99 21-May-2014 wiz

Use Pa for paths. Fix a couple of typos.


# 1.98 19-May-2014 martin

Document MKCROSSGDB, MKKDEBUG and build.sh kernel.gdb=


# 1.97 19-May-2014 martin

Document MKDEBUG and MKDEBUGLIB


# 1.96 19-May-2014 martin

Document external directories


# 1.95 24-Dec-2013 uwe

branches: 1.95.2;
Add missing Ar


# 1.94 29-May-2013 wiz

- Bump date (for r1.93);
- remove superfluous macros (fixes mandoc(1) warnings).

From Bug Hunting.


# 1.93 08-Nov-2012 dholland

MKCATPAGES defaults to no these days; noted on netbsd-docs by Luc van
der Veen.


# 1.92 19-Sep-2012 abs

Adjust postinstall recommendation syntax. based on comment from Snader_LB on IRC


# 1.91 19-Sep-2012 abs

strip trailing whitespace


# 1.90 19-Sep-2012 abs

Fix inverted logic description for MKSTRIPIDENT.
Noted by Snader_LB on freenode IRC


# 1.89 25-May-2012 wiz

branches: 1.89.2;
Document MKREPRO using joerg's wording.


# 1.88 23-Feb-2012 tsutsui

Add a missing period.


# 1.87 14-Feb-2012 apb

branches: 1.87.2;
Minor changes to wording in the documentation for
build.sh install-image and live-image.


# 1.86 14-Feb-2012 apb

Document build.sh "live-image" and "install-image" targets.

These were documented in revision 1.97 of src/BUILDING, but were
not documented in src/doc/BUILDING.sh. The original log message
was:

revision 1.97
date: 2012/01/22 03:53:32; author: tsutsui; state: Exp; lines: +39 -0
Add "live-image" and "install-image" target support to build.sh.

"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.


# 1.85 09-Sep-2011 apb

branches: 1.85.2;
Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.


# 1.84 09-Sep-2011 apb

Move the code for creating src/BUILDING from "make build-docs" in
src/Makefile to "make regen" in src/doc/Makefile, and update a comment
in doc/BUILDING.mdoc to match.


# 1.83 09-Sep-2011 apb

Revisions 1.92 and 1.93 of src/BUILDING were not reflected in
src/doc/BUILDING.mdoc, so those changes were lost when src/BUILDING
was regenerated in revision 1.94.

Now update src/doc/BUILDING.mdoc and regenerate src/BUILDING to
reinstate the lost changes. (I also edited one of the changes, to use
the phrase "space-separated list" for consistency with other parts of
the document.)

The original changes were:


# 1.93 06-Aug-2011 jnemeth

Add description of MKKMOD, part of PR misc/45216


# 1.92 29-Jan-2011 jym

Pass down INSTALLSETS variable to installsets target. Use :Q to escape
shell meta-characters, as the variable contains a list of sets, separated
by spaces.

$ ./build.sh -V INSTALLSETS="base etc" install=idir

should now work as expected.

Reviewed by apb@ on tech-toolchain.


# 1.82 09-Sep-2011 apb

Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.


# 1.81 25-Jul-2010 mrg

remove the MKSUBPIXEL/MKTTINTERP options; they're going away.

regenerate.


# 1.80 10-Oct-2009 apb

If ${NETBDSRCDIR}/../xsrc exists, then use it as the default value
of X11SRCDIR. If it doesn't exist, then use /usr/xsrc as before.

OK mrg


# 1.79 02-Oct-2009 cegger

backout wrong changes after I got teached that the vowel *sound* matters
and not the spelling letter (which is what I learned at school).


# 1.78 02-Oct-2009 cegger

fix grammar: a -> an


# 1.77 27-Sep-2009 apb

* Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
neither of those variables is set) use a non-recursive "make obj" in
the top level source directory.

* Do not let TOP_objdir default to ${TOP}. It's now set only by the
-M or -O command line options, or after using getmakevar to expand
MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
environment. It runs too early to use getmakevar, so it will not work
if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
a message when rebuilding make when TOOLDIR is not yet known.


# 1.76 27-Sep-2009 apb

Allow build.sh "-C cdextra" option to be specified multiple times.


# 1.75 26-Sep-2009 apb

Revision 1.86 of src/BUILDING somehow got committed without the
corresponding changes to src/doc/BUILDING.mdoc. Fix that now.
The original log message was:

Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.


# 1.74 12-Jul-2009 hubertf

s/reproducable/reproducible/, requested by salo@


# 1.73 12-Jul-2009 hubertf

Add a keywords for people looking for reproducable (identical) builds.


# 1.72 01-May-2009 snj

Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.71 02-Dec-2008 mrg

branches: 1.71.2;
be explicit about MAKEOBJDIR and MAKEOBJDIRPREFIX not being for
mk.conf or ${MAKECONF}.


# 1.70 15-Nov-2008 mrg

revert sparc back to default of XFree86 at the request of macallan.


# 1.69 13-Nov-2008 apb

Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:

0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command
3 Ignore the effect of the "@" prefix in make commands
4 Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.


# 1.68 09-Nov-2008 mrg

- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


# 1.67 24-Sep-2008 apb

branches: 1.67.2;
* Strengthen the advice against relying on the default objdir selection
rules.
* Add "[options]" to examples in an attempt to make it clear that
extra options should be passed.


# 1.66 10-Sep-2008 joerg

Document MKSTRIPIDENT. Requested by lukem@


# 1.65 06-Sep-2008 lukem

document MKHTML


# 1.64 28-Aug-2008 lukem

Improve support for MKXORG!=no to enable builds into external/mit/xorg.
This will be mutually exclusive to MKX11!=no.


# 1.63 17-Aug-2008 lukem

Document "build.sh cleandir".
Fix formatting nit.
Remove BUGS; all the in-tree platforms are using build.sh now.


# 1.62 11-Aug-2008 apb

* Suggest a "-j" value between 1+NCPU and 2*NCPU for the fastest builds.
* Remove some duplicated content that appeared in both the section about
make's -j flag and the section about build.sh's -j flag.


# 1.61 05-Aug-2008 apb

* Add more detail for build.sh -M and -O options.
* Mention new default when source is /usr/src but build.sh is run
with neither -M nor -O.


# 1.60 05-Aug-2008 perry

Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.


# 1.59 30-Apr-2008 martin

branches: 1.59.2; 1.59.4;
Convert TNF licenses to new 2 clause variant


# 1.58 28-Mar-2008 dholland

branches: 1.58.2;
Correct/clarify the default setting of USETOOLS in the previous version.
Noted by apb.


# 1.57 27-Mar-2008 dholland

Assorted updates and clarifications, grammar fixes and wording improvements,
and so on. Significant highlights:
- mention src/tests and reference atf;
- provide examples of MACHINE and MACHINE_ARCH;
- mention that MKOBJ=no is not recommended;
- correct the description of the default setting of USETOOLS;
- document the interactions of build.sh -[uo] with various things;
- document the interactions of build.sh tools and kernel=FOO;
- use a lot fewer parentheses.
Discussed on netbsd-docs.


# 1.56 17-Mar-2008 lukem

Consistently document RELEASEDIR/RELEASEMACHINEDIR.


# 1.55 08-Mar-2008 reed

Mention that "build" and "distribution" do not build nor install (to DESTDIR)
a kernel.


# 1.54 23-Nov-2007 sborrill

branches: 1.54.4;
Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items
to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.


# 1.53 01-Sep-2007 jnemeth

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.52 01-Sep-2007 jnemeth

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.


# 1.51 30-Aug-2007 jnemeth

describe new iso-image-source target


# 1.50 29-Aug-2007 ad

Remove STATUS paragraph which makes it sound like the build system is
half baked.


# 1.49 13-Apr-2007 apb

branches: 1.49.4;
Document recent changes to "make iso-image".


# 1.48 26-Mar-2007 apb

Document the fact that "make installworld" and "build.sh
installworld=..." do not install the etc or xetc sets. Suggest using
etcupdate(8) and postinstall(8) after installworld.


# 1.47 27-Jan-2007 apb

Try to clarify the description of build.sh -m mach.
Document new evbarm-eb and evbarm-el aliases.


# 1.46 08-Oct-2006 apb

branches: 1.46.2;
Clarify that DESTDIR/OBJDIR/etc are absolute paths, but build.sh
-D/-O/etc allows relative paths.

Closes PR 32345 by Andre Luiz de Oliveira.


# 1.45 04-Oct-2006 apb

Nitpicking. You won't see a difference in the text output, but there is
a difference in the postscript output.


# 1.44 29-Sep-2006 apb

Use ${HOST_SH} instead of the host system's /bin/sh wherever possible:

* Describe the HOST_SH variable, and the way build.sh attempts to set it.

* Suggest passing HOST_SH in the environment if /bin/sh is not a working
shell.


# 1.43 29-Jan-2006 apb

mkisofs is in pkgsrc/sysutils/cdrtools now, not pkgsrc/sysutils/cdrecord.
Reported by Jukka Salmi.


# 1.42 28-Jan-2006 apb

* Add an "iso-image" target in the top level Makefile,
which invokes make iso-image in the etc directory.
* Add an "iso-image" action in build.sh, which
invokes make iso-image.
* Document the above in doc/BUILDING.mdoc.
* Re-generate BUILDING.

Approved by christos


# 1.41 12-Jan-2006 wiz

Bump date for syspkgs.


# 1.40 04-Jan-2006 apb

Document "make syspkgs" and "build.sh syspkgs".

Reviewed by agc


# 1.39 20-Jun-2005 peter

Change all .Xr config 8 to .Xr config 1, following the recent move of
config from usr.sbin -> usr.bin.

Reviewed by wiz.


# 1.38 15-Feb-2005 reed

Document the environment variables for if you need to override or
manually select your compilers.
(And regen BUILDING from doc/BUILDING.mdoc.)


# 1.37 11-Oct-2004 jmc

Fix some typo's/bad wording as highlighted in PR#27219


# 1.36 25-Jun-2004 wiz

Document -h. From Karsten Kruse in PR 25974.
While here, remove a duplicate sentence.


# 1.35 19-Mar-2004 wiz

Document MKTTINTERP.


# 1.34 06-Feb-2004 lukem

* Document build.sh -X and -x
* Document MKX11 and X11SRCDIR
* Remove note warning against cross-building from systems other than NetBSD;
it works on many other platforms.


# 1.33 29-Dec-2003 jmc

Note tools/compat/README as the place to get notes from non-native cross builds


# 1.32 19-Dec-2003 zuntum

Change -v to -V in the following section:

"Print make(1)'s idea of the value of var. Does not build any targets."

To reflect reality.

Found by Tomasz Marciniak <Tomasz.Marciniak@felix.fizyka.amu.edu.pl>, thanks!


# 1.31 25-Oct-2003 lukem

Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
./build.sh -N 1 makewrapper

$TOOLDIR/bin/nbmake-$MACHINE
# runs at MAKEVERBOSE==1, with command lines suppressed

$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
# runs at MAKEVERBOSE==2 for this invocation, with command lines shown


# 1.30 24-Oct-2003 lukem

Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.


# 1.29 29-Sep-2003 lukem

provide a `%' for the non-root examples, as we show `#' for the root prompt.


# 1.28 07-Aug-2003 lukem

fix description of MAKEOBJDIR. from Martin Husemann


# 1.27 29-Jul-2003 lukem

Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.


# 1.26 17-Jul-2003 lukem

fix default location of TOOLDIR


# 1.25 18-Jul-2003 lukem

Update for the MKUNPRIVED/MKUPDATE changes.


# 1.24 17-Jul-2003 lukem

fix warning found by new groff


# 1.23 02-Jul-2003 lukem

attempt to clarify how MAKEOBJDIR{,PREFIX} may be provided ...
(this document needs a rototill, which i may get to whilst writing a
paper about build.sh)


# 1.22 25-May-2003 lukem

all:
* add "releasekernel=conf", to install a gzipped copy of the kernels
built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
* be more consistent in various status messages
* move the {release,}kernel=conf conf parsing code into getkernelconf()
and use in both buildkernel() and releasekernel()
* only warn once when building multiple kernels without updating the tools


# 1.21 18-May-2003 lukem

For normal builds, MKOBJDIRS default to `no' (not `yes').
It's only build.sh that sets this to `yes' by default.
Noted by OGAWA Takaya in [toolchain/19823]


# 1.20 17-May-2003 lukem

improve description of how "build.sh -m mach" sets the default
MACHINE_ARCH, and list the special cases that this does not occur for.


# 1.19 10-May-2003 lukem

crank date for previous


# 1.18 10-May-2003 lukem

Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets


# 1.17 08-May-2003 lukem

build.sh now provides defaults for DESTDIR and RELEASEDIR if not expert mode.
Remove -D and -R from EXAMPLES since they're not necessary any more.


# 1.16 08-Feb-2003 lukem

Fix example 3; the build.sh target is "install" not "installworld".
Improve description.
Noted by Valeriy Ushakov (uwe@) in private email.


# 1.15 02-Feb-2003 lukem

attempt to further improve and clarify the examples...


# 1.14 29-Jan-2003 lukem

Prefix various paths with 'DESTDIR', to highlight that the DESTDIR
is taken into account.


# 1.13 29-Jan-2003 lukem

allow toolprefix to be easily changed


# 1.12 26-Jan-2003 lukem

Various improvements per discussion with Alan Barrett.


# 1.11 25-Jan-2003 lukem

- Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.


# 1.10 25-Jan-2003 lukem

Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.


# 1.9 23-Jan-2003 lukem

Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below. Notes:
`-b' has been deprecated (it always occurs now)
`-d' is replaced by "distribution"
`-R rel' onlys sets RELEASEDIR; use "release" to build a release
`-k kern' has been replaced by "kernel=kern"
`-i idir' has been replaced by "install=idir"
-r now occurs before nbmake is rebuilt

Add a copyright (long due!). Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately. Allow `nb' prefix to be easily changed to
something else. Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


--8<-- new usage follows --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
[-w wrapper] [operation [...] ]

System build operations (all imply "obj" and "tools"):
build Run "make build"
distribution Run "make distribution" (includes etc/ files)
release Run "make release" (includes kernels & distrib media)

Other operations:
obj Run "make obj" (default unless -o)
tools Build and install tools
kernel=conf Build kernel with config file `conf'
install=idir Run "make installworld" to `idir'
(useful after 'distribution' or 'release')

Options:
-a arch Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
-B buildId Set BUILDID to buildId
-D dest Set DESTDIR to dest
-E Set "expert" mode; disables some DESTDIR checks
-j njob Run up to njob jobs in parallel; see make(1)
-M obj Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
-m mach Set MACHINE to mach (not required if NetBSD native)
-n Show commands that would be executed, but do not execute them
-O obj Set obj root directory to obj (sets a MAKEOBJDIR pattern)
-o Set MKOBJDIRS=no (do not create objdirs at start of build)
-R release Set RELEASEDIR to release
-r Remove contents of TOOLDIR and DESTDIR before building
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set UNPRIVED
-u Set UPDATE
-V v=[val] Set variable `v' to `val'
-w wrapper Create nbmake script as wrapper
(default: ${TOOLDIR}/bin/nbmake-${MACHINE})


# 1.8 04-Jan-2003 lukem

Add "-V var=[value]", for setting arbitrary variables which will also
be added to the nbmake-${MACHINE} wrapper.
Useful for setting RELEASEDIR, without -R's habit of building a release.


# 1.7 24-Dec-2002 lukem

Document:
* build.sh -i idir
* top level targets: distribution, buildworld, installworld
* top level variables: INSTALLWORLDDIR


# 1.6 18-Dec-2002 wiz

New sentence, new line; use Pa for paths.


# 1.5 08-Dec-2002 lukem

Add -E - "expert mode". If this is not specified, builds to DESTDIR=/ are
not permitted.
By using this flag, you are taking responsibility for any issues that
may occur because of this...


# 1.4 08-Dec-2002 lukem

- be consistent about option ordering in build.sh usage display
- use Fl and Ar instead of Sy and Em to format options


# 1.3 25-Nov-2002 wiz

Update location of BUILDING.mdoc.


# 1.2 20-Oct-2002 lukem

- Add support for ./build.sh -k kern, which configures and builds the named
kernel using the $TOOLDIR toolchain. If kern doesn't contain `/', it will
be searched for in ${KERNCONFDIR} (typically, sys/arch/${MACHINE}/conf).
- Improve ./build.sh usage.
- Add some examples to the documentation.

This is heavily based on [toolchain/18739] from Alan Barrett <apb@cequrux.com>,
with improvements by me.


# 1.1 21-Sep-2002 lukem

move BUILDING.mdoc -> doc/BUILDING.mdoc


# 1.46.2.3 29-Sep-2007 xtraeme

Pull up following revision(s) (requested by jnemeth in ticket #864):
distrib/common/Makefile.bootcd: revision 1.9
distrib/common/Makefile.bootcd: revision 1.10
distrib/common/Makefile.bootcd: revision 1.11
doc/BUILDING.mdoc: revision 1.51
doc/BUILDING.mdoc: revision 1.52
doc/BUILDING.mdoc: revision 1.53
build.sh: revision 1.172
build.sh: revision 1.173
build.sh: revision 1.174
build.sh: revision 1.175
BUILDING: revision 1.64
BUILDING: revision 1.65
BUILDING: revision 1.66
share/man/man7/release.7: revision 1.23
share/man/man7/release.7: revision 1.24
Makefile: revision 1.248

Add an iso-dir=directory option. When combined with iso-image or
iso-image-source, it will cause directory to be added to the CD-ROM image.

Convert build.sh iso-dir=directory option to -C cddir as per jmmv@ on
source-changes.


# 1.46.2.2 16-Apr-2007 bouyer

branches: 1.46.2.2.2;
Pull up following revision(s) (requested by apb in ticket #573):
share/man/man8/sysinst.8: revision 1.1
distrib/sets/lists/man/mi: revision 1.987
share/man/man8/Makefile: revision 1.89
BUILDING: revision 1.62
share/man/man7/release.7: revision 1.22
doc/BUILDING.mdoc: revision 1.49
Improve documentation for "make iso-image" and release(7),
and add a rudimentary man page for sysinst(8).


# 1.46.2.1 16-Apr-2007 bouyer

Pull up following revision(s) (requested by apb in ticket #572):
BUILDING: revision 1.61
doc/BUILDING.mdoc: revision 1.48
Improve documentation for "make installworld".


# 1.46.2.2.2.1 30-Sep-2007 wrstuden

Catch up w/ last night's netbsd-4


# 1.49.4.3 22-Mar-2008 matt

sync with HEAD


# 1.49.4.2 08-Jan-2008 matt

sync with HEAD


# 1.49.4.1 06-Nov-2007 matt

sync with HEAD


# 1.54.4.1 24-Mar-2008 keiichi

sync with head.


# 1.58.2.1 18-May-2008 yamt

sync with head.


# 1.59.4.2 23-Sep-2008 wrstuden

Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.


# 1.59.4.1 17-Sep-2008 wrstuden

Sync with wrstuden-revivesa-base-2.


# 1.59.2.2 05-Oct-2008 mjf

Sync with HEAD.


# 1.59.2.1 30-Apr-2008 mjf

file BUILDING.mdoc was added on branch mjf-devfs2 on 2008-10-05 20:11:18 +0000


# 1.67.2.3 11-May-2009 bouyer

Pull up following revision(s) (requested by snj in ticket #742):
doc/BUILDING.mdoc: revision 1.72
external/mit/xorg/lib/freetype/Makefile: revision 1.5
BUILDING: revision 1.83
Introduce MKSUBPIXEL, which allows enabling subpixel rendering code
in FreeType.


# 1.67.2.2 15-Nov-2008 snj

branches: 1.67.2.2.4;
Pull up following revision(s) (requested by mrg in ticket #64):
share/man/man5/mk.conf.5: revision 1.46
share/mk/bsd.own.mk: revision 1.550
doc/BUILDING.mdoc: revision 1.70
BUILDING: revision 1.81
share/mk/bsd.README: revision 1.242
revert sparc back to default of XFree86 at the request of macallan.


# 1.67.2.1 15-Nov-2008 snj

Pull up following revision(s) (requested by mrg in ticket #64):
distrib/sets/Makefile: revision 1.64
external/mit/xorg/server/Makefile: revision 1.5
share/mk/bsd.README: revision 1.237
BUILDING: revision 1.79
share/mk/bsd.x11.mk: revision 1.71
share/mk/bsd.own.mk: revision 1.544
usr.bin/ssh/Makefile.inc: revision 1.18
distrib/sets/sets.subr: revision 1.72
share/man/man5/mk.conf.5: revision 1.42
doc/BUILDING.mdoc: revision 1.68
etc/Makefile: revision 1.360
Makefile: revision 1.263
- retire MKXORG from public use
- introduce X11FLAVOUR to choose src/x11 vs src/external/mit/xorg
for the X11 to build if MKX11=yes is set. it takes the values
of either Xorg or XFree86.
- default to Xorg on alpha, i386, macppc, shark, sparc and sparc64
- remove MKXORG_WITH_XSRC_XSERVER, unused and never useful


# 1.67.2.2.4.1 20-May-2011 matt

bring matt-nb5-mips64 up to date with netbsd-5-1-RELEASE (except compat).


# 1.71.2.1 13-May-2009 jym

Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html


# 1.85.2.4 22-May-2014 yamt

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")


# 1.85.2.3 15-Jan-2013 yamt

sync with (a bit old) head


# 1.85.2.2 30-Oct-2012 yamt

sync with head


# 1.85.2.1 16-Apr-2012 yamt

sync with head


# 1.87.2.2 14-Apr-2015 msaitoh

Pull up following revision(s) (requested by riastradh in ticket #1274):
doc/BUILDING.mdoc: revision 1.111
Use `It Sy', not just `It', for live-image, to match other targets.
No change to plain-text BUILDING file.


# 1.87.2.1 02-Mar-2012 riz

Pull up following revision(s) (requested by tsutsui in ticket #68):
doc/BUILDING.mdoc: revision 1.88
BUILDING: revision 1.99
build.sh: revision 1.254
Add a missing period.
Add sanity checks for live-image and install-image targets
(which require mtree spec files built with MKUNPRIVED=yes)
to avoid unexpected makefs(8) error during image builds:
- if release op is specified with live-image or install-image
at the same time, make sure -U is also specified for the image builds
- before perform live-image and install-image ops check METALOG file
in DESTDIR to see if the build have been performed with MKUNPRIVED
XXX: Probably toolchain should create consistent spec files in
XXX: DESTDIR/etc/mtree dir regardless of MKUNPRIVED settings.


# 1.89.2.3 19-Aug-2014 tls

Rebase to HEAD as of a few days ago.


# 1.89.2.2 23-Jun-2013 tls

resync from head


# 1.89.2.1 19-Nov-2012 tls

Resync to 2012-11-19 00:00:00 UTC


# 1.95.2.1 10-Aug-2014 tls

Rebase.


# 1.104.2.2 18-Mar-2015 snj

Pull up following revision(s) (requested by riastradh in ticket #611):
doc/BUILDING.mdoc: revision 1.111
Use `It Sy', not just `It', for live-image, to match other targets.
No change to plain-text BUILDING file.


# 1.104.2.1 14-Nov-2014 martin

Pull up following revision(s) (requested by snj in ticket #227):
Makefile: revision 1.311
build.sh: revision 1.299
doc/BUILDING.mdoc: revision 1.105
distrib/notes/macppc/prep.OPENFIRMWARE: revision 1.16
distrib/notes/macppc/prep.OPENFIRMWARE: revision 1.17
BUILDING: revision 1.110
distrib/notes/arc/prep: revision 1.3
distrib/notes/arc/prep: revision 1.4
distrib/notes/cats/prep: revision 1.12
distrib/notes/cats/prep: revision 1.13
distrib/notes/sparc/install: revision 1.58
distrib/notes/common/main: revision 1.512
share/man/man8/man8.macppc/ofwboot.8: revision 1.13
Update path to release ISOs.