Skip to content

Commit 9887588

Browse files
committed
Merge bmake-20230909
Merge commit '1012cf15f75d1e9048779abd07270a37cdba590a'
2 parents a6662c3 + 1012cf1 commit 9887588

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1309
-408
lines changed

contrib/bmake/ChangeLog

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,81 @@
1+
2023-09-09 Simon J Gerraty <[email protected]>
2+
3+
* VERSION (_MAKE_VERSION): 20230909
4+
Merge with NetBSD make, pick up
5+
o main.c: allow -j to compute a multiple of ncpu
6+
If _SC_NPROCESSORS_ONLN is supported; and -j arg is a floating
7+
point number or ends in 'C' compute .MAKE.JOBS as a multiple of
8+
_SC_NPROCESSORS_ONLN
9+
.MAKE.JOBS.C will be "yes" if -jC is supported
10+
11+
2023-08-20 Simon J Gerraty <[email protected]>
12+
13+
* VERSION (_MAKE_VERSION): 20230820
14+
Merge with NetBSD make, pick up
15+
o make.1: note that :localtime is better for %s
16+
o parse.c: improve error messages for invalid input.
17+
o var.c: fix for %s:L:gmtime - set TZ=UTC and use localtime to get
18+
correct result, it is still better to use %s:L:localtime.
19+
20+
2023-08-18 Simon J Gerraty <[email protected]>
21+
22+
* VERSION (_MAKE_VERSION): 20230818
23+
Merge with NetBSD make, pick up
24+
o meta.c: meta_ignore - check raw path against metaIgnorePaths
25+
to potentially skip call to realpath.
26+
o var.c: be strict when parsing the argument of the ':mtime' modifier
27+
o unit-tests/varmod-mtime.mk: document why '${%s:L:localtime}'
28+
should be used to get an equivalent value to time(3).
29+
30+
2023-08-16 Simon J Gerraty <[email protected]>
31+
32+
* VERSION (_MAKE_VERSION): 20230816
33+
Merge with NetBSD make, pick up
34+
o cond.c: clean up multiple-inclusion guards
35+
36+
2023-07-25 Simon J Gerraty <[email protected]>
37+
38+
* unit-tests/Makefile: addd varmod-localtime to BROKEN_TESTS
39+
if configure cannot work out how to control TZ.
40+
Remove varmod-localtime from BROKEN_TESTS for IRIX*
41+
42+
2023-07-24 Simon J Gerraty <[email protected]>
43+
44+
* VERSION (_MAKE_VERSION): 20230723
45+
46+
* configure.in: fix the test for wether TZ=Europe/Berlin works.
47+
Depending on the time of year, if run between 22:00 and 00:00 UTC
48+
the check in configure would fail incorrectly.
49+
Take the day into account as well.
50+
51+
2023-07-18 Simon J Gerraty <[email protected]>
52+
53+
* VERSION (_MAKE_VERSION): 20230711
54+
Merge with NetBSD make, pick up
55+
o make.1: clean up wording, clarify scope of '!' in conditions
56+
57+
2023-07-15 Simon J Gerraty <[email protected]>
58+
59+
* make-bootstrap.sh.in: set prefix
60+
If configure is run using ksh we get unexpanded ${prefix} in
61+
DEFAULT_SYS_PATH, by ensuring prefix is set we should still get
62+
correct result.
63+
64+
2023-07-13 Simon J Gerraty <[email protected]>
65+
66+
* VERSION (_MAKE_VERSION): 20230711
67+
bump version for IRIX tweaks
68+
69+
* make.h: undef OP_NONE if defined
70+
71+
* unit-tests/Makefile: set BROKEN_TESTS for IRIX
72+
73+
* configure.in: override INSTALL on IRIX
74+
75+
2023-06-27 Simon J Gerraty <[email protected]>
76+
77+
* boot-strap op_test: ensure we set TEST_MAKE as we want it.
78+
179
2023-06-22 Simon J Gerraty <[email protected]>
280

381
* VERSION (_MAKE_VERSION): 20230622

contrib/bmake/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# keep this compatible with sh and make
2-
_MAKE_VERSION=20230622
2+
_MAKE_VERSION=20230909

