Commit Graph

377 Commits

Author SHA1 Message Date
martin 2ac6a76527 For consistency, check MKREPRO_TIMESTAMP always numerically (not as string) 2024-04-23 07:47:36 +00:00
rillig 39cc76d687 build.sh: fix typos in usage message 2024-04-20 12:25:46 +00:00
thorpej b1992656bd Add virt68k to valid_MACHINE_ARCH. 2024-01-03 02:48:45 +00:00
khorben 599f59ef37 build.sh: add support for git worktree
Git supports multiple working trees attached to the same repository,
with the git-worktree(1) subcommand.

When building from a Git working tree, the repository metadata in .git
from the top source directory is a file (containing the actual location
of the metadata) instead of the usual directory structure. With this
change, build.sh allows .git to be a directory or a regular file
instead, therefore letting the sources build as expected from a Git
working tree.

To test: (without this patch)

    src$ git worktree add ../src-clean-tree
    [...]
    src$ (cd ../src-clean-tree && ./build.sh tools)
    [...]
    ERROR: Cannot determine VCS for '.../src-clean-tree/'

XXX: pullup-10 pullup-9
2023-09-04 02:21:17 +00:00
lukem 3cb563b335 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).
2023-07-18 16:59:57 +00:00
christos 60ac4a8d22 fix build.sh wrong variable use that caused nbmake to be always rebult
(Jan-Benedict Glaw)
2023-06-13 16:56:00 +00:00
lukem 439f74ef3e build.sh: add show-params operation
Add show-params operation to the makefile target, and reword
params operation to describe what it's done since 2012.

