Date: Sat, 10 Jan 2026 21:34:04 +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: fa86ef7f23ae - stable/14 - Merge bmake-20240711 Message-ID: <6962c5cc.23c64.3244cbe8@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=fa86ef7f23aee51a6d7dac33d89d657df50aae3c commit fa86ef7f23aee51a6d7dac33d89d657df50aae3c Author: Simon J. Gerraty <sjg@FreeBSD.org> AuthorDate: 2024-07-20 19:43:11 +0000 Commit: Simon J. Gerraty <sjg@FreeBSD.org> CommitDate: 2026-01-10 21:33:12 +0000 Merge bmake-20240711 Merge commit '84691af93185c692058ba55fa81a04103f5bf71b' (cherry picked from commit 226192822cddc30cacecd55bccb48f39c653058c) --- contrib/bmake/ChangeLog | 83 ++ contrib/bmake/FILES | 2 + contrib/bmake/VERSION | 2 +- contrib/bmake/arch.c | 10 +- contrib/bmake/bmake.1 | 7 +- contrib/bmake/bmake.cat1 | 73 +- contrib/bmake/compat.c | 28 +- contrib/bmake/cond.c | 8 +- contrib/bmake/config.h.in | 137 +- contrib/bmake/configure | 1338 +++++++++++--------- contrib/bmake/configure.in | 13 +- contrib/bmake/dir.c | 8 +- contrib/bmake/dir.h | 4 +- contrib/bmake/hash.c | 33 +- contrib/bmake/hash.h | 5 +- contrib/bmake/job.c | 18 +- contrib/bmake/job.h | 6 +- contrib/bmake/main.c | 127 +- contrib/bmake/make.1 | 7 +- contrib/bmake/make.h | 20 +- contrib/bmake/meta.c | 3 + contrib/bmake/mk/install-mk | 0 contrib/bmake/parse.c | 31 +- contrib/bmake/str.c | 12 +- contrib/bmake/str.h | 4 +- contrib/bmake/suff.c | 9 +- contrib/bmake/targ.c | 15 +- contrib/bmake/unit-tests/Makefile | 32 +- contrib/bmake/unit-tests/cmd-errors-jobs.exp | 6 +- contrib/bmake/unit-tests/cmd-errors-jobs.mk | 17 +- contrib/bmake/unit-tests/cmd-errors-lint.exp | 4 +- contrib/bmake/unit-tests/cmd-errors-lint.mk | 23 +- contrib/bmake/unit-tests/cmd-errors.exp | 6 +- contrib/bmake/unit-tests/cmd-errors.mk | 21 +- contrib/bmake/unit-tests/compat-error.exp | 2 +- contrib/bmake/unit-tests/cond-cmp-numeric.exp | 2 +- contrib/bmake/unit-tests/cond-func-defined.exp | 2 +- contrib/bmake/unit-tests/cond-func.exp | 12 +- contrib/bmake/unit-tests/cond-func.mk | 13 +- contrib/bmake/unit-tests/cond-late.exp | 5 +- contrib/bmake/unit-tests/cond-late.mk | 14 +- contrib/bmake/unit-tests/cond-op-and.exp | 12 +- contrib/bmake/unit-tests/cond-op-and.mk | 27 +- contrib/bmake/unit-tests/cond-op-not.exp | 2 +- contrib/bmake/unit-tests/cond-op-or.exp | 12 +- contrib/bmake/unit-tests/cond-op-or.mk | 53 +- contrib/bmake/unit-tests/cond-op-parentheses.exp | 2 +- contrib/bmake/unit-tests/cond-op.exp | 2 +- contrib/bmake/unit-tests/cond-short.exp | 2 +- contrib/bmake/unit-tests/cond-token-number.exp | 2 +- contrib/bmake/unit-tests/cond-token-string.exp | 4 +- contrib/bmake/unit-tests/cond-token-string.mk | 4 +- contrib/bmake/unit-tests/dep-op-missing.exp | 1 + contrib/bmake/unit-tests/dep-percent.exp | 2 +- contrib/bmake/unit-tests/dep-var.exp | 2 +- contrib/bmake/unit-tests/dep.exp | 2 +- contrib/bmake/unit-tests/depsrc-ignore.exp | 2 +- .../unit-tests/deptgt-begin-fail-indirect.exp | 2 +- contrib/bmake/unit-tests/deptgt-begin-fail.exp | 2 +- .../bmake/unit-tests/deptgt-delete_on_error.exp | 14 +- contrib/bmake/unit-tests/deptgt-end-fail-all.exp | 2 +- .../bmake/unit-tests/deptgt-end-fail-indirect.exp | 2 +- contrib/bmake/unit-tests/deptgt-end-fail.exp | 30 +- contrib/bmake/unit-tests/deptgt-error.exp | 2 +- contrib/bmake/unit-tests/deptgt-ignore.exp | 2 +- contrib/bmake/unit-tests/deptgt-path-suffix.exp | 2 +- contrib/bmake/unit-tests/deptgt.exp | 5 +- contrib/bmake/unit-tests/deptgt.mk | 21 +- contrib/bmake/unit-tests/directive-dinclude.exp | 3 +- contrib/bmake/unit-tests/directive-elif.exp | 2 +- contrib/bmake/unit-tests/directive-else.exp | 2 +- .../bmake/unit-tests/directive-export-gmake.exp | 1 + contrib/bmake/unit-tests/directive-for-break.exp | 1 + contrib/bmake/unit-tests/directive-for-errors.exp | 16 +- contrib/bmake/unit-tests/directive-for-errors.mk | 18 +- contrib/bmake/unit-tests/directive-for-escape.exp | 114 +- contrib/bmake/unit-tests/directive-for-escape.mk | 96 +- .../unit-tests/directive-for-generating-endif.exp | 5 +- contrib/bmake/unit-tests/directive-for-if.exp | 5 +- contrib/bmake/unit-tests/directive-for-null.exp | 3 +- contrib/bmake/unit-tests/directive-for.exp | 42 +- contrib/bmake/unit-tests/directive-for.mk | 42 +- .../bmake/unit-tests/directive-hyphen-include.exp | 3 +- contrib/bmake/unit-tests/directive-ifmake.exp | 2 +- .../bmake/unit-tests/directive-include-fatal.exp | 2 +- contrib/bmake/unit-tests/directive-include.exp | 4 +- contrib/bmake/unit-tests/directive-include.mk | 4 +- contrib/bmake/unit-tests/directive-info.exp | 2 +- contrib/bmake/unit-tests/directive-sinclude.exp | 3 +- contrib/bmake/unit-tests/directive-undef.exp | 4 +- contrib/bmake/unit-tests/directive-undef.mk | 4 +- .../bmake/unit-tests/directive-unexport-env.exp | 2 +- contrib/bmake/unit-tests/directive-warning.exp | 2 +- contrib/bmake/unit-tests/directive.exp | 2 +- contrib/bmake/unit-tests/doterror.exp | 2 +- .../bmake/unit-tests/jobs-empty-commands-error.exp | 2 +- contrib/bmake/unit-tests/jobs-error-indirect.exp | 4 +- .../bmake/unit-tests/jobs-error-nested-make.exp | 6 +- contrib/bmake/unit-tests/jobs-error-nested.exp | 8 +- contrib/bmake/unit-tests/lint.exp | 2 +- contrib/bmake/unit-tests/moderrs.exp | 110 +- contrib/bmake/unit-tests/moderrs.mk | 78 +- contrib/bmake/unit-tests/opt-debug-errors-jobs.exp | 12 +- contrib/bmake/unit-tests/opt-debug-errors.exp | 2 +- contrib/bmake/unit-tests/opt-debug-file.exp | 8 +- contrib/bmake/unit-tests/opt-debug-file.mk | 15 +- contrib/bmake/unit-tests/opt-debug-graph2.exp | 2 +- contrib/bmake/unit-tests/opt-debug-graph3.exp | 2 +- contrib/bmake/unit-tests/opt-debug-hash.exp | 4 +- contrib/bmake/unit-tests/opt-debug-lint.exp | 6 +- contrib/bmake/unit-tests/opt-debug-lint.mk | 8 +- contrib/bmake/unit-tests/opt-file.exp | 3 +- .../bmake/unit-tests/opt-keep-going-indirect.exp | 8 +- .../bmake/unit-tests/opt-keep-going-multiple.exp | 2 +- contrib/bmake/unit-tests/opt-keep-going.exp | 2 +- .../bmake/unit-tests/opt-warnings-as-errors.exp | 2 +- contrib/bmake/unit-tests/opt.exp | 2 +- contrib/bmake/unit-tests/parse.exp | 2 +- contrib/bmake/unit-tests/posix.exp | 2 +- contrib/bmake/unit-tests/sh-jobs.exp | 2 +- contrib/bmake/unit-tests/suff-add-later.exp | 2 +- contrib/bmake/unit-tests/suff-clear-regular.exp | 2 +- contrib/bmake/unit-tests/suff-clear-single.exp | 2 +- contrib/bmake/unit-tests/suff-main-several.exp | 2 +- contrib/bmake/unit-tests/suff-self.exp | 2 +- .../bmake/unit-tests/suff-transform-endless.exp | 2 +- contrib/bmake/unit-tests/suff-transform-expand.exp | 2 +- contrib/bmake/unit-tests/suff-transform-select.exp | 2 +- contrib/bmake/unit-tests/suff-use.exp | 2 +- contrib/bmake/unit-tests/use-inference.exp | 2 +- contrib/bmake/unit-tests/var-eval-short.exp | 4 +- contrib/bmake/unit-tests/var-eval-short.mk | 4 +- contrib/bmake/unit-tests/var-op-assign.exp | 2 +- contrib/bmake/unit-tests/var-op-expand.exp | 6 +- contrib/bmake/unit-tests/var-op-expand.mk | 6 +- contrib/bmake/unit-tests/var-op-shell.exp | 6 +- contrib/bmake/unit-tests/var-op-shell.mk | 16 +- contrib/bmake/unit-tests/var-recursive.exp | 5 +- contrib/bmake/unit-tests/vardebug.exp | 2 +- contrib/bmake/unit-tests/vardebug.mk | 4 +- contrib/bmake/unit-tests/varmisc.exp | 8 +- contrib/bmake/unit-tests/varmisc.mk | 13 +- contrib/bmake/unit-tests/varmod-assign-shell.exp | 12 +- contrib/bmake/unit-tests/varmod-assign-shell.mk | 18 +- contrib/bmake/unit-tests/varmod-assign.exp | 12 +- contrib/bmake/unit-tests/varmod-assign.mk | 7 +- contrib/bmake/unit-tests/varmod-edge.exp | 33 +- contrib/bmake/unit-tests/varmod-edge.mk | 231 ++-- contrib/bmake/unit-tests/varmod-gmtime.exp | 12 +- contrib/bmake/unit-tests/varmod-gmtime.mk | 12 +- contrib/bmake/unit-tests/varmod-hash.exp | 8 +- contrib/bmake/unit-tests/varmod-ifelse.exp | 52 +- contrib/bmake/unit-tests/varmod-ifelse.mk | 22 +- contrib/bmake/unit-tests/varmod-indirect.exp | 8 +- contrib/bmake/unit-tests/varmod-indirect.mk | 10 +- contrib/bmake/unit-tests/varmod-localtime.exp | 12 +- contrib/bmake/unit-tests/varmod-localtime.mk | 12 +- contrib/bmake/unit-tests/varmod-loop-delete.exp | 4 +- contrib/bmake/unit-tests/varmod-loop-delete.mk | 4 +- contrib/bmake/unit-tests/varmod-loop-varname.exp | 10 +- contrib/bmake/unit-tests/varmod-loop-varname.mk | 10 +- contrib/bmake/unit-tests/varmod-match-escape.exp | 10 +- contrib/bmake/unit-tests/varmod-match-escape.mk | 8 +- contrib/bmake/unit-tests/varmod-match.exp | 20 +- contrib/bmake/unit-tests/varmod-match.mk | 22 +- contrib/bmake/unit-tests/varmod-mtime.exp | 12 +- contrib/bmake/unit-tests/varmod-mtime.mk | 14 +- contrib/bmake/unit-tests/varmod-order.exp | 48 +- contrib/bmake/unit-tests/varmod-order.mk | 32 +- contrib/bmake/unit-tests/varmod-range.exp | 12 +- contrib/bmake/unit-tests/varmod-range.mk | 12 +- contrib/bmake/unit-tests/varmod-select-words.exp | 26 +- contrib/bmake/unit-tests/varmod-shell.exp | 14 +- contrib/bmake/unit-tests/varmod-shell.mk | 14 +- contrib/bmake/unit-tests/varmod-subst-regex.exp | 30 +- contrib/bmake/unit-tests/varmod-subst.exp | 4 +- contrib/bmake/unit-tests/varmod-sun-shell.exp | 16 +- contrib/bmake/unit-tests/varmod-sun-shell.mk | 14 +- contrib/bmake/unit-tests/varmod-sysv.exp | 10 +- contrib/bmake/unit-tests/varmod-sysv.mk | 10 +- contrib/bmake/unit-tests/varmod-to-separator.exp | 44 +- contrib/bmake/unit-tests/varmod-to-separator.mk | 23 +- contrib/bmake/unit-tests/varmod-to-title.exp | 1 + contrib/bmake/unit-tests/varmod-to-title.mk | 31 + contrib/bmake/unit-tests/varmod.exp | 54 +- contrib/bmake/unit-tests/varmod.mk | 38 +- contrib/bmake/unit-tests/varname-dot-newline.exp | 5 +- .../varname-make_print_var_on_error-jobs.exp | 2 +- .../unit-tests/varname-make_print_var_on_error.exp | 2 +- contrib/bmake/unit-tests/varname.exp | 2 +- contrib/bmake/unit-tests/varparse-errors.exp | 44 +- contrib/bmake/unit-tests/varparse-errors.mk | 26 +- contrib/bmake/util.c | 6 +- contrib/bmake/var.c | 165 +-- usr.bin/bmake/Makefile.config | 2 +- usr.bin/bmake/config.h | 141 ++- usr.bin/bmake/unit-tests/Makefile | 32 +- 197 files changed, 2564 insertions(+), 2024 deletions(-) diff --git a/contrib/bmake/ChangeLog b/contrib/bmake/ChangeLog index 8b6e0b2ea512..12774bb5598c 100644 --- a/contrib/bmake/ChangeLog +++ b/contrib/bmake/ChangeLog @@ -1,3 +1,86 @@ +2024-07-13 Simon J Gerraty <sjg@beast.crufty.net> + + * cleanup redundant differences from NetBSD make + o parse.c: no longer uses mmap + o var.c: check __STDC_VERSION__ not __STDC__ + +2024-07-12 Simon J Gerraty <sjg@beast.crufty.net> + + * Apply some patches from NetBSD pkgsrc to reduce divergence + o meta.c: requires sys/select.h if available + o var.c: ensure SIZE_MAX has a value + o util.c: ensure SA_RESTART is defined + + * configure.in: use *ksh* rather than just *ksh to match + ksh shell specification. + + * unit-tests/Makefile: expand BROKEN_TESTS for ksh and + mksh in particular + +2024-07-11 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20240711 + Merge with NetBSD make, pick up + o compat.c: allow Compat_RunCommand to also handle very long + commands by writing to a temp file when needed. + o main.c: extract the temp file logic recently added to Cmd_Exec + to Cmd_Argv so it can be leveraged by Compat_RunCommand. + +2024-07-09 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20240709 + Merge with NetBSD make, pick up + o error out on parse/evaluation errors in shell commands + o var.c: error out on syntax errors in ':M' and ':N' modifiers + +2024-07-07 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20240707 + Merge with NetBSD make, pick up + o only generate code for cleanup functions in CLEANUP mode + o hash.c: don't track hash table chain lengths during lookup + unless debugging + o main.c: move initialization of variable scopes to targ.c + o var.c: remove Var_End as it is now unnecessary + +2024-07-06 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20240706 + Merge with NetBSD make, pick up + o reduce lint comments about ARGSUSED + o cond.c: error out on conditions containing the operators '&' and '|' + o str.c: error out on a matching malformed matching pattern '[[' + o var.c: in error messages, distinguish parsing from evaluating + in error messages for anonymous variables, log the value + error out on unclosed expressions during parse time + +2024-07-04 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20240704 + Merge with NetBSD make, pick up + o add more context information to error messages + o main.c: on error, print the targets to be made + add detailed exit status to message for failed sub-commands + o var.c: error out on the "Bad modifier" error message + +2024-07-01 Simon J Gerraty <sjg@beast.crufty.net> + + * VERSION (_MAKE_VERSION): 20240701 + Merge with NetBSD make, pick up + o var.c: add :tt for Title case + +2024-06-30 Simon J Gerraty <sjg@beast.crufty.net> + + * configure.in: 20240630 further refine check for whether + TZ=Europe/Berlin works + + * VERSION (_MAKE_VERSION): 20240630 + Merge with NetBSD make, pick up + o job.c: reduce use of UNCONST + o main.c: add detailed exit status to message for failed sub-commands + o var.c: error out on some more syntax errors + add more context to "returned non-zero status" message + 2024-06-25 Simon J Gerraty <sjg@beast.crufty.net> * VERSION (_MAKE_VERSION): 20240625 diff --git a/contrib/bmake/FILES b/contrib/bmake/FILES index e557147c85b1..bfe95a9b6b47 100644 --- a/contrib/bmake/FILES +++ b/contrib/bmake/FILES @@ -759,6 +759,8 @@ unit-tests/varmod-to-one-word.exp unit-tests/varmod-to-one-word.mk unit-tests/varmod-to-separator.exp unit-tests/varmod-to-separator.mk +unit-tests/varmod-to-title.exp +unit-tests/varmod-to-title.mk unit-tests/varmod-to-upper.exp unit-tests/varmod-to-upper.mk unit-tests/varmod-undefined.exp diff --git a/contrib/bmake/VERSION b/contrib/bmake/VERSION index 81837cc6765f..f55bfabc9103 100644 --- a/contrib/bmake/VERSION +++ b/contrib/bmake/VERSION @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20240625 +_MAKE_VERSION=20240711 diff --git a/contrib/bmake/arch.c b/contrib/bmake/arch.c index d8b467e02874..00c72261707f 100644 --- a/contrib/bmake/arch.c +++ b/contrib/bmake/arch.c @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.219 2024/06/02 15:31:25 rillig Exp $ */ +/* $NetBSD: arch.c,v 1.221 2024/07/07 07:50:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -147,7 +147,7 @@ struct ar_hdr { #include "dir.h" /* "@(#)arch.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: arch.c,v 1.219 2024/06/02 15:31:25 rillig Exp $"); +MAKE_RCSID("$NetBSD: arch.c,v 1.221 2024/07/07 07:50:57 rillig Exp $"); typedef struct List ArchList; typedef struct ListNode ArchListNode; @@ -818,7 +818,6 @@ Arch_Touch(GNode *gn) * Both the modification time of the library and of the RANLIBMAG member are * set to 'now'. */ -/*ARGSUSED*/ void Arch_TouchLib(GNode *gn MAKE_ATTR_UNUSED) { @@ -919,7 +918,6 @@ Arch_FindLib(GNode *gn, SearchPath *path) Var_Set(gn, TARGET, gn->name); } -/* ARGSUSED */ static bool RanlibOODate(const GNode *gn MAKE_ATTR_UNUSED) { @@ -999,18 +997,18 @@ Arch_Init(void) Lst_Init(&archives); } +#ifdef CLEANUP /* Clean up the archives module. */ void Arch_End(void) { -#ifdef CLEANUP ArchListNode *ln; for (ln = archives.first; ln != NULL; ln = ln->next) ArchFree(ln->datum); Lst_Done(&archives); -#endif } +#endif bool Arch_IsLib(GNode *gn) diff --git a/contrib/bmake/bmake.1 b/contrib/bmake/bmake.1 index eb30d2173098..f7cc15b16c41 100644 --- a/contrib/bmake/bmake.1 +++ b/contrib/bmake/bmake.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.377 2024/06/01 06:26:36 sjg Exp $ +.\" $NetBSD: make.1,v 1.378 2024/07/01 21:02:26 sjg 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 June 1, 2024 +.Dd July 1, 2024 .Dt BMAKE 1 .Os .Sh NAME @@ -1575,6 +1575,9 @@ If .Ar c is omitted, no separator is used. The common escapes (including octal numeric codes) work as expected. +.It Cm \&:tt +Converts the first character of each word to upper-case, +and the rest to lower-case letters. .It Cm \&:tu Converts the value to upper-case letters. .It Cm \&:tW diff --git a/contrib/bmake/bmake.cat1 b/contrib/bmake/bmake.cat1 index 456885bc634c..f46f6681320a 100644 --- a/contrib/bmake/bmake.cat1 +++ b/contrib/bmake/bmake.cat1 @@ -506,27 +506,27 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS The seven built-in local variables are: - _._A_L_L_S_R_C The list of all sources for this target; also known - as `_>'. + _._A_L_L_S_R_C The list of all sources for this target; also known as + `_>'. - _._A_R_C_H_I_V_E The name of the archive file; also known as `_!'. + _._A_R_C_H_I_V_E The name of the archive file; also known as `_!'. - _._I_M_P_S_R_C In suffix-transformation rules, the name/path of the - source from which the target is to be transformed - (the "implied" source); also known as `_<'. It is not - defined in explicit rules. + _._I_M_P_S_R_C In suffix-transformation rules, the name/path of the + source from which the target is to be transformed (the + "implied" source); also known as `_<'. It is not defined + in explicit rules. - _._M_E_M_B_E_R The name of the archive member; also known as `_%'. + _._M_E_M_B_E_R The name of the archive member; also known as `_%'. - _._O_O_D_A_T_E The list of sources for this target that were deemed - out-of-date; also known as `_?'. + _._O_O_D_A_T_E The list of sources for this target that were deemed out- + of-date; also known as `_?'. - _._P_R_E_F_I_X The name of the target with suffix (if declared in - ..SSUUFFFFIIXXEESS) removed; also known as `_*'. + _._P_R_E_F_I_X The name of the target with suffix (if declared in + ..SSUUFFFFIIXXEESS) removed; also known as `_*'. - _._T_A_R_G_E_T The name of the target; also known as `_@'. For - compatibility with other makes this is an alias for - _._A_R_C_H_I_V_E in archive member rules. + _._T_A_R_G_E_T The name of the target; also known as `_@'. For + compatibility with other makes this is an alias for + _._A_R_C_H_I_V_E in archive member rules. The shorter forms (`_>', `_!', `_<', `_%', `_?', `_*', and `_@') are permitted for backward compatibility with historical makefiles and legacy POSIX @@ -1021,6 +1021,9 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS separator is used. The common escapes (including octal numeric codes) work as expected. + ::tttt Converts the first character of each word to upper-case, and the + rest to lower-case letters. + ::ttuu Converts the value to upper-case letters. ::ttWW Causes subsequent modifiers to treat the value as a single word @@ -1625,37 +1628,33 @@ SSPPEECCIIAALL TTAARRGGEETTSS ..SSHHEELLLL Sets the shell that bbmmaakkee uses to execute commands. The sources are a set of _f_i_e_l_d==_v_a_l_u_e pairs. - name This is the minimal specification, used to - select one of the built-in shell specs; sh, ksh, - and csh. + name This is the minimal specification, used to select + one of the built-in shell specs; sh, ksh, and csh. - path Specifies the absolute path to the shell. + path Specifies the absolute path to the shell. - hasErrCtl Indicates whether the shell supports exit on - error. + hasErrCtl Indicates whether the shell supports exit on error. - check The command to turn on error checking. + check The command to turn on error checking. - ignore The command to disable error checking. + ignore The command to disable error checking. - echo The command to turn on echoing of commands - executed. + echo The command to turn on echoing of commands executed. - quiet The command to turn off echoing of commands - executed. + quiet The command to turn off echoing of commands + executed. - filter The output to filter after issuing the quiet - command. It is typically identical to quiet. + filter The output to filter after issuing the quiet + command. It is typically identical to quiet. - errFlag The flag to pass the shell to enable error - checking. + errFlag The flag to pass the shell to enable error checking. - echoFlag The flag to pass the shell to enable command - echoing. + echoFlag The flag to pass the shell to enable command + echoing. - newline The string literal to pass the shell that - results in a single newline character when used - outside of any quoting characters. + newline The string literal to pass the shell that results in + a single newline character when used outside of any + quoting characters. Example: .SHELL: name=ksh path=/bin/ksh hasErrCtl=true \ @@ -1788,4 +1787,4 @@ BBUUGGSS attempt to suppress a cascade of unnecessary errors, can result in a seemingly unexplained `*** Error code 6' -FreeBSD 13.2-RELEASE-p11 June 1, 2024 FreeBSD 13.2-RELEASE-p11 +FreeBSD 14.1-RELEASE July 1, 2024 FreeBSD 14.1-RELEASE diff --git a/contrib/bmake/compat.c b/contrib/bmake/compat.c index 5d1b3ab52344..23ece245c8a6 100644 --- a/contrib/bmake/compat.c +++ b/contrib/bmake/compat.c @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.259 2024/06/15 20:02:45 rillig Exp $ */ +/* $NetBSD: compat.c,v 1.260 2024/07/11 20:09:16 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -94,7 +94,7 @@ #include "pathnames.h" /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: compat.c,v 1.259 2024/06/15 20:02:45 rillig Exp $"); +MAKE_RCSID("$NetBSD: compat.c,v 1.260 2024/07/11 20:09:16 sjg Exp $"); static GNode *curTarg = NULL; static pid_t compatChild; @@ -249,6 +249,8 @@ Compat_RunCommand(const char *cmdp, GNode *gn, StringListNode *ln) bool useShell; /* True if command should be executed using a * shell */ const char *cmd = cmdp; + char cmd_file[MAXPATHLEN]; + size_t cmd_len; silent = (gn->type & OP_SILENT) != OP_NONE; errCheck = !(gn->type & OP_IGNORE); @@ -319,20 +321,20 @@ Compat_RunCommand(const char *cmdp, GNode *gn, StringListNode *ln) DEBUG1(JOB, "Execute: '%s'\n", cmd); - if (useShell && shellPath == NULL) - Shell_Init(); /* we need shellPath */ + cmd_len = strlen(cmd); + if (cmd_len > MAKE_CMDLEN_LIMIT) + useShell = true; + else + cmd_file[0] = '\0'; if (useShell) { static const char *shargv[5]; - /* The following work for any of the builtin shell specs. */ - int shargc = 0; - shargv[shargc++] = shellPath; - if (errCheck && shellErrFlag != NULL) - shargv[shargc++] = shellErrFlag; - shargv[shargc++] = DEBUG(SHELL) ? "-xc" : "-c"; - shargv[shargc++] = cmd; - shargv[shargc] = NULL; + if (Cmd_Argv(cmd, cmd_len, shargv, 5, + cmd_file, sizeof(cmd_file), + (errCheck && shellErrFlag != NULL), + DEBUG(SHELL)) < 0) + Fatal("cannot run \"%s\"", cmd); av = shargv; bp = NULL; mav = NULL; @@ -425,6 +427,8 @@ Compat_RunCommand(const char *cmdp, GNode *gn, StringListNode *ln) } free(cmdStart); + if (cmd_file[0] != '\0') + unlink(cmd_file); compatChild = 0; if (compatSigno != 0) { bmake_signal(compatSigno, SIG_DFL); diff --git a/contrib/bmake/cond.c b/contrib/bmake/cond.c index a6a73fe337dd..58c0069555e1 100644 --- a/contrib/bmake/cond.c +++ b/contrib/bmake/cond.c @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.365 2024/06/02 15:31:25 rillig Exp $ */ +/* $NetBSD: cond.c,v 1.366 2024/07/06 21:21:09 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -91,7 +91,7 @@ #include "dir.h" /* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: cond.c,v 1.365 2024/06/02 15:31:25 rillig Exp $"); +MAKE_RCSID("$NetBSD: cond.c,v 1.366 2024/07/06 21:21:09 rillig Exp $"); /* * Conditional expressions conform to this grammar: @@ -780,7 +780,7 @@ CondParser_Token(CondParser *par, bool doEval) par->p++; if (par->p[0] == '|') par->p++; - else if (opts.strict) { + else { Parse_Error(PARSE_FATAL, "Unknown operator '|'"); par->printedError = true; return TOK_ERROR; @@ -791,7 +791,7 @@ CondParser_Token(CondParser *par, bool doEval) par->p++; if (par->p[0] == '&') par->p++; - else if (opts.strict) { + else { Parse_Error(PARSE_FATAL, "Unknown operator '&'"); par->printedError = true; return TOK_ERROR; diff --git a/contrib/bmake/config.h.in b/contrib/bmake/config.h.in index 3834761a6b87..4fed2573a02b 100644 --- a/contrib/bmake/config.h.in +++ b/contrib/bmake/config.h.in @@ -15,24 +15,24 @@ /* Define to 1 if you have the <ar.h> header file. */ #undef HAVE_AR_H -/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you +/* Define to 1 if you have the declaration of 'sys_siglist', and to 0 if you don't. */ #undef HAVE_DECL_SYS_SIGLIST -/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. +/* Define to 1 if you have the <dirent.h> header file, and it defines 'DIR'. */ #undef HAVE_DIRENT_H -/* Define to 1 if you have the `dirname' function. */ +/* Define to 1 if you have the 'dirname' function. */ #undef HAVE_DIRNAME -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +/* Define to 1 if you don't have 'vprintf' but do have '_doprnt.' */ #undef HAVE_DOPRNT -/* Define to 1 if you have the `err' function. */ +/* Define to 1 if you have the 'err' function. */ #undef HAVE_ERR -/* Define to 1 if you have the `errx' function. */ +/* Define to 1 if you have the 'errx' function. */ #undef HAVE_ERRX /* Define to 1 if you have the <err.h> header file. */ @@ -41,25 +41,25 @@ /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `fork' function. */ +/* Define to 1 if you have the 'fork' function. */ #undef HAVE_FORK -/* Define to 1 if you have the `getcwd' function. */ +/* Define to 1 if you have the 'getcwd' function. */ #undef HAVE_GETCWD -/* Define to 1 if you have the `getenv' function. */ +/* Define to 1 if you have the 'getenv' function. */ #undef HAVE_GETENV -/* Define to 1 if you have the `getopt' function. */ +/* Define to 1 if you have the 'getopt' function. */ #undef HAVE_GETOPT -/* Define to 1 if you have the `getwd' function. */ +/* Define to 1 if you have the 'getwd' function. */ #undef HAVE_GETWD /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `killpg' function. */ +/* Define to 1 if you have the 'killpg' function. */ #undef HAVE_KILLPG /* Define to 1 if you have the <libgen.h> header file. */ @@ -68,16 +68,13 @@ /* Define to 1 if you have the <limits.h> header file. */ #undef HAVE_LIMITS_H -/* Define to 1 if the system has the type `long long int'. */ +/* Define to 1 if the system has the type 'long long int'. */ #undef HAVE_LONG_LONG_INT /* Define to 1 if you have the <minix/config.h> header file. */ #undef HAVE_MINIX_CONFIG_H -/* Define to 1 if you have the `mmap' function. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ +/* Define to 1 if you have the <ndir.h> header file, and it defines 'DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the <paths.h> header file. */ @@ -86,58 +83,58 @@ /* Define to 1 if you have the <poll.h> header file. */ #undef HAVE_POLL_H -/* Define to 1 if you have the `putenv' function. */ +/* Define to 1 if you have the 'putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the <ranlib.h> header file. */ #undef HAVE_RANLIB_H -/* Define to 1 if you have the `realpath' function. */ +/* Define to 1 if you have the 'realpath' function. */ #undef HAVE_REALPATH /* Define to 1 if you have the <regex.h> header file. */ #undef HAVE_REGEX_H -/* Define to 1 if you have the `select' function. */ +/* Define to 1 if you have the 'select' function. */ #undef HAVE_SELECT -/* Define to 1 if you have the `setenv' function. */ +/* Define to 1 if you have the 'setenv' function. */ #undef HAVE_SETENV -/* Define to 1 if you have the `setpgid' function. */ +/* Define to 1 if you have the 'setpgid' function. */ #undef HAVE_SETPGID -/* Define to 1 if you have the `setrlimit' function. */ +/* Define to 1 if you have the 'setrlimit' function. */ #undef HAVE_SETRLIMIT -/* Define to 1 if you have the `setsid' function. */ +/* Define to 1 if you have the 'setsid' function. */ #undef HAVE_SETSID -/* Define to 1 if you have the `sigaction' function. */ +/* Define to 1 if you have the 'sigaction' function. */ #undef HAVE_SIGACTION -/* Define to 1 if you have the `sigaddset' function. */ +/* Define to 1 if you have the 'sigaddset' function. */ #undef HAVE_SIGADDSET -/* Define to 1 if you have the `sigpending' function. */ +/* Define to 1 if you have the 'sigpending' function. */ #undef HAVE_SIGPENDING -/* Define to 1 if you have the `sigprocmask' function. */ +/* Define to 1 if you have the 'sigprocmask' function. */ #undef HAVE_SIGPROCMASK -/* Define to 1 if you have the `sigsetmask' function. */ +/* Define to 1 if you have the 'sigsetmask' function. */ #undef HAVE_SIGSETMASK -/* Define to 1 if you have the `sigsuspend' function. */ +/* Define to 1 if you have the 'sigsuspend' function. */ #undef HAVE_SIGSUSPEND -/* Define to 1 if you have the `sigvec' function. */ +/* Define to 1 if you have the 'sigvec' function. */ #undef HAVE_SIGVEC -/* Define to 1 if the system has the type `sig_atomic_t'. */ +/* Define to 1 if the system has the type 'sig_atomic_t'. */ #undef HAVE_SIG_ATOMIC_T -/* Define to 1 if you have the `snprintf' function. */ +/* Define to 1 if you have the 'snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the <stdint.h> header file. */ @@ -149,13 +146,13 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H -/* Define to 1 if you have the `strerror' function. */ +/* Define to 1 if you have the 'strerror' function. */ #undef HAVE_STRERROR -/* Define to 1 if you have the `stresep' function. */ +/* Define to 1 if you have the 'stresep' function. */ #undef HAVE_STRESEP -/* Define to 1 if you have the `strftime' function. */ +/* Define to 1 if you have the 'strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the <strings.h> header file. */ @@ -164,35 +161,35 @@ /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the `strlcpy' function. */ +/* Define to 1 if you have the 'strlcpy' function. */ #undef HAVE_STRLCPY -/* Define to 1 if you have the `strsep' function. */ +/* Define to 1 if you have the 'strsep' function. */ #undef HAVE_STRSEP -/* Define to 1 if you have the `strtod' function. */ +/* Define to 1 if you have the 'strtod' function. */ #undef HAVE_STRTOD -/* Define to 1 if you have the `strtol' function. */ +/* Define to 1 if you have the 'strtol' function. */ #undef HAVE_STRTOL -/* Define to 1 if you have the `strtoll' function. */ +/* Define to 1 if you have the 'strtoll' function. */ #undef HAVE_STRTOLL -/* Define to 1 if you have the `strtoul' function. */ +/* Define to 1 if you have the 'strtoul' function. */ #undef HAVE_STRTOUL -/* Define to 1 if you have the `sysctl' function. */ +/* Define to 1 if you have the 'sysctl' function. */ #undef HAVE_SYSCTL -/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. +/* Define to 1 if you have the <sys/dir.h> header file, and it defines 'DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the <sys/mman.h> header file. */ #undef HAVE_SYS_MMAN_H -/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. +/* Define to 1 if you have the <sys/ndir.h> header file, and it defines 'DIR'. */ #undef HAVE_SYS_NDIR_H @@ -226,49 +223,49 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if you have the `unsetenv' function. */ +/* Define to 1 if you have the 'unsetenv' function. */ #undef HAVE_UNSETENV -/* Define to 1 if the system has the type `unsigned long long int'. */ +/* Define to 1 if the system has the type 'unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define to 1 if you have the <utime.h> header file. */ #undef HAVE_UTIME_H -/* Define to 1 if you have the `vfork' function. */ +/* Define to 1 if you have the 'vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the <vfork.h> header file. */ #undef HAVE_VFORK_H -/* Define to 1 if you have the `vprintf' function. */ +/* Define to 1 if you have the 'vprintf' function. */ #undef HAVE_VPRINTF -/* Define to 1 if you have the `vsnprintf' function. */ +/* Define to 1 if you have the 'vsnprintf' function. */ #undef HAVE_VSNPRINTF -/* Define to 1 if you have the `wait3' function. */ +/* Define to 1 if you have the 'wait3' function. */ #undef HAVE_WAIT3 -/* Define to 1 if you have the `wait4' function. */ +/* Define to 1 if you have the 'wait4' function. */ #undef HAVE_WAIT4 -/* Define to 1 if you have the `waitpid' function. */ +/* Define to 1 if you have the 'waitpid' function. */ #undef HAVE_WAITPID -/* Define to 1 if you have the `warn' function. */ +/* Define to 1 if you have the 'warn' function. */ #undef HAVE_WARN -/* Define to 1 if you have the `warnx' function. */ +/* Define to 1 if you have the 'warnx' function. */ #undef HAVE_WARNX /* Define to 1 if you have the <wchar.h> header file. */ #undef HAVE_WCHAR_H -/* Define to 1 if `fork' works. */ +/* Define to 1 if 'fork' works. */ #undef HAVE_WORKING_FORK -/* Define to 1 if `vfork' works. */ +/* Define to 1 if 'vfork' works. */ #undef HAVE_WORKING_VFORK /* define if your compiler has __attribute__ */ @@ -292,18 +289,18 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ +/* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */ #undef STAT_MACROS_BROKEN -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS -/* Define to 1 if your <sys/time.h> declares `struct tm'. */ +/* Define to 1 if your <sys/time.h> declares 'struct tm'. */ #undef TM_IN_SYS_TIME -/* Enable extensions on AIX 3, Interix. */ +/* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif @@ -364,11 +361,15 @@ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif +/* Enable extensions specified by C23 Annex F. */ +#ifndef __STDC_WANT_IEC_60559_EXT__ +# undef __STDC_WANT_IEC_60559_EXT__ +#endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif -/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif @@ -411,10 +412,10 @@ /* C99 function name */ #undef __func__ -/* Define to empty if `const' does not conform to ANSI C. */ +/* Define to empty if 'const' does not conform to ANSI C. */ #undef const -/* Define to `__inline__' or `__inline' if that's what the C compiler +/* Define to '__inline__' or '__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline @@ -424,10 +425,10 @@ such a type exists and the standard includes do not define it. */ #undef int64_t -/* Define to `int' if <sys/types.h> does not define. */ +/* Define to 'int' if <sys/types.h> does not define. */ #undef mode_t -/* Define to `long int' if <sys/types.h> does not define. */ +/* Define to 'long int' if <sys/types.h> does not define. */ #undef off_t /* Define as a signed integer type capable of holding a process identifier. */ @@ -436,12 +437,12 @@ *** 10759 LINES SKIPPED ***home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6962c5cc.23c64.3244cbe8>