contrib/bmake/bmake.1

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $NetBSD: make.1,v 1.366 2023/05/10 18:22:33 sjg Exp $
1+
.\" $NetBSD: make.1,v 1.371 2023/09/10 21:52:36 rillig Exp $
22
.\"
33
.\" Copyright (c) 1990, 1993
44
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
2929
.\"
3030
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
3131
.\"
32-
.Dd May 10, 2023
32+
.Dd September 9, 2023
3333
.Dt BMAKE 1
3434
.Os
3535
.Sh NAME
@@ -267,6 +267,12 @@ cooperate to avoid overloading the system.
267267
Specify the maximum number of jobs that
268268
.Nm
269269
may have running at any one time.
270+
If
271+
.Ar max_jobs
272+
is a floating point number, or ends with
273+
.Ql C ,
274+
then the value is multiplied by the number of CPUs reported online by
275+
.Xr sysconf 3 .
270276
The value of
271277
.Ar max_jobs
272278
is saved in
@@ -971,6 +977,11 @@ making it easier to track the degree of parallelism being achieved.
971977
The argument to the
972978
.Fl j
973979
option.
980+
.It Va .MAKE.JOBS.C
981+
A read-only boolean that indicates whether the
982+
.Fl j
983+
option supports use of
984+
.Ql C .
974985
.It Va .MAKE.LEVEL
975986
The recursion depth of
976987
.Nm .
@@ -1497,6 +1508,10 @@ The value is interpreted as a format string for
14971508
using
14981509
.Xr gmtime 3 ,
14991510
producing the formatted timestamp.
1511+
Note: the
1512+
.Ql %s
1513+
format should only be used with
1514+
.Sq Cm \&:localtime .
15001515
If a
15011516
.Ar timestamp
15021517
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.
20692084
Parentheses can be used to override the operator precedence.
20702085
The boolean operator
20712086
.Sq Ic \&!
2072-
may be used to logically negate an entire conditional.
2087+
may be used to logically negate an expression, typically a function call.
20732088
It is of higher precedence than
20742089
.Sq Ic \&&& .
20752090
.Pp
@@ -2119,9 +2134,9 @@ may also be an arithmetic or string comparison.
21192134
Variable expansion is performed on both sides of the comparison.
21202135
If both sides are numeric and neither is enclosed in quotes,
21212136
the comparison is done numerically, otherwise lexicographically.
2122-
A string is interpreted as hexadecimal integer if it is preceded by
2137+
A string is interpreted as a hexadecimal integer if it is preceded by
21232138
.Li 0x ,
2124-
otherwise it is a decimal floating-point number;
2139+
otherwise it is interpreted as a decimal floating-point number;
21252140
octal numbers are not supported.
21262141
.Pp
21272142
All comparisons may use the operators
@@ -2142,7 +2157,7 @@ and its numeric value (if any) is not zero.
21422157
When
21432158
.Nm
21442159
is evaluating one of these conditional expressions, and it encounters
2145-
a (whitespace separated) word it doesn't recognize, either the
2160+
a (whitespace-separated) word it doesn't recognize, either the
21462161
.Dq make
21472162
or
21482163
.Dq defined
@@ -2165,12 +2180,13 @@ function is applied.
21652180
.Pp
21662181
If the conditional evaluates to true,
21672182
parsing of the makefile continues as before.
2168-
If it evaluates to false, the following lines are skipped.
2169-
In both cases, this continues until the corresponding
2183+
If it evaluates to false, the following lines until the corresponding
2184+
.Sq Ic .elif
2185+
variant,
21702186
.Sq Ic .else
21712187
or
21722188
.Sq Ic .endif
2173-
is found.
2189+
are skipped.
21742190
.Ss For loops
21752191
For loops are typically used to apply a set of rules to a list of files.
21762192
The syntax of a for loop is:

contrib/bmake/bmake.cat1

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,17 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1)
157157