(In 2012-11-04 the Makefile's previous params target was renamed
to show-params and a new params target was added to save a 'params'
file, and build.sh wasn't adapted.)
2023-06-02 20:48:09 +00:00
lukem bd4a734738 build.sh: fix MKUNPRIVED comment
I renamed UNPRIVED to MKUNPRIVED 20 years ago, and missed a comment.
2023-06-02 14:29:11 +00:00
lukem 9d6c4a2602 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, -?
2023-05-16 21:39:26 +00:00
uwe 48f6c7b4a9 build.sh: drop -lrumpdev hack introduced in previous
The existing trick in sys/rump/librump/rumpdev/rump_dev.c was not
updated after the renames in the kernel.  kudos to riastradh.

PR kern/56599
2023-04-23 09:54:15 +00:00
uwe 0534fe7cff build.sh: tweak rumptest and RUMP_LIBSETS
Use --no-whole-archive to keep us as honest as currently possible.
PR kern/56599
2023-04-23 02:01:33 +00:00
martin 0a7d854139 Avoid the dependency on a populated tooldir (or building the tools)
when simply doing mkrepro-timestamp and the current repository setups
does not actually require it.
2023-03-13 11:52:29 +00:00
lukem 57544d3e7a build.sh: usage improvements
Use UPPERCASE as the convention to describe an option argument,
as it's more noticable than lowercase in the help description.

Expand tabs in the help.

Editorial improvements.
2022-08-21 07:57:50 +00:00
lukem dac6dcb8de 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.
2022-08-21 07:10:03 +00:00
lukem 262db5143c build.sh: improve help and usage
Split help into synopsis and help.
Only display the synopsis for usage errors (not the full help).
Print usage errors to stderr not stdout.
Don't print a usage error for -? before the help message.
Improve error messages for unknown options and missing arguments.
Remove trailing "." present in some error messages.
Alway use 'quote' instead of `quote' in some error messages.
2022-08-15 10:06:00 +00:00
lukem 546bd46b3f build.sh: improve help versus usage
Rework help / usage semantics:
- send help to stdout, exit 0.
- send usage to stderr, exit 1.
2022-08-14 08:51:41 +00:00
christos 42322eb309 Don't try to install netbsd-CONFIG.debug files build with kernel= 2021-12-31 15:43:35 +00:00
christos 508aca192c Enable split-debug files for kernels. Enabled by default with MKDEBUG=yes. 2021-12-29 22:22:12 +00:00
andvar 50d9072672 remove duplicate the article in comments. 2021-10-04 21:02:39 +00:00
christos a043955316 Patch the build script and toolchain to allow passing through
HOST_CPPFLAGS, HOST_CXXFLAGS, but not LIBRARY_PATH because it breaks
the build. These variables are necessary to support building NetBSD
from a GNU Guix or NixOS host, where /usr/include, /lib, and all
but /bin/sh do not exist.  In many cases, support for HOST_CPPFLAGS
was incomplete. From Ryan Sundberg
2021-09-18 01:47:07 +00:00
joerg 35651030d4 Fix timestamp extraction logic for Mercurial repos to use UTC.
Extend logic to also cover "hg archive".
2021-09-17 21:22:38 +00:00
martin 0593793640 Add a new operation "mkrepro-timestamp" to extract the timestamp a
build with -P would use. Example usage:

	./build.sh -T /usr/tools -P mkrepro-timestamp

This allows us to extract this information once, make other use of it,
and replicate it on other machines with -V MKREPRO=yes -V MKREPRO_TIMESTAMP=..
2021-09-09 15:00:01 +00:00
christos dfff0ece03 Fix rumptest target && enable separate rump target. From Damien Zammit 2021-08-29 09:02:01 +00:00
andvar ba70c588fa fix various typos in comments. 2021-08-06 07:55:13 +00:00
christos 9f4fca625f Good bye oabi! Tested building earmv7hf. 2021-06-07 17:11:16 +00:00
christos 9cdb453da9 kre@ does not like the subshell :-) 2021-05-27 21:03:26 +00:00
christos 585ea1052c handle different flavors of date(1) 2021-05-26 21:58:58 +00:00
christos 319ee229aa for mercurial, use the latest revision instead of limiting the output to 1
(requested by joerg)
2021-05-17 17:12:12 +00:00
christos 47bc05a6ad Handle git and mercurial for reproducible builds. 2021-05-17 13:50:39 +00:00
christos b307b81829 ignore cvslatest errors in expert mode 2021-05-14 22:06:34 +00:00
christos 609e726869 Add mipsn64e[bl] targets which use 64 bit binaries instead of n32 ones. 2021-04-25 22:29:22 +00:00
martin 9fe2206466 Modify the generated make wrapper to avoid complaints about
non-writable OBJDIR from make (which happen a lot when cross-building
kernels re-using a makewrapper build for some other user).
2021-01-28 10:36:27 +00:00
mrg 8866db620f add "distsets" alias for "distribution sets". 2020-09-20 10:29:05 +00:00
kim 3282a44e58 Fix typo in usage 2020-09-14 09:02:11 +00:00
rillig ff40d26ffb make(1): remove references to the removed lst.lib 2020-07-26 09:17:24 +00:00
riastradh 8039b48b5b 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'.
2020-06-30 21:22:19 +00:00
riastradh 4c4351ef4f Nix trailing whitespace. 2020-06-13 18:00:29 +00:00
lukem 05b5ecc6fd nbmake bootstrap: silent configure if MAKEVERBOSE==0
Be consistent with the silencing of configure in tools/
and suppress the output in build.sh configure of nbmake
2020-06-13 11:42:47 +00:00
rin db045f7da9 Add missing MACHINE_ARCH=earmv5hf{,eb} for evbarm. 2020-05-24 04:55:53 +00:00
jmcneill 6f52454d94 When MACHINE_ARCH is missing, give direction on how to get a list of valid options 2020-05-23 17:26:32 +00:00
jmcneill 6437518a34 Remove plain "earm" targets, and require an explicit MACHINE_ARCH for
evbarm instead of selecting a default.
2020-05-23 11:04:43 +00:00
jmcneill a7f3ee8944 Remove evbarm OABI targets 2020-05-23 10:59:25 +00:00
jmcneill 043d88a7c1 Separate devicetree .dts -> .dtb building from kernel builds. They are now
part of a separate set, "dtb.tgz", and only built when MKDTB=yes. This
defaults to yes for earmv[67]* and aarch64, and no everywhere else.
2020-05-18 21:19:34 +00:00
jmcneill 116200ae1b Allow path components that start with ~ 2020-03-28 20:13:13 +00:00
sborrill 06c7dd3e11 Fix long-term broken pattern match when determining if uname -p output is
valid. [^a-z] syntax isn't valid.
2019-06-07 15:49:20 +00:00
mrg 5426352fee on netbsd when defaulting to the native system, also derived MACHINE_ARCH
from the uname -p value already fetched.

this means eg, build.sh on evbarm will build the native platform rather
than "earm" (armv5) -- which was the default even on arm64 hosts.
2019-05-02 02:51:01 +00:00
pgoyette dedd8aee9b Tyop in error message... 2019-04-25 05:12:49 +00:00
mrg 56608fa62e add aliases for evbarm without saying 'earm':
- copy all the 'evbearm' alias as 'evbarm'.
2019-02-08 02:05:32 +00:00
christos 0a37cd5ef4 add build libs (undocumented). 2018-12-30 23:19:40 +00:00
christos 53e133006b Add some aliases (from phone) 2018-08-09 08:30:29 +00:00