Date: Sat, 10 Jan 2026 21:33:56 +0000 From: Simon J. Gerraty <sjg@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: f580ef8a75c1 - stable/14 - Merge bmake-20230909 Message-ID: <6962c5c4.25b9d.5492a1b8@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f580ef8a75c133ac75407ee1583cdb9cdb1f98c3 commit f580ef8a75c133ac75407ee1583cdb9cdb1f98c3 Author: Simon J. Gerraty <sjg@FreeBSD.org> AuthorDate: 2023-09-18 01:05:19 +0000 Commit: Simon J. Gerraty <sjg@FreeBSD.org> CommitDate: 2026-01-10 21:33:10 +0000 Merge bmake-20230909 Merge commit '1012cf15f75d1e9048779abd07270a37cdba590a' (cherry picked from commit 988758838533b24f5893b36514fe2c68a3f911a2) --- contrib/bmake/ChangeLog | 78 +++++++ contrib/bmake/VERSION | 2 +- contrib/bmake/bmake.1 | 34 +++- contrib/bmake/bmake.cat1 | 48 +++-- contrib/bmake/boot-strap | 4 +- contrib/bmake/cond.c | 23 +-- contrib/bmake/configure | 61 ++++-- contrib/bmake/configure.in | 51 +++-- contrib/bmake/import.sh | 34 +++- contrib/bmake/install-sh | 20 +- contrib/bmake/main.c | 47 ++++- contrib/bmake/make-bootstrap.sh.in | 1 + contrib/bmake/make.1 | 34 +++- contrib/bmake/make.h | 15 +- contrib/bmake/meta.c | 9 +- contrib/bmake/mk/ChangeLog | 43 ++++ contrib/bmake/mk/FILES | 1 + contrib/bmake/mk/dirdeps.mk | 22 +- contrib/bmake/mk/install-mk | 6 +- contrib/bmake/mk/install-sh | 226 +++++++++++++++++++++ contrib/bmake/mk/jobs.mk | 24 ++- contrib/bmake/mk/lib.mk | 6 +- contrib/bmake/mk/meta.autodep.mk | 4 +- contrib/bmake/mk/mk-files.txt | 16 +- contrib/bmake/mk/rst2htm.mk | 8 +- contrib/bmake/mk/sys.mk | 20 +- contrib/bmake/mk/sys/IRIX.mk | 13 +- contrib/bmake/parse.c | 35 ++-- contrib/bmake/unit-tests/Makefile | 22 +- contrib/bmake/unit-tests/cond-cmp-numeric-eq.mk | 7 +- contrib/bmake/unit-tests/cond-cmp-numeric-ge.mk | 4 +- contrib/bmake/unit-tests/cond-cmp-numeric-gt.mk | 6 +- contrib/bmake/unit-tests/cond-cmp-numeric-le.mk | 4 +- contrib/bmake/unit-tests/cond-cmp-numeric-lt.mk | 4 +- contrib/bmake/unit-tests/cond-cmp-numeric-ne.mk | 4 +- contrib/bmake/unit-tests/cond-func-empty.exp | 4 +- contrib/bmake/unit-tests/cond-func-empty.mk | 36 +++- contrib/bmake/unit-tests/cond-op-and.mk | 10 +- contrib/bmake/unit-tests/cond-op-or.mk | 10 +- contrib/bmake/unit-tests/dep-op-missing.exp | 2 +- contrib/bmake/unit-tests/directive-dinclude.exp | 2 +- contrib/bmake/unit-tests/directive-dinclude.mk | 4 +- .../bmake/unit-tests/directive-export-gmake.exp | 6 +- contrib/bmake/unit-tests/directive-export-gmake.mk | 27 ++- contrib/bmake/unit-tests/directive-export.exp | 3 + contrib/bmake/unit-tests/directive-export.mk | 19 +- contrib/bmake/unit-tests/directive-for-escape.exp | 83 +++++--- contrib/bmake/unit-tests/directive-for-escape.mk | 46 ++++- .../bmake/unit-tests/directive-hyphen-include.exp | 2 +- .../bmake/unit-tests/directive-hyphen-include.mk | 4 +- .../bmake/unit-tests/directive-include-guard.exp | 16 +- .../bmake/unit-tests/directive-include-guard.mk | 74 +++---- contrib/bmake/unit-tests/directive-include.exp | 2 +- contrib/bmake/unit-tests/directive-include.mk | 4 +- contrib/bmake/unit-tests/directive-sinclude.exp | 2 +- contrib/bmake/unit-tests/directive-sinclude.mk | 4 +- contrib/bmake/unit-tests/directive.exp | 8 +- contrib/bmake/unit-tests/directive.mk | 10 +- contrib/bmake/unit-tests/opt-debug-graph1.exp | 1 + contrib/bmake/unit-tests/opt-debug-graph2.exp | 1 + contrib/bmake/unit-tests/opt-debug-graph3.exp | 1 + contrib/bmake/unit-tests/opt-jobs.mk | 56 ++++- contrib/bmake/unit-tests/parse.exp | 6 +- contrib/bmake/unit-tests/parse.mk | 8 +- contrib/bmake/unit-tests/suff-main-several.exp | 1 + contrib/bmake/unit-tests/suff-transform-debug.exp | 1 + contrib/bmake/unit-tests/var-op-assign.exp | 2 +- contrib/bmake/unit-tests/var-op-assign.mk | 4 +- contrib/bmake/unit-tests/varmod-gmtime.mk | 31 ++- contrib/bmake/unit-tests/varmod-ifelse.exp | 26 ++- contrib/bmake/unit-tests/varmod-ifelse.mk | 54 ++++- contrib/bmake/unit-tests/varmod-mtime.exp | 9 +- contrib/bmake/unit-tests/varmod-mtime.mk | 86 ++++++-- contrib/bmake/unit-tests/varname-dot-make-jobs.exp | 2 +- contrib/bmake/unit-tests/varname-dot-make-jobs.mk | 27 ++- contrib/bmake/unit-tests/varname.exp | 2 +- contrib/bmake/unit-tests/varname.mk | 4 +- contrib/bmake/var.c | 53 +++-- usr.bin/bmake/Makefile.config | 2 +- usr.bin/bmake/config.h | 4 +- usr.bin/bmake/unit-tests/Makefile | 22 +- 81 files changed, 1309 insertions(+), 408 deletions(-) diff --git a/contrib/bmake/ChangeLog b/contrib/bmake/ChangeLog index dd1fdf110ab4..ec0be0f4027c 100644 --- a/contrib/bmake/ChangeLog +++ b/contrib/bmake/ChangeLog @@ -1,3 +1,81 @@ +2023-09-09 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20230909 + Merge with NetBSD make, pick up + o main.c: allow -j to compute a multiple of ncpu + If _SC_NPROCESSORS_ONLN is supported; and -j arg is a floating + point number or ends in 'C' compute .MAKE.JOBS as a multiple of + _SC_NPROCESSORS_ONLN + .MAKE.JOBS.C will be "yes" if -jC is supported + +2023-08-20 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20230820 + Merge with NetBSD make, pick up + o make.1: note that :localtime is better for %s + o parse.c: improve error messages for invalid input. + o var.c: fix for %s:L:gmtime - set TZ=UTC and use localtime to get + correct result, it is still better to use %s:L:localtime. + +2023-08-18 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20230818 + Merge with NetBSD make, pick up + o meta.c: meta_ignore - check raw path against metaIgnorePaths + to potentially skip call to realpath. + o var.c: be strict when parsing the argument of the ':mtime' modifier + o unit-tests/varmod-mtime.mk: document why '${%s:L:localtime}' + should be used to get an equivalent value to time(3). + +2023-08-16 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20230816 + Merge with NetBSD make, pick up + o cond.c: clean up multiple-inclusion guards + +2023-07-25 Simon J Gerraty <sjg@beast.crufty.net> + + * unit-tests/Makefile: addd varmod-localtime to BROKEN_TESTS + if configure cannot work out how to control TZ. + Remove varmod-localtime from BROKEN_TESTS for IRIX* + +2023-07-24 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20230723 + + * configure.in: fix the test for wether TZ=Europe/Berlin works. + Depending on the time of year, if run between 22:00 and 00:00 UTC + the check in configure would fail incorrectly. + Take the day into account as well. + +2023-07-18 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20230711 + Merge with NetBSD make, pick up + o make.1: clean up wording, clarify scope of '!' in conditions + +2023-07-15 Simon J Gerraty <sjg@beast.crufty.net> + + * make-bootstrap.sh.in: set prefix + If configure is run using ksh we get unexpanded ${prefix} in + DEFAULT_SYS_PATH, by ensuring prefix is set we should still get + correct result. + +2023-07-13 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20230711 + bump version for IRIX tweaks + + * make.h: undef OP_NONE if defined + + * unit-tests/Makefile: set BROKEN_TESTS for IRIX + + * configure.in: override INSTALL on IRIX + +2023-06-27 Simon J Gerraty <sjg@beast.crufty.net> + + * boot-strap op_test: ensure we set TEST_MAKE as we want it. + 2023-06-22 Simon J Gerraty <sjg@beast.crufty.net> * VERSION (_MAKE_VERSION): 20230622 diff --git a/contrib/bmake/VERSION b/contrib/bmake/VERSION index f82791fcbac8..0cc67de7b22d 100644 --- a/contrib/bmake/VERSION +++ b/contrib/bmake/VERSION @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20230622 +_MAKE_VERSION=20230909 diff --git a/contrib/bmake/bmake.1 b/contrib/bmake/bmake.1 index bfa0f2d74d0a..a658eab6700e 100644 --- a/contrib/bmake/bmake.1 +++ b/contrib/bmake/bmake.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.366 2023/05/10 18:22:33 sjg Exp $ +.\" $NetBSD: make.1,v 1.371 2023/09/10 21:52:36 rillig Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd May 10, 2023 +.Dd September 9, 2023 .Dt BMAKE 1 .Os .Sh NAME @@ -267,6 +267,12 @@ cooperate to avoid overloading the system. Specify the maximum number of jobs that .Nm may have running at any one time. +If +.Ar max_jobs +is a floating point number, or ends with +.Ql C , +then the value is multiplied by the number of CPUs reported online by +.Xr sysconf 3 . The value of .Ar max_jobs is saved in @@ -971,6 +977,11 @@ making it easier to track the degree of parallelism being achieved. The argument to the .Fl j option. +.It Va .MAKE.JOBS.C +A read-only boolean that indicates whether the +.Fl j +option supports use of +.Ql C . .It Va .MAKE.LEVEL The recursion depth of .Nm . @@ -1497,6 +1508,10 @@ The value is interpreted as a format string for using .Xr gmtime 3 , producing the formatted timestamp. +Note: the +.Ql %s +format should only be used with +.Sq Cm \&:localtime . If a .Ar timestamp value is not provided or is 0, the current time is used. @@ -2069,7 +2084,7 @@ only evaluates a conditional as far as is necessary to determine its value. Parentheses can be used to override the operator precedence. The boolean operator .Sq Ic \&! -may be used to logically negate an entire conditional. +may be used to logically negate an expression, typically a function call. It is of higher precedence than .Sq Ic \&&& . .Pp @@ -2119,9 +2134,9 @@ may also be an arithmetic or string comparison. Variable expansion is performed on both sides of the comparison. If both sides are numeric and neither is enclosed in quotes, the comparison is done numerically, otherwise lexicographically. -A string is interpreted as hexadecimal integer if it is preceded by +A string is interpreted as a hexadecimal integer if it is preceded by .Li 0x , -otherwise it is a decimal floating-point number; +otherwise it is interpreted as a decimal floating-point number; octal numbers are not supported. .Pp All comparisons may use the operators @@ -2142,7 +2157,7 @@ and its numeric value (if any) is not zero. When .Nm is evaluating one of these conditional expressions, and it encounters -a (whitespace separated) word it doesn't recognize, either the +a (whitespace-separated) word it doesn't recognize, either the .Dq make or .Dq defined @@ -2165,12 +2180,13 @@ function is applied. .Pp If the conditional evaluates to true, parsing of the makefile continues as before. -If it evaluates to false, the following lines are skipped. -In both cases, this continues until the corresponding +If it evaluates to false, the following lines until the corresponding +.Sq Ic .elif +variant, .Sq Ic .else or .Sq Ic .endif -is found. +are skipped. .Ss For loops For loops are typically used to apply a set of rules to a list of files. The syntax of a for loop is: diff --git a/contrib/bmake/bmake.cat1 b/contrib/bmake/bmake.cat1 index 6f69dfb9f3ad..bdd48dda11db 100644 --- a/contrib/bmake/bmake.cat1 +++ b/contrib/bmake/bmake.cat1 @@ -157,15 +157,17 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1) [1m-j [4m[22mmax_jobs[0m Specify the maximum number of jobs that [1mbmake [22mmay have running at - any one time. The value of [4mmax_jobs[24m is saved in [4m.MAKE.JOBS[24m. - Turns compatibility mode off, unless the [1m-B [22moption is also speci- - fied. When compatibility mode is off, all commands associated - with a target are executed in a single shell invocation as op- - posed to the traditional one shell invocation per line. This can - break traditional scripts which change directories on each com- - mand invocation and then expect to start with a fresh environment - on the next line. It is more efficient to correct the scripts - rather than turn backwards compatibility on. + any one time. If [4mmax_jobs[24m is a floating point number, or ends + with `C', then the value is multiplied by the number of CPUs re- + ported online by sysconf(3). The value of [4mmax_jobs[24m is saved in + [4m.MAKE.JOBS[24m. Turns compatibility mode off, unless the [1m-B [22moption + is also specified. When compatibility mode is off, all commands + associated with a target are executed in a single shell invoca- + tion as opposed to the traditional one shell invocation per line. + This can break traditional scripts which change directories on + each command invocation and then expect to start with a fresh en- + vironment on the next line. It is more efficient to correct the + scripts rather than turn backwards compatibility on. A job token pool with [4mmax_jobs[24m tokens is used to control the to- tal number of jobs running. Each instance of [1mbmake [22mwill wait for @@ -625,6 +627,10 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1) [4m.MAKE.JOBS[0m The argument to the [1m-j [22moption. + [4m.MAKE.JOBS.C[0m + A read-only boolean that indicates whether the [1m-j [22moption supports + use of `C'. + [4m.MAKE.LEVEL[0m The recursion depth of [1mbmake[22m. The top-level instance of [1mbmake[0m has level 0, and each child make has its parent level plus 1. @@ -972,8 +978,9 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1) [1m:gmtime[22m[[1m=[4m[22mtimestamp[24m] The value is interpreted as a format string for strftime(3), using - gmtime(3), producing the formatted timestamp. If a [4mtimestamp[24m value - is not provided or is 0, the current time is used. + gmtime(3), producing the formatted timestamp. Note: the `%s' format + should only be used with `[1m:localtime[22m'. If a [4mtimestamp[24m value is not + provided or is 0, the current time is used. [1m:hash[0m Computes a 32-bit hash of the value and encodes it as 8 hex digits. @@ -1313,8 +1320,8 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1) [1mbmake [22monly evaluates a conditional as far as is necessary to determine its value. Parentheses can be used to override the operator precedence. - The boolean operator `[1m![22m' may be used to logically negate an entire condi- - tional. It is of higher precedence than `[1m&&[22m'. + The boolean operator `[1m![22m' may be used to logically negate an expression, + typically a function call. It is of higher precedence than `[1m&&[22m'. The value of [4mexpression[24m may be any of the following function call expres- sions: @@ -1346,9 +1353,9 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1) [4mExpression[24m may also be an arithmetic or string comparison. Variable ex- pansion is performed on both sides of the comparison. If both sides are numeric and neither is enclosed in quotes, the comparison is done numeri- - cally, otherwise lexicographically. A string is interpreted as hexadeci- - mal integer if it is preceded by 0x, otherwise it is a decimal floating- - point number; octal numbers are not supported. + cally, otherwise lexicographically. A string is interpreted as a hexa- + decimal integer if it is preceded by 0x, otherwise it is interpreted as a + decimal floating-point number; octal numbers are not supported. All comparisons may use the operators `[1m==[22m' and `[1m!=[22m'. Numeric comparisons may also use the operators `[1m<[22m', `[1m<=[22m', `[1m>[22m' and `[1m>=[22m'. @@ -1358,16 +1365,15 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1) any) is not zero. When [1mbmake [22mis evaluating one of these conditional expressions, and it en- - counters a (whitespace separated) word it doesn't recognize, either the + counters a (whitespace-separated) word it doesn't recognize, either the "make" or "defined" function is applied to it, depending on the form of the conditional. If the form is `[1m.ifdef[22m', `[1m.ifndef[22m' or `[1m.if[22m', the "defined" function is applied. Similarly, if the form is `[1m.ifmake[22m' or `[1m.ifnmake[22m', the "make" function is applied. If the conditional evaluates to true, parsing of the makefile continues - as before. If it evaluates to false, the following lines are skipped. - In both cases, this continues until the corresponding `[1m.else[22m' or `[1m.endif[22m' - is found. + as before. If it evaluates to false, the following lines until the cor- + responding `[1m.elif[22m' variant, `[1m.else[22m' or `[1m.endif[22m' are skipped. [1mFor loops[0m For loops are typically used to apply a set of rules to a list of files. @@ -1753,4 +1759,4 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1) attempt to suppress a cascade of unnecessary errors, can result in a seemingly unexplained `*** Error code 6' -FreeBSD 13.0 May 10, 2023 FreeBSD 13.0 +FreeBSD 13.0 September 9, 2023 FreeBSD 13.0 diff --git a/contrib/bmake/boot-strap b/contrib/bmake/boot-strap index 8892f2b1c990..f47f0c4fdecd 100755 --- a/contrib/bmake/boot-strap +++ b/contrib/bmake/boot-strap @@ -119,7 +119,7 @@ # Simon J. Gerraty <sjg@crufty.net> # RCSid: -# $Id: boot-strap,v 1.57 2021/10/22 20:32:21 sjg Exp $ +# $Id: boot-strap,v 1.58 2023/06/27 21:02:19 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -420,7 +420,7 @@ op_build() { op_test() { [ -x bmake ] || op_build - Bmake test "$@" TEST_MAKE=$objdir/bmake || exit 1 + Bmake test TEST_MAKE=$objdir/bmake "$@" || exit 1 } op_clean() { diff --git a/contrib/bmake/cond.c b/contrib/bmake/cond.c index 9a389ae6a92d..4ed15ff26184 100644 --- a/contrib/bmake/cond.c +++ b/contrib/bmake/cond.c @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.353 2023/06/23 05:21:10 rillig Exp $ */ +/* $NetBSD: cond.c,v 1.354 2023/08/11 04:56:31 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -92,7 +92,7 @@ #include "dir.h" /* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: cond.c,v 1.353 2023/06/23 05:21:10 rillig Exp $"); +MAKE_RCSID("$NetBSD: cond.c,v 1.354 2023/08/11 04:56:31 rillig Exp $"); /* * Conditional expressions conform to this grammar: @@ -224,17 +224,13 @@ ParseWord(const char **pp, bool doEval) if ((ch == '&' || ch == '|') && paren_depth == 0) break; if (ch == '$') { - /* - * Parse the variable expression and install it as - * part of the argument if it's valid. We tell - * Var_Parse to complain on an undefined variable, - * (XXX: but Var_Parse ignores that request) - * so we don't need to do it. Nor do we return an - * error, though perhaps we should. - */ VarEvalMode emode = doEval ? VARE_UNDEFERR : VARE_PARSE_ONLY; + /* + * TODO: make Var_Parse complain about undefined + * variables. + */ FStr nestedVal = Var_Parse(&p, SCOPE_CMDLINE, emode); /* TODO: handle errors */ Buf_AddStr(&word, nestedVal.str); @@ -1267,7 +1263,6 @@ Cond_ExtractGuard(const char *line) { const char *p, *varname; Substring dir; - enum GuardKind kind; Guard *guard; p = line + 1; /* skip the '.' */ @@ -1288,10 +1283,9 @@ Cond_ExtractGuard(const char *line) const char *arg_p = p; free(ParseWord(&p, false)); if (strcmp(p, ")") == 0) { - char *target = ParseWord(&arg_p, true); guard = bmake_malloc(sizeof(*guard)); guard->kind = GK_TARGET; - guard->name = target; + guard->name = ParseWord(&arg_p, true); return guard; } } @@ -1302,9 +1296,8 @@ Cond_ExtractGuard(const char *line) return NULL; found_variable: - kind = GK_VARIABLE; guard = bmake_malloc(sizeof(*guard)); - guard->kind = kind; + guard->kind = GK_VARIABLE; guard->name = bmake_strsedup(varname, p); return guard; } diff --git a/contrib/bmake/configure b/contrib/bmake/configure index 44f016b249e1..9d6130f66c84 100755 --- a/contrib/bmake/configure +++ b/contrib/bmake/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for bmake 20220909. +# Generated by GNU Autoconf 2.71 for bmake 20230723. # # Report bugs to <sjg@NetBSD.org>. # @@ -610,8 +610,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bmake' PACKAGE_TARNAME='bmake' -PACKAGE_VERSION='20220909' -PACKAGE_STRING='bmake 20220909' +PACKAGE_VERSION='20230723' +PACKAGE_STRING='bmake 20230723' PACKAGE_BUGREPORT='sjg@NetBSD.org' PACKAGE_URL='' @@ -1290,7 +1290,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bmake 20220909 to adapt to many kinds of systems. +\`configure' configures bmake 20230723 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1352,7 +1352,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bmake 20220909:";; + short | recursive ) echo "Configuration of bmake 20230723:";; esac cat <<\_ACEOF @@ -1367,7 +1367,10 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-defshell=SHELL use SHELL by default - must be sh compatible, use sh or ksh to pick the internal definitions + --with-defshell=[name=]SHELL use SHELL by default + optional 'name' can be 'sh' to indicate SHELL is sh compatible + eg. --with-defshell=sh=/bin/bsh + use just 'sh' or 'ksh' to pick the internal definitions --without-makefile disable use of generated makefile --without-meta disable use of meta-mode --with-filemon={no,dev,ktrace,path/filemon.h} indicate filemon method for meta-mode. Path to filemon.h implies dev @@ -1458,7 +1461,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bmake configure 20220909 +bmake configure 20230723 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1965,7 +1968,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bmake $as_me 20220909, which was +It was created by bmake $as_me 20230723, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2748,15 +2751,24 @@ use_defshell() { DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; *ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;; - sh|/bin/sh) + sh|/bin/sh|*/bsh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; + *=*) # eg. sh=/bin/bsh + eval `IFS="="; set -- $1; echo name=$1 defshell_path=$2` + case "$name" in + csh) DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; + ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;; + sh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; + *) DEFSHELL_INDEX=DEFSHELL_INDEX_CUSTOM;; + esac + ;; *) DEFSHELL_INDEX=DEFSHELL_INDEX_CUSTOM defshell_path=$1 ;; esac - case "$1" in - /bin/*) ;; - */*) defshell_path=$1;; + case "$defshell_path,$1" in + ,/bin/*) ;; + ,*/*) defshell_path=$1;; esac } @@ -2851,21 +2863,22 @@ SCO_SV) # /bin/sh is not usable CPPFLAGS="${CPPFLAGS} -DFORCE_USE_SHELL" ;; esac +# Not everyone groks TZ=Europe/Berlin +# which is used by the localtime tests echo $ECHO_N "checking whether system has timezone Europe/Berlin... $ECHO_C" >&6 -if test -f /usr/share/zoneinfo/Europe/Berlin; then +eval `TZ=UTC date '+utc_H=%H utc_d=%d' 2> /dev/null` +eval `TZ=Europe/Berlin date '+utc1_H=%H utc1_d=%d' 2> /dev/null` +if test ${utc_d-0} -lt ${utc1_d-0} -o ${utc_H-0} -lt ${utc1_H-0}; then echo yes >&6 - # seems a safe bet UTC_1=Europe/Berlin else - utcH=`TZ=UTC date +%H 2> /dev/null` - utc_1H=`TZ=UTC-1 date +%H 2> /dev/null` - if test ${utcH-0} -lt ${utc_1H-0}; then + eval `TZ=UTC-1 date '+utc1_H=%H utc1_d=%d' 2> /dev/null` + if test ${utc_d-0} -lt ${utc1_d-0} -o ${utc_H-0} -lt ${utc1_H-0}; then UTC_1=UTC-1 echo no, using UTC-1 >&6 - else - echo no >&6 fi fi +test "x$UTC_1" = x && echo no >&6 oldPATH=$PATH for d in /usr/gnu/bin do @@ -4870,6 +4883,10 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +# We have to override that on some systems +case "$OS" in +IRIX*) ac_INSTALL=$srcdir/install-sh;; +esac if test -x /usr/bin/getconf; then bmake_path_max=`getconf PATH_MAX / 2> /dev/null` # only a numeric response is useful @@ -4881,6 +4898,8 @@ if test $bmake_path_max -gt 1024; then bmake_path_max=1024 fi echo "Using: BMAKE_PATH_MAX=$bmake_path_max" >&6 +# if type does not work which(1) had better! +# note we cannot rely on type returning non-zero on failure if (type cat) > /dev/null 2>&1; then : which which() { @@ -7555,7 +7574,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bmake $as_me 20220909, which was +This file was extended by bmake $as_me 20230723, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7619,7 +7638,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -bmake config.status 20220909 +bmake config.status 20230723 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/bmake/configure.in b/contrib/bmake/configure.in index 669f1d031a73..5b97bc1bed52 100644 --- a/contrib/bmake/configure.in +++ b/contrib/bmake/configure.in @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.87 2022/09/09 20:00:53 sjg Exp $ +dnl $Id: configure.in,v 1.97 2023/07/25 20:12:32 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ([2.71]) -AC_INIT([bmake],[20220909],[sjg@NetBSD.org]) +AC_INIT([bmake],[20230723],[sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -29,20 +29,32 @@ use_defshell() { DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; *ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;; - sh|/bin/sh) + sh|/bin/sh|*/bsh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; + *=*) # eg. sh=/bin/bsh + eval `IFS="="; set -- $1; echo name=$1 defshell_path=$2` + case "$name" in + csh) DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; + ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;; + sh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; + *) DEFSHELL_INDEX=DEFSHELL_INDEX_CUSTOM;; + esac + ;; *) DEFSHELL_INDEX=DEFSHELL_INDEX_CUSTOM defshell_path=$1 ;; esac - case "$1" in - /bin/*) ;; - */*) defshell_path=$1;; + case "$defshell_path,$1" in + ,/bin/*) ;; + ,*/*) defshell_path=$1;; esac } dnl AC_ARG_WITH(defshell, -[ --with-defshell=SHELL use SHELL by default - must be sh compatible, use sh or ksh to pick the internal definitions], +[ --with-defshell=[[name=]]SHELL use SHELL by default + optional 'name' can be 'sh' to indicate SHELL is sh compatible + eg. --with-defshell=sh=/bin/bsh + use just 'sh' or 'ksh' to pick the internal definitions], [case "${withval}" in yes) AC_MSG_ERROR(bad value ${withval} given for bmake DEFSHELL) ;; no) ;; @@ -126,23 +138,22 @@ SCO_SV) # /bin/sh is not usable ;; esac dnl -dnl Not everyone groks TZ=Europe/Berlin -dnl which is used by the localtime tests +# Not everyone groks TZ=Europe/Berlin +# which is used by the localtime tests echo $ECHO_N "checking whether system has timezone Europe/Berlin... $ECHO_C" >&6 -if test -f /usr/share/zoneinfo/Europe/Berlin; then +eval `TZ=UTC date '+utc_H=%H utc_d=%d' 2> /dev/null` +eval `TZ=Europe/Berlin date '+utc1_H=%H utc1_d=%d' 2> /dev/null` +if test ${utc_d-0} -lt ${utc1_d-0} -o ${utc_H-0} -lt ${utc1_H-0}; then echo yes >&6 - # seems a safe bet UTC_1=Europe/Berlin else - utcH=`TZ=UTC date +%H 2> /dev/null` - utc_1H=`TZ=UTC-1 date +%H 2> /dev/null` - if test ${utcH-0} -lt ${utc_1H-0}; then + eval `TZ=UTC-1 date '+utc1_H=%H utc1_d=%d' 2> /dev/null` + if test ${utc_d-0} -lt ${utc1_d-0} -o ${utc_H-0} -lt ${utc1_H-0}; then UTC_1=UTC-1 echo no, using UTC-1 >&6 - else - echo no >&6 fi fi +test "x$UTC_1" = x && echo no >&6 dnl dnl Add some places to look for compilers oldPATH=$PATH @@ -160,6 +171,10 @@ AC_USE_SYSTEM_EXTENSIONS dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL +# We have to override that on some systems +case "$OS" in +IRIX*) ac_INSTALL=$srcdir/install-sh;; +esac dnl Executable suffix - normally empty; .exe on os2. AC_SUBST(ac_exe_suffix)dnl dnl @@ -177,8 +192,8 @@ fi echo "Using: BMAKE_PATH_MAX=$bmake_path_max" >&6 AC_SUBST(bmake_path_max)dnl dnl -dnl if type does not work which(1) had better! -dnl note we cannot rely on type returning non-zero on failure +# if type does not work which(1) had better! +# note we cannot rely on type returning non-zero on failure if (type cat) > /dev/null 2>&1; then : which which() { diff --git a/contrib/bmake/import.sh b/contrib/bmake/import.sh index a233cba9c9cc..7295a9a982d5 100755 --- a/contrib/bmake/import.sh +++ b/contrib/bmake/import.sh @@ -4,6 +4,7 @@ ECHO= GIT=${GIT:-git} +PAGER=${PAGER:-${LESS:-${MORE:-more}}} # For consistency... Error() { @@ -80,14 +81,41 @@ grep '^+' $TF.diffs | sed 's,^.,,' | sort > $TF.adds grep '^-' $TF.diffs | sed 's,^.,,' | sort > $TF.rms comm -13 $TF.adds $TF.rms > $TF.rm +post=$SB/tmp/bmake-post.sh + +# this is similar to what generates the mail to bmake-announce +gen_import_F() { + echo Import bmake-$VERSION + + if [ -s $post ]; then + last=`sed -n '/ tag/s,.*/,bmake-,p' $post` + else + last="last import" + fi + for C in ChangeLog */ChangeLog + do + $GIT diff --staged $C | + sed -n '/^@@/d;/^\+\+\+/d;/^\+/s,^.,,p' > $TF.C + test -s $TF.C || continue + echo + echo $C since $last + echo + cat $TF.C + done +} + if [ -z "$ECHO" ]; then test -s $TF.rm && xargs rm -f < $TF.rm $GIT add -A - $GIT diff --staged | tee $SB/tmp/bmake-import.diff + gen_import_F > $SB/tmp/bmake-import.F + $GIT diff --staged > $SB/tmp/bmake-import.diff + $PAGER $SB/tmp/bmake-import.F $SB/tmp/bmake-import.diff { echo "$GIT tag -a -m \"Tag bmake/$VERSION\" vendor/NetBSD/bmake/$VERSION" echo "echo \"When ready do: $GIT push --follow-tags\"" - } > $SB/tmp/bmake-post.sh - echo "After you commit, run $SB/tmp/bmake-post.sh" + } > $post + echo "Edit $SB/tmp/bmake-import.F as needed, then:" + echo "$GIT commit -F $SB/tmp/bmake-import.F" + echo "After you commit, run $post" else comm -23 $TF.adds $TF.rms > $TF.add test -s $TF.rm && { echo Removing:; cat $TF.rm; } diff --git a/contrib/bmake/install-sh b/contrib/bmake/install-sh index 1f6720f661a1..1fa52a59de7e 100755 --- a/contrib/bmake/install-sh +++ b/contrib/bmake/install-sh @@ -1,4 +1,5 @@ -: +#!/bin/sh + # NAME: # install.sh - portable version of install(1) # @@ -46,14 +47,14 @@ # BUGS: # The '-i' option is to save your sanity when 'bsd.prog.mk' # insists on haveing a '-o' "owner" option which is doomed to -# fail on many systems. We ignore '-b', '-B' and '-c' options. +# fail on many systems. We ignore '-b' and '-c' options. # # AUTHOR: # Simon J. Gerraty <sjg@crufty.net> # # RCSid: -# $Id: install-sh,v 1.22 2023/01/28 16:21:19 sjg Exp $ +# $Id: install-sh,v 1.25 2023/07/15 05:33:38 sjg Exp $ # # @(#) Copyright (c) 1993-2023 Simon J. Gerraty # @@ -73,6 +74,7 @@ set -- `getopt B:bpxCNcsdo:g:m:i:f: $*` Mydir=`dirname $0` [ -s $Mydir/.installrc ] && . $Mydir/.installrc +OLD_EXT=.old owner=: group=: mode=: @@ -89,6 +91,7 @@ while : do case "$1" in --) shift; break;; + -[bc]) ;; # ignore -p) CP_p=-p;; -x) set -x;; -B) OLD_EXT=$2; shift;; @@ -155,7 +158,7 @@ add_path /usr/sbin case "$owner" in :) ;; -*) +*) # some systems put chown in odd places add_path /etc add_path /usr/etc ;; @@ -185,16 +188,16 @@ if [ "$mkdirs" ]; then fi # install files -if [ $# -gt 2 ]; then - dest_dir=yes -elif [ $# -eq 1 ]; then +if [ $# -eq 1 ]; then echo "what should I do with $*?" >&2 exit 1 fi # get list of files +files= while [ $# -gt 1 ] do + test "x$files" = x || dest_dir=yes files="$files $1" shift done @@ -202,7 +205,6 @@ done dest=$1 shift - if [ "$dest_dir" = yes -a ! -d $dest ]; then echo "no directory $dest" >&2 exit 1 @@ -218,7 +220,7 @@ do fi $newer $f $t || continue $compare $f $t || continue - [ -f $t ] && { mv -f $t $t.old || exit 1; } + [ -f $t ] && { mv -f $t $t$OLD_EXT || exit 1; } { cp $CP_p $f $t && Setem $t; } || exit 1 done exit 0 diff --git a/contrib/bmake/main.c b/contrib/bmake/main.c index b0a4d003ddf1..b0ce265d34a6 100644 --- a/contrib/bmake/main.c +++ b/contrib/bmake/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.593 2023/03/28 14:39:31 rillig Exp $ */ +/* $NetBSD: main.c,v 1.599 2023/09/10 21:52:36 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -111,7 +111,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.593 2023/03/28 14:39:31 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.599 2023/09/10 21:52:36 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -399,21 +399,44 @@ MainParseArgJobsInternal(const char *argvalue) } static void -MainParseArgJobs(const char *argvalue) +MainParseArgJobs(const char *arg) { - char *p; + const char *p; + char *end; + char v[12]; forceJobs = true; - opts.maxJobs = (int)strtol(argvalue, &p, 0); + opts.maxJobs = (int)strtol(arg, &end, 0); + p = arg + (end - arg); +#ifdef _SC_NPROCESSORS_ONLN + if (*p != '\0') { + double d; + + if (*p == 'C') { + d = (opts.maxJobs > 0) ? opts.maxJobs : 1; + } else if (*p == '.') { + d = strtod(arg, &end); + p = arg + (end - arg); + } else + d = 0; + if (d > 0) { + p = ""; + opts.maxJobs = (int)sysconf(_SC_NPROCESSORS_ONLN); + opts.maxJobs = (int)(d * (double)opts.maxJobs); + } + } +#endif if (*p != '\0' || opts.maxJobs < 1) { (void)fprintf(stderr, - "%s: illegal argument to -j -- must be positive integer!\n", - progname); + "%s: argument '%s' to option '-j' " + "must be a positive number\n", + progname, arg); exit(2); /* Not 1 so -q can distinguish error */ } + snprintf(v, sizeof(v), "%d", opts.maxJobs); Global_Append(MAKEFLAGS, "-j"); - Global_Append(MAKEFLAGS, argvalue); - Global_Set(".MAKE.JOBS", argvalue); + Global_Append(MAKEFLAGS, v); + Global_Set(".MAKE.JOBS", v); maxJobTokens = opts.maxJobs; *** 2784 LINES SKIPPED ***home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6962c5c4.25b9d.5492a1b8>