158158
-j max_jobs
159159
Specify the maximum number of jobs that bmake may have running at
160-
any one time. The value of max_jobs is saved in .MAKE.JOBS.
161-
Turns compatibility mode off, unless the -B option is also speci-
162-
fied. When compatibility mode is off, all commands associated
163-
with a target are executed in a single shell invocation as op-
164-
posed to the traditional one shell invocation per line. This can
165-
break traditional scripts which change directories on each com-
166-
mand invocation and then expect to start with a fresh environment
167-
on the next line. It is more efficient to correct the scripts
168-
rather than turn backwards compatibility on.
160+
any one time. If max_jobs is a floating point number, or ends
161+
with `C', then the value is multiplied by the number of CPUs re-
162+
ported online by sysconf(3). The value of max_jobs is saved in
163+
.MAKE.JOBS. Turns compatibility mode off, unless the -B option
164+
is also specified. When compatibility mode is off, all commands
165+
associated with a target are executed in a single shell invoca-
166+
tion as opposed to the traditional one shell invocation per line.
167+
This can break traditional scripts which change directories on
168+
each command invocation and then expect to start with a fresh en-
169+
vironment on the next line. It is more efficient to correct the
170+
scripts rather than turn backwards compatibility on.
169171

170172
A job token pool with max_jobs tokens is used to control the to-
171173
tal number of jobs running. Each instance of bmake will wait for
@@ -625,6 +627,10 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1)
625627
.MAKE.JOBS
626628
The argument to the -j option.
627629

630+
.MAKE.JOBS.C
631+
A read-only boolean that indicates whether the -j option supports
632+
use of `C'.
633+
628634
.MAKE.LEVEL
629635
The recursion depth of bmake. The top-level instance of bmake
630636
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)
972978

973979
:gmtime[=timestamp]
974980
The value is interpreted as a format string for strftime(3), using
975-
gmtime(3), producing the formatted timestamp. If a timestamp value
976-
is not provided or is 0, the current time is used.
981+
gmtime(3), producing the formatted timestamp. Note: the `%s' format
982+
should only be used with `:localtime'. If a timestamp value is not
983+
provided or is 0, the current time is used.
977984

978985
:hash
979986
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)
13131320

13141321
bmake only evaluates a conditional as far as is necessary to determine
13151322
its value. Parentheses can be used to override the operator precedence.
1316-
The boolean operator `!' may be used to logically negate an entire condi-
1317-
tional. It is of higher precedence than `&&'.
1323+
The boolean operator `!' may be used to logically negate an expression,
1324+
typically a function call. It is of higher precedence than `&&'.
13181325

13191326
The value of expression may be any of the following function call expres-
13201327
sions:
@@ -1346,9 +1353,9 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1)
13461353
Expression may also be an arithmetic or string comparison. Variable ex-
13471354
pansion is performed on both sides of the comparison. If both sides are
13481355
numeric and neither is enclosed in quotes, the comparison is done numeri-
1349-
cally, otherwise lexicographically. A string is interpreted as hexadeci-
1350-
mal integer if it is preceded by 0x, otherwise it is a decimal floating-
1351-
point number; octal numbers are not supported.
1356+
cally, otherwise lexicographically. A string is interpreted as a hexa-
1357+
decimal integer if it is preceded by 0x, otherwise it is interpreted as a
1358+
decimal floating-point number; octal numbers are not supported.
13521359

13531360
All comparisons may use the operators `==' and `!='. Numeric comparisons
13541361
may also use the operators `<', `<=', `>' and `>='.
@@ -1358,16 +1365,15 @@ BMAKE(1) FreeBSD General Commands Manual BMAKE(1)
13581365
any) is not zero.
13591366

13601367
When bmake is evaluating one of these conditional expressions, and it en-
1361-
counters a (whitespace separated) word it doesn't recognize, either the
1368+
counters a (whitespace-separated) word it doesn't recognize, either the
13621369
"make" or "defined" function is applied to it, depending on the form of
13631370
the conditional. If the form is `.ifdef', `.ifndef' or `.if', the
13641371
"defined" function is applied. Similarly, if the form is `.ifmake' or
13651372
`.ifnmake', the "make" function is applied.
13661373

13671374
If the conditional evaluates to true, parsing of the makefile continues
1368-
as before. If it evaluates to false, the following lines are skipped.
1369-
In both cases, this continues until the corresponding `.else' or `.endif'
1370-
is found.
1375+
as before. If it evaluates to false, the following lines until the cor-
1376+
responding `.elif' variant, `.else' or `.endif' are skipped.
13711377

13721378
For loops
13731379
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)
17531759
attempt to suppress a cascade of unnecessary errors, can result in a
17541760
seemingly unexplained `*** Error code 6'
17551761

1756-
FreeBSD 13.0 May 10, 2023 FreeBSD 13.0
1762+
FreeBSD 13.0 September 9, 2023 FreeBSD 13.0

contrib/bmake/boot-strap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
# Simon J. Gerraty <[email protected]>
120120

121121
# RCSid:
122-
# $Id: boot-strap,v 1.57 2021/10/22 20:32:21 sjg Exp $
122+
# $Id: boot-strap,v 1.58 2023/06/27 21:02:19 sjg Exp $
123123
#
124124
# @(#) Copyright (c) 2001 Simon J. Gerraty
125125
#
@@ -420,7 +420,7 @@ op_build() {
420420

421421
op_test() {
422422
[ -x bmake ] || op_build
423-
Bmake test "$@" TEST_MAKE=$objdir/bmake || exit 1
423+
Bmake test TEST_MAKE=$objdir/bmake "$@" || exit 1
424424
}
425425

426426
op_clean() {

contrib/bmake/cond.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: cond.c,v 1.353 2023/06/23 05:21:10 rillig Exp $ */
1+
/* $NetBSD: cond.c,v 1.354 2023/08/11 04:56:31 rillig Exp $ */
22

33
/*
44
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -92,7 +92,7 @@
9292
#include "dir.h"
9393

9494
/* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */
95-
MAKE_RCSID("$NetBSD: cond.c,v 1.353 2023/06/23 05:21:10 rillig Exp $");
95+
MAKE_RCSID("$NetBSD: cond.c,v 1.354 2023/08/11 04:56:31 rillig Exp $");
9696

9797
/*
9898
* Conditional expressions conform to this grammar:
@@ -224,17 +224,13 @@ ParseWord(const char **pp, bool doEval)
224224
if ((ch == '&' || ch == '|') && paren_depth == 0)
225225
break;
226226
if (ch == '$') {
227-
/*
228-
* Parse the variable expression and install it as
229-
* part of the argument if it's valid. We tell
230-
* Var_Parse to complain on an undefined variable,
231-
* (XXX: but Var_Parse ignores that request)
232-
* so we don't need to do it. Nor do we return an
233-
* error, though perhaps we should.
234-
*/
235227
VarEvalMode emode = doEval
236228
? VARE_UNDEFERR
237229
: VARE_PARSE_ONLY;
230+
/*
231+
* TODO: make Var_Parse complain about undefined
232+
* variables.
233+
*/
238234
FStr nestedVal = Var_Parse(&p, SCOPE_CMDLINE, emode);
239235
/* TODO: handle errors */
240236
Buf_AddStr(&word, nestedVal.str);
@@ -1267,7 +1263,6 @@ Cond_ExtractGuard(const char *line)
12671263
{
12681264
const char *p, *varname;
12691265
Substring dir;
1270-
enum GuardKind kind;
12711266
Guard *guard;
12721267

12731268
p = line + 1; /* skip the '.' */
@@ -1288,10 +1283,9 @@ Cond_ExtractGuard(const char *line)
12881283
const char *arg_p = p;
12891284
free(ParseWord(&p, false));
12901285
if (strcmp(p, ")") == 0) {
1291-
char *target = ParseWord(&arg_p, true);
12921286
guard = bmake_malloc(sizeof(*guard));
12931287
guard->kind = GK_TARGET;
1294-
guard->name = target;
1288+
guard->name = ParseWord(&arg_p, true);
12951289
return guard;
12961290
}
12971291
}
@@ -1302,9 +1296,8 @@ Cond_ExtractGuard(const char *line)
13021296
return NULL;
13031297

13041298
found_variable:
1305-
kind = GK_VARIABLE;
13061299
guard = bmake_malloc(sizeof(*guard));
1307-
guard->kind = kind;
1300+
guard->kind = GK_VARIABLE;
13081301
guard->name = bmake_strsedup(varname, p);
13091302
return guard;
13101303
}

0 commit comments

Comments
 (0)