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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * VERSION (_MAKE_VERSION): 20240701 + Merge with NetBSD make, pick up + o var.c: add :tt for Title case + +2024-06-30 Simon J Gerraty + + * 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 * 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 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 header file, and it defines `DIR'. +/* Define to 1 if you have the 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 header file. */ @@ -41,25 +41,25 @@ /* Define to 1 if you have the 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 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 header file. */ @@ -68,16 +68,13 @@ /* Define to 1 if you have the 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 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 header file, and it defines `DIR'. */ +/* Define to 1 if you have the header file, and it defines 'DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ @@ -86,58 +83,58 @@ /* Define to 1 if you have the 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 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 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 header file. */ @@ -149,13 +146,13 @@ /* Define to 1 if you have the 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 header file. */ @@ -164,35 +161,35 @@ /* Define to 1 if you have the 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 header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H -/* Define to 1 if you have the header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ #undef HAVE_SYS_NDIR_H @@ -226,49 +223,49 @@ /* Define to 1 if you have the 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 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 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 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 do not work properly. */ +/* Define to 1 if the 'S_IS*' macros in 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 declares `struct tm'. */ +/* Define to 1 if your 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 does not define. */ +/* Define to 'int' if does not define. */ #undef mode_t -/* Define to `long int' if does not define. */ +/* Define to 'long int' if does not define. */ #undef off_t /* Define as a signed integer type capable of holding a process identifier. */ @@ -436,12 +437,12 @@ /* type that signal handlers can safely frob */ #undef sig_atomic_t -/* Define to `unsigned int' if does not define. */ +/* Define as 'unsigned int' if doesn't define. */ #undef size_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t -/* Define as `fork' if `vfork' does not work. */ +/* Define as 'fork' if 'vfork' does not work. */ #undef vfork diff --git a/contrib/bmake/configure b/contrib/bmake/configure index 08a550f3cf86..e34740cd2cfa 100755 --- a/contrib/bmake/configure +++ b/contrib/bmake/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for bmake 20240314. +# Generated by GNU Autoconf 2.72 for bmake 20240711. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -17,7 +17,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -26,12 +25,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -103,7 +103,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -133,15 +133,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -149,12 +148,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -172,8 +172,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -186,14 +187,15 @@ test -x / || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -226,12 +228,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -253,7 +256,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -273,7 +276,8 @@ $0: manually run the script under such a shell if you do $0: have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -312,14 +316,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -388,11 +384,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -406,21 +403,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -494,6 +484,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -542,7 +534,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -554,9 +545,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -581,10 +572,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 /dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -879,7 +872,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1092,7 +1085,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1108,7 +1101,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1138,8 +1131,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1147,7 +1140,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1197,7 +1190,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1265,7 +1258,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1293,7 +1286,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 20240314 to adapt to many kinds of systems. +'configure' configures bmake 20240711 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1307,11 +1300,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1319,10 +1312,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1355,7 +1348,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bmake 20240314:";; + short | recursive ) echo "Configuration of bmake 20240711:";; esac cat <<\_ACEOF @@ -1398,7 +1391,7 @@ Some influential environment variables: CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . @@ -1465,10 +1458,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bmake configure 20240314 -generated by GNU Autoconf 2.71 +bmake configure 20240711 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1507,11 +1500,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1530,8 +1524,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1539,10 +1533,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1582,11 +1578,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1628,12 +1625,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1653,8 +1651,8 @@ printf %s "checking for int$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ @@ -1695,12 +1693,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - case $ac_type in #( +else case e in #( + e) case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; +esac ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -1709,10 +1708,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : -else $as_nop - break +else case e in #( + e) break ;; +esac fi - done + done ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1733,8 +1734,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -1764,12 +1765,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1790,8 +1793,8 @@ printf %s "checking for uint$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ @@ -1823,10 +1826,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : -else $as_nop - break +else case e in #( + e) break ;; +esac fi - done + done ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1848,8 +1853,8 @@ printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` +else case e in #( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1873,12 +1878,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS - + ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1898,15 +1905,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (void); below. */ #include #undef $2 @@ -1917,7 +1924,7 @@ else $as_nop #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1936,11 +1943,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1972,8 +1981,8 @@ 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 20240314, which was -generated by GNU Autoconf 2.71. Invocation command line was +It was created by bmake $as_me 20240711, which was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -2219,10 +2228,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2259,9 +2268,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -2275,6 +2282,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2302,16 +2324,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2361,7 +2386,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2427,6 +2451,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2448,7 +2474,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -2646,8 +2672,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -2675,12 +2702,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2689,18 +2716,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -2716,11 +2743,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -2753,7 +2780,7 @@ use_defshell() { case "$1" in *csh) # we must be desperate DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; - *ksh) + *ksh*) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;; sh|/bin/sh|*/bsh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; @@ -2837,8 +2864,8 @@ case "$use_filemon,$filemon_h" in ,*.h) use_filemon=dev;; esac -else $as_nop - +else case e in #( + e) case "$OS" in NetBSD) filemon_h=no use_filemon=ktrace;; *) @@ -2858,7 +2885,8 @@ case "$use_filemon" in dev) ;; *) filemon_h=no;; esac - + ;; +esac fi @@ -2895,12 +2923,14 @@ fi echo $ECHO_N "checking whether system has timezone Europe/Berlin... $ECHO_C" >&6 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 +if test ${utc1_d-0} = 01 -a ${utc_d-0} -gt ${utc1_d-0} || + test ${utc_d-0} -lt ${utc1_d-0} -o ${utc_H-0} -lt ${utc1_H-0}; then echo yes >&6 UTC_1=Europe/Berlin else 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 + if test ${utc1_d-0} = 01 -a ${utc_d-0} -gt ${utc1_d-0} || + 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 fi @@ -2935,8 +2965,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2958,7 +2988,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -2980,8 +3011,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3003,7 +3034,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3038,8 +3070,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3061,7 +3093,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3083,8 +3116,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -3123,7 +3156,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3147,8 +3181,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3170,7 +3204,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3196,8 +3231,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3219,7 +3254,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3257,8 +3293,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3280,7 +3316,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3302,8 +3339,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3325,7 +3362,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3354,10 +3392,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3429,8 +3467,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -3450,7 +3488,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -3461,8 +3499,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -3471,13 +3510,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -3501,10 +3541,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -3514,11 +3554,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3534,6 +3575,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -3573,26 +3616,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3624,16 +3668,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -3644,8 +3690,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3662,12 +3708,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -3685,8 +3733,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -3704,8 +3752,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3720,8 +3768,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3738,12 +3786,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -3770,8 +3821,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3788,25 +3839,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -3816,8 +3870,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3834,25 +3888,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -3862,8 +3919,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3880,25 +3937,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -3949,8 +4009,8 @@ printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 @@ -3966,10 +4026,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes -else $as_nop - ac_cv_safe_to_define___extensions__=no +else case e in #( + e) ac_cv_safe_to_define___extensions__=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } @@ -3979,8 +4041,8 @@ printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_should_define__xopen_source=no +else case e in #( + e) ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3999,8 +4061,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 @@ -4018,10 +4080,12 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } @@ -4046,6 +4110,8 @@ printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + printf "%s\n" "#define __STDC_WANT_IEC_60559_EXT__ 1" >>confdefs.h + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h @@ -4065,8 +4131,9 @@ then : printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h -else $as_nop - MINIX= +else case e in #( + e) MINIX= ;; +esac fi if test $ac_cv_safe_to_define___extensions__ = yes then : @@ -4092,8 +4159,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4115,7 +4182,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4137,8 +4205,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4160,7 +4228,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4195,8 +4264,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4218,7 +4287,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4240,8 +4310,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -4280,7 +4350,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4304,8 +4375,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4327,7 +4398,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4353,8 +4425,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4376,7 +4448,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4414,8 +4487,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4437,7 +4510,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4459,8 +4533,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4482,7 +4556,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4511,10 +4586,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -4546,8 +4621,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4564,12 +4639,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -4587,8 +4664,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -4606,8 +4683,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4622,8 +4699,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4640,12 +4717,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -4672,8 +4752,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4690,25 +4770,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4718,8 +4801,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4736,25 +4819,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4764,8 +4850,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4782,25 +4868,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -4832,8 +4921,8 @@ if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -4887,7 +4976,8 @@ esac IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - + ;; +esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install @@ -4958,8 +5048,8 @@ printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if test ${ac_cv_header_sys_wait_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -4983,10 +5073,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_sys_wait_h=yes -else $as_nop - ac_cv_header_sys_wait_h=no +else case e in #( + e) ac_cv_header_sys_wait_h=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } @@ -4998,14 +5090,14 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 printf %s "checking for $ac_hdr that defines DIR... " >&6; } if eval test \${$as_ac_Header+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> @@ -5022,10 +5114,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_ac_Header=yes" -else $as_nop - eval "$as_ac_Header=no" +else case e in #( + e) eval "$as_ac_Header=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$as_ac_Header { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -5033,7 +5127,7 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -5047,15 +5141,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -5086,11 +5186,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -5107,15 +5209,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -5146,11 +5254,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -5278,8 +5388,9 @@ ac_fn_c_check_header_compile "$LINENO" "sys/cdefs.h" "ac_cv_header_sys_cdefs_h" if test "x$ac_cv_header_sys_cdefs_h" = xyes then : -else $as_nop - CPPFLAGS="${CPPFLAGS} -I`cd ${srcdir}/missing && pwd`" +else case e in #( + e) CPPFLAGS="${CPPFLAGS} -I`cd ${srcdir}/missing && pwd`" ;; +esac fi @@ -5289,8 +5400,8 @@ printf %s "checking for __attribute__... " >&6; } if test ${ac_cv___attribute__+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5314,11 +5425,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv___attribute__=yes -else $as_nop - ac_cv___attribute__=no +else case e in #( + e) ac_cv___attribute__=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi if test "$ac_cv___attribute__" = "yes"; then @@ -5334,8 +5447,8 @@ printf %s "checking whether byte ordering is bigendian... " >&6; } if test ${ac_cv_c_bigendian+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_bigendian=unknown +else case e in #( + e) ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5381,8 +5494,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext int main (void) { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ && LITTLE_ENDIAN) bogus endian macros #endif @@ -5413,8 +5526,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -5458,8 +5572,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -5486,22 +5601,23 @@ unsigned short int ascii_mm[] = int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } - extern int foo; - -int -main (void) -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -5510,9 +5626,10 @@ then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -5535,14 +5652,17 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_bigendian=no -else $as_nop - ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 printf "%s\n" "$ac_cv_c_bigendian" >&6; } @@ -5567,8 +5687,8 @@ printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5632,10 +5752,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes -else $as_nop - ac_cv_c_const=no +else case e in #( + e) ac_cv_c_const=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } @@ -5650,8 +5772,8 @@ printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_inline=no +else case e in #( + e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5669,7 +5791,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } @@ -5704,8 +5827,8 @@ printf %s "checking for unsigned long long int... " >&6; } if test ${ac_cv_type_unsigned_long_long_int+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_type_unsigned_long_long_int=yes +else case e in #( + e) ac_cv_type_unsigned_long_long_int=yes case $ac_prog_cc_stdc in no | c89) ;; *) @@ -5744,12 +5867,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : -else $as_nop - ac_cv_type_unsigned_long_long_int=no +else case e in #( + e) ac_cv_type_unsigned_long_long_int=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext;; - esac + esac ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } @@ -5766,8 +5891,8 @@ printf %s "checking for long long int... " >&6; } if test ${ac_cv_type_long_long_int+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_type_long_long_int=yes +else case e in #( + e) ac_cv_type_long_long_int=yes case $ac_prog_cc_stdc in no | c89) ;; *) @@ -5776,12 +5901,12 @@ else $as_nop if test "$cross_compiling" = yes then : : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef LLONG_MAX - # define HALF \ + # define HALF \\ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) # define LLONG_MAX (HALF - 1 + HALF) #endif @@ -5806,15 +5931,18 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : -else $as_nop - ac_cv_type_long_long_int=no +else case e in #( + e) ac_cv_type_long_long_int=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi fi;; - esac + esac ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 printf "%s\n" "$ac_cv_type_long_long_int" >&6; } @@ -5828,20 +5956,22 @@ ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define mode_t int" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define off_t long int" >>confdefs.h - + ;; +esac fi @@ -5850,8 +5980,8 @@ fi if test "x$ac_cv_type_pid_t" = xyes then : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ @@ -5870,14 +6000,16 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' +else case e in #( + e) ac_pid_type='__int64' ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - + ;; +esac fi @@ -5885,10 +6017,11 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - + ;; +esac fi ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" @@ -5908,8 +6041,8 @@ printf %s "checking for $CC options needed to detect all undeclared functions... if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS +else case e in #( + e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" @@ -5928,8 +6061,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - # This test program should compile successfully. +else case e in #( + e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the @@ -5957,26 +6090,29 @@ then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg +else case e in #( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac fi break fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( +See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : @@ -5993,8 +6129,9 @@ ac_fn_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include if test "x$ac_cv_have_decl_sys_siglist" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_SYS_SIGLIST $ac_have_decl" >>confdefs.h @@ -6007,8 +6144,8 @@ printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test ${ac_cv_struct_tm+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -6026,10 +6163,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_struct_tm=time.h -else $as_nop - ac_cv_struct_tm=sys/time.h +else case e in #( + e) ac_cv_struct_tm=sys/time.h ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 printf "%s\n" "$ac_cv_struct_tm" >&6; } @@ -6080,19 +6219,19 @@ printf %s "checking for working fork... " >&6; } if test ${ac_cv_func_fork_works+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_func_fork_works=cross -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { - /* By Ruediger Kuhlmann. */ + /* By R. Kuhlmann. */ return fork () < 0; ; @@ -6102,13 +6241,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_fork_works=yes -else $as_nop - ac_cv_func_fork_works=no +else case e in #( + e) ac_cv_func_fork_works=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 printf "%s\n" "$ac_cv_func_fork_works" >&6; } @@ -6136,12 +6278,12 @@ printf %s "checking for working vfork... " >&6; } if test ${ac_cv_func_vfork_works+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_func_vfork_works=cross -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default @@ -6252,13 +6394,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_vfork_works=yes -else $as_nop - ac_cv_func_vfork_works=no +else case e in #( + e) ac_cv_func_vfork_works=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 printf "%s\n" "$ac_cv_func_vfork_works" >&6; } @@ -6303,12 +6448,12 @@ printf %s "checking for wait3 that fills in rusage... " >&6; } if test ${ac_cv_func_wait3_rusage+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : ac_cv_func_wait3_rusage=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include @@ -6349,13 +6494,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_wait3_rusage=yes -else $as_nop - ac_cv_func_wait3_rusage=no +else case e in #( + e) ac_cv_func_wait3_rusage=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_wait3_rusage" >&5 printf "%s\n" "$ac_cv_func_wait3_rusage" >&6; } @@ -6400,12 +6548,6 @@ if test "x$ac_cv_func_killpg" = xyes then : printf "%s\n" "#define HAVE_KILLPG 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" -if test "x$ac_cv_func_mmap" = xyes -then : - printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h - fi ac_fn_c_check_func "$LINENO" "putenv" "ac_cv_func_putenv" if test "x$ac_cv_func_putenv" = xyes @@ -6588,78 +6730,84 @@ if test "x$ac_cv_func_getopt" = xyes then : printf "%s\n" "#define HAVE_GETOPT 1" >>confdefs.h -else $as_nop - case " $LIBOBJS " in +else case e in #( + e) case " $LIBOBJS " in *" getopt.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getopt.$ac_objext" ;; esac - + ;; +esac fi ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" if test "x$ac_cv_func_realpath" = xyes then : printf "%s\n" "#define HAVE_REALPATH 1" >>confdefs.h -else $as_nop - case " $LIBOBJS " in +else case e in #( + e) case " $LIBOBJS " in *" realpath.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realpath.$ac_objext" ;; esac - + ;; +esac fi ac_fn_c_check_func "$LINENO" "dirname" "ac_cv_func_dirname" if test "x$ac_cv_func_dirname" = xyes then : printf "%s\n" "#define HAVE_DIRNAME 1" >>confdefs.h -else $as_nop - case " $LIBOBJS " in +else case e in #( + e) case " $LIBOBJS " in *" dirname.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS dirname.$ac_objext" ;; esac - + ;; +esac fi ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" if test "x$ac_cv_func_sigaction" = xyes then : printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h -else $as_nop - case " $LIBOBJS " in +else case e in #( + e) case " $LIBOBJS " in *" sigaction.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS sigaction.$ac_objext" ;; esac - + ;; +esac fi ac_fn_c_check_func "$LINENO" "stresep" "ac_cv_func_stresep" if test "x$ac_cv_func_stresep" = xyes then : printf "%s\n" "#define HAVE_STRESEP 1" >>confdefs.h -else $as_nop - case " $LIBOBJS " in +else case e in #( + e) case " $LIBOBJS " in *" stresep.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stresep.$ac_objext" ;; esac - + ;; +esac fi ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" if test "x$ac_cv_func_strlcpy" = xyes then : printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h -else $as_nop - case " $LIBOBJS " in +else case e in #( + e) case " $LIBOBJS " in *" strlcpy.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext" ;; esac - + ;; +esac fi @@ -6668,16 +6816,22 @@ printf %s "checking for emalloc in -lutil... " >&6; } if test ${ac_cv_lib_util_emalloc+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char emalloc (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char emalloc (void); int main (void) { @@ -6689,12 +6843,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_util_emalloc=yes -else $as_nop - ac_cv_lib_util_emalloc=no +else case e in #( + e) ac_cv_lib_util_emalloc=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_emalloc" >&5 printf "%s\n" "$ac_cv_lib_util_emalloc" >&6; } @@ -6705,16 +6861,22 @@ printf %s "checking for erealloc in -lutil... " >&6; } if test ${ac_cv_lib_util_erealloc+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char erealloc (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char erealloc (void); int main (void) { @@ -6726,12 +6888,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_util_erealloc=yes -else $as_nop - ac_cv_lib_util_erealloc=no +else case e in #( + e) ac_cv_lib_util_erealloc=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_erealloc" >&5 printf "%s\n" "$ac_cv_lib_util_erealloc" >&6; } @@ -6742,16 +6906,22 @@ printf %s "checking for estrdup in -lutil... " >&6; } if test ${ac_cv_lib_util_estrdup+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char estrdup (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char estrdup (void); int main (void) { @@ -6763,12 +6933,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_util_estrdup=yes -else $as_nop - ac_cv_lib_util_estrdup=no +else case e in #( + e) ac_cv_lib_util_estrdup=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_estrdup" >&5 printf "%s\n" "$ac_cv_lib_util_estrdup" >&6; } @@ -6779,16 +6951,22 @@ printf %s "checking for estrndup in -lutil... " >&6; } if test ${ac_cv_lib_util_estrndup+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char estrndup (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char estrndup (void); int main (void) { @@ -6800,12 +6978,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_util_estrndup=yes -else $as_nop - ac_cv_lib_util_estrndup=no +else case e in #( + e) ac_cv_lib_util_estrndup=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_estrndup" >&5 printf "%s\n" "$ac_cv_lib_util_estrndup" >&6; } @@ -6827,8 +7007,8 @@ printf %s "checking whether stat file-mode macros are broken... " >&6; } if test ${ac_cv_header_stat_broken+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -6853,10 +7033,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_stat_broken=no -else $as_nop - ac_cv_header_stat_broken=yes +else case e in #( + e) ac_cv_header_stat_broken=yes ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 printf "%s\n" "$ac_cv_header_stat_broken" >&6; } @@ -6887,10 +7069,11 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define __func__ __FUNCTION__" >>confdefs.h - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test -x /usr/gnu/bin/diff; then @@ -7122,8 +7305,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -7153,14 +7336,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -7251,7 +7434,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -7260,12 +7442,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -7337,7 +7520,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -7366,7 +7549,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -7406,11 +7588,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -7424,11 +7607,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -7511,9 +7695,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -7594,10 +7778,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -7612,8 +7798,8 @@ 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 20240314, which was -generated by GNU Autoconf 2.71. Invocation command line was +This file was extended by bmake $as_me 20240711, which was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7644,7 +7830,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -7676,11 +7862,11 @@ 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 20240314 -configured by $0, generated by GNU Autoconf 2.71, +bmake config.status 20240711 +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -7740,8 +7926,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -7749,8 +7935,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -7801,7 +7987,7 @@ do "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "$bm_outfiles") CONFIG_FILES="$CONFIG_FILES $bm_outfiles" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -7820,7 +8006,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -7844,7 +8030,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -8002,13 +8188,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -8118,7 +8304,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -8140,19 +8326,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -8280,7 +8466,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -8310,9 +8496,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" diff --git a/contrib/bmake/configure.in b/contrib/bmake/configure.in index 0796e9afdc8d..294246dea60d 100644 --- a/contrib/bmake/configure.in +++ b/contrib/bmake/configure.in @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.105 2024/03/19 19:08:20 sjg Exp $ +dnl $Id: configure.in,v 1.108 2024/07/13 15:27:00 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ([2.71]) -AC_INIT([bmake],[20240314],[sjg@NetBSD.org]) +AC_INIT([bmake],[20240711],[sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -27,7 +27,7 @@ use_defshell() { case "$1" in *csh) # we must be desperate DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; - *ksh) + *ksh*) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;; sh|/bin/sh|*/bsh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; @@ -165,12 +165,14 @@ dnl echo $ECHO_N "checking whether system has timezone Europe/Berlin... $ECHO_C" >&6 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 +if test ${utc1_d-0} = 01 -a ${utc_d-0} -gt ${utc1_d-0} || + test ${utc_d-0} -lt ${utc1_d-0} -o ${utc_H-0} -lt ${utc1_H-0}; then echo yes >&6 UTC_1=Europe/Berlin else 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 + if test ${utc1_d-0} = 01 -a ${utc_d-0} -gt ${utc1_d-0} || + 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 fi @@ -324,7 +326,6 @@ AC_CHECK_FUNCS( \ getenv \ getwd \ killpg \ - mmap \ putenv \ select \ setenv \ diff --git a/contrib/bmake/dir.c b/contrib/bmake/dir.c index 860697120db0..d017a89e4753 100644 --- a/contrib/bmake/dir.c +++ b/contrib/bmake/dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.294 2024/05/31 05:50:11 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.295 2024/07/07 07:50:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -132,7 +132,7 @@ #include "job.h" /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: dir.c,v 1.294 2024/05/31 05:50:11 rillig Exp $"); +MAKE_RCSID("$NetBSD: dir.c,v 1.295 2024/07/07 07:50:57 rillig Exp $"); /* * A search path is a list of CachedDir structures. A CachedDir has in it the @@ -511,13 +511,11 @@ FreeCachedTable(HashTable *tbl) free(hi.entry->value); HashTable_Done(tbl); } -#endif /* Clean up the directories module. */ void Dir_End(void) { -#ifdef CLEANUP CachedDir_Assign(&cur, NULL); CachedDir_Assign(&dot, NULL); CachedDir_Assign(&dotLast, NULL); @@ -525,8 +523,8 @@ Dir_End(void) OpenDirs_Done(&openDirs); FreeCachedTable(&mtimes); FreeCachedTable(&lmtimes); -#endif } +#endif /* * We want ${.PATH} to indicate the order in which we will actually diff --git a/contrib/bmake/dir.h b/contrib/bmake/dir.h index 58bfd8c996ef..79c75598f68b 100644 --- a/contrib/bmake/dir.h +++ b/contrib/bmake/dir.h @@ -1,4 +1,4 @@ -/* $NetBSD: dir.h,v 1.48 2024/05/19 20:09:40 sjg Exp $ */ +/* $NetBSD: dir.h,v 1.49 2024/07/07 07:50:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -80,7 +80,9 @@ typedef struct CachedDir CachedDir; void Dir_Init(void); void Dir_InitCur(const char *); void Dir_InitDot(void); +#ifdef CLEANUP void Dir_End(void); +#endif void Dir_SetPATH(void); void Dir_SetSYSPATH(void); bool Dir_HasWildcards(const char *) MAKE_ATTR_USE; diff --git a/contrib/bmake/hash.c b/contrib/bmake/hash.c index bc7279d7a994..e84ef412bdef 100644 --- a/contrib/bmake/hash.c +++ b/contrib/bmake/hash.c @@ -1,4 +1,4 @@ -/* $NetBSD: hash.c,v 1.78 2024/06/05 22:06:53 rillig Exp $ */ +/* $NetBSD: hash.c,v 1.79 2024/07/07 09:37:00 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -74,7 +74,7 @@ #include "make.h" /* "@(#)hash.c 8.1 (Berkeley) 6/6/93" */ -MAKE_RCSID("$NetBSD: hash.c,v 1.78 2024/06/05 22:06:53 rillig Exp $"); +MAKE_RCSID("$NetBSD: hash.c,v 1.79 2024/07/07 09:37:00 rillig Exp $"); /* * The ratio of # entries to # buckets at which we rebuild the table to @@ -114,7 +114,6 @@ static HashEntry * HashTable_Find(HashTable *t, Substring key, unsigned int h) { HashEntry *he; - unsigned int chainlen = 0; size_t keyLen = Substring_Length(key); #ifdef DEBUG_HASH_LOOKUP @@ -123,16 +122,12 @@ HashTable_Find(HashTable *t, Substring key, unsigned int h) #endif for (he = t->buckets[h & t->bucketsMask]; he != NULL; he = he->next) { - chainlen++; if (he->hash == h && strncmp(he->key, key.start, keyLen) == 0 && he->key[keyLen] == '\0') break; } - if (chainlen > t->maxchain) - t->maxchain = chainlen; - return he; } @@ -149,7 +144,6 @@ HashTable_Init(HashTable *t) t->bucketsSize = n; t->numEntries = 0; t->bucketsMask = n - 1; - t->maxchain = 0; } /* @@ -205,6 +199,20 @@ HashTable_FindValueBySubstringHash(HashTable *t, Substring key, unsigned int h) return he != NULL ? he->value : NULL; } +static unsigned +HashTable_MaxChain(const HashTable *t) +{ + unsigned b, cl, max_cl = 0; + for (b = 0; b < t->bucketsSize; b++) { + const HashEntry *he = t->buckets[b]; + for (cl = 0; he != NULL; he = he->next) + cl++; + if (cl > max_cl) + max_cl = cl; + } + return max_cl; +} + /* * Make the hash table larger. Any bucket numbers from the old table become * invalid; the hash values stay valid though. @@ -238,8 +246,7 @@ HashTable_Enlarge(HashTable *t) t->bucketsMask = newMask; t->buckets = newBuckets; DEBUG4(HASH, "HashTable_Enlarge: %p size=%d entries=%d maxchain=%d\n", - (void *)t, t->bucketsSize, t->numEntries, t->maxchain); - t->maxchain = 0; + (void *)t, t->bucketsSize, t->numEntries, HashTable_MaxChain(t)); } /* @@ -321,8 +328,8 @@ HashIter_Next(HashIter *hi) } void -HashTable_DebugStats(HashTable *t, const char *name) +HashTable_DebugStats(const HashTable *t, const char *name) { - DEBUG4(HASH, "HashTable %s: size=%u numEntries=%u maxchain=%u\n", - name, t->bucketsSize, t->numEntries, t->maxchain); + DEBUG4(HASH, "HashTable \"%s\": size=%u entries=%u maxchain=%u\n", + name, t->bucketsSize, t->numEntries, HashTable_MaxChain(t)); } diff --git a/contrib/bmake/hash.h b/contrib/bmake/hash.h index 9201c65025c7..d6f9d03fb3ab 100644 --- a/contrib/bmake/hash.h +++ b/contrib/bmake/hash.h @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.50 2024/06/01 10:10:50 rillig Exp $ */ +/* $NetBSD: hash.h,v 1.51 2024/07/07 09:37:00 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -92,7 +92,6 @@ typedef struct HashTable { unsigned int bucketsSize; unsigned int numEntries; unsigned int bucketsMask; /* Used to select the bucket for a hash. */ - unsigned int maxchain; /* Maximum length of chain seen. */ } HashTable; /* State of an iteration over all entries in a table. */ @@ -138,7 +137,7 @@ void *HashTable_FindValueBySubstringHash(HashTable *, Substring, unsigned int) HashEntry *HashTable_CreateEntry(HashTable *, const char *, bool *); void HashTable_Set(HashTable *, const char *, void *); void HashTable_DeleteEntry(HashTable *, HashEntry *); -void HashTable_DebugStats(HashTable *, const char *); +void HashTable_DebugStats(const HashTable *, const char *); bool HashIter_Next(HashIter *) MAKE_ATTR_USE; diff --git a/contrib/bmake/job.c b/contrib/bmake/job.c index a5c3d704e4a1..26a691323025 100644 --- a/contrib/bmake/job.c +++ b/contrib/bmake/job.c @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.477 2024/06/25 05:18:38 rillig Exp $ */ +/* $NetBSD: job.c,v 1.480 2024/07/07 07:50:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -154,7 +154,7 @@ #include "trace.h" /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: job.c,v 1.477 2024/06/25 05:18:38 rillig Exp $"); +MAKE_RCSID("$NetBSD: job.c,v 1.480 2024/07/07 07:50:57 rillig Exp $"); /* * A shell defines how the commands are run. All commands for a target are @@ -428,7 +428,7 @@ static Shell shells[] = { * It is set by the Job_ParseShell function. */ static Shell *shell = &shells[DEFSHELL_INDEX]; -const char *shellPath = NULL; /* full pathname of executable image */ +char *shellPath; /* full pathname of executable image */ const char *shellName = NULL; /* last component of shellPath */ char *shellErrFlag = NULL; static char *shell_freeIt = NULL; /* Allocated memory for custom .SHELL */ @@ -623,7 +623,6 @@ JobCondPassSig(int signo) * * Sends a token on the child exit pipe to wake us up from select()/poll(). */ -/*ARGSUSED*/ static void JobChildSig(int signo MAKE_ATTR_UNUSED) { @@ -635,7 +634,6 @@ JobChildSig(int signo MAKE_ATTR_UNUSED) /* Resume all stopped jobs. */ -/*ARGSUSED*/ static void JobContinueSig(int signo MAKE_ATTR_UNUSED) { @@ -2175,7 +2173,7 @@ InitShellNameAndPath(void) } #endif #ifdef DEFSHELL_PATH - shellPath = DEFSHELL_PATH; + shellPath = bmake_strdup(DEFSHELL_PATH); #else shellPath = str_concat3(_PATH_DEFSHELLDIR, "/", shellName); #endif @@ -2516,13 +2514,13 @@ Job_ParseShell(char *line) * Shell_Init has already been called! * Do it again. */ - free(UNCONST(shellPath)); + free(shellPath); shellPath = NULL; Shell_Init(); } } } else { - free(UNCONST(shellPath)); + free(shellPath); shellPath = bmake_strdup(path); shellName = newShell.name != NULL ? newShell.name : str_basename(path); @@ -2630,14 +2628,14 @@ Job_Finish(void) return job_errors; } +#ifdef CLEANUP /* Clean up any memory used by the jobs module. */ void Job_End(void) { -#ifdef CLEANUP free(shell_freeIt); -#endif } +#endif /* * Waits for all running jobs to finish and returns. diff --git a/contrib/bmake/job.h b/contrib/bmake/job.h index 26185ba84a7d..085aa04e8e44 100644 --- a/contrib/bmake/job.h +++ b/contrib/bmake/job.h @@ -1,4 +1,4 @@ -/* $NetBSD: job.h,v 1.78 2023/12/19 19:33:39 rillig Exp $ */ +/* $NetBSD: job.h,v 1.80 2024/07/07 07:50:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -179,7 +179,7 @@ typedef struct Job { #endif } Job; -extern const char *shellPath; +extern char *shellPath; extern const char *shellName; extern char *shellErrFlag; @@ -196,7 +196,9 @@ void Job_Make(GNode *); void Job_Init(void); bool Job_ParseShell(char *) MAKE_ATTR_USE; int Job_Finish(void); +#ifdef CLEANUP void Job_End(void); +#endif void Job_Wait(void); void Job_AbortAll(void); void Job_TokenReturn(void); diff --git a/contrib/bmake/main.c b/contrib/bmake/main.c index de2f486c15d9..c1adf521296d 100644 --- a/contrib/bmake/main.c +++ b/contrib/bmake/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.624 2024/06/02 15:31:26 rillig Exp $ */ +/* $NetBSD: main.c,v 1.632 2024/07/11 20:09:16 sjg 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.624 2024/06/02 15:31:26 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.632 2024/07/11 20:09:16 sjg Exp $"); #if defined(MAKE_NATIVE) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -793,7 +793,6 @@ AppendWords(StringList *lp, char *str) } #ifdef SIGINFO -/*ARGSUSED*/ static void siginfo(int signo MAKE_ATTR_UNUSED) { @@ -1361,7 +1360,6 @@ main_Init(int argc, char **argv) /* Just in case MAKEOBJDIR wants us to do something tricky. */ Targ_Init(); - Var_Init(); #ifdef FORCE_MAKE_OS Global_Set_ReadOnly(".MAKE.OS", FORCE_MAKE_OS); #else @@ -1604,25 +1602,31 @@ main_CleanUp(void) if (opts.enterFlag) printf("%s: Leaving directory `%s'\n", progname, curdir); + Var_Stats(); + Targ_Stats(); + #ifdef USE_META meta_finish(); #endif +#ifdef CLEANUP Suff_End(); - Var_End(); Targ_End(); Arch_End(); Parse_End(); Dir_End(); Job_End(); +#endif Trace_End(); +#ifdef CLEANUP Str_Intern_End(); +#endif } /* Determine the exit code. */ static int main_Exit(bool outOfDate) { - if (opts.strict && (main_errors > 0 || Parse_NumErrors() > 0)) + if ((opts.strict && main_errors > 0) || parseErrors > 0) return 2; /* Not 1 so -q can distinguish error */ return outOfDate ? 1 : 0; } @@ -1703,6 +1707,56 @@ found: return true; } +/* populate av for Cmd_Exec and Compat_RunCommand */ +int +Cmd_Argv(const char *cmd, size_t cmd_len, const char **av, size_t avsz, + char *cmd_file, size_t cmd_filesz, bool eflag, bool xflag) +{ + int ac = 0; + int cmd_fd = -1; + + if (shellPath == NULL) + Shell_Init(); + + if (cmd_file != NULL) { + if (cmd_len == 0) + cmd_len = strlen(cmd); + + if (cmd_len > MAKE_CMDLEN_LIMIT) { + cmd_fd = mkTempFile(NULL, cmd_file, cmd_filesz); + if (cmd_fd >= 0) { + ssize_t n; + + n = write(cmd_fd, cmd, cmd_len); + close(cmd_fd); + if (n < (ssize_t)cmd_len) { + unlink(cmd_file); + cmd_fd = -1; + } + } + } else + cmd_file[0] = '\0'; + } + + if (avsz < 4 || (eflag && avsz < 5)) + return -1; + + /* The following works for any of the builtin shell specs. */ + av[ac++] = shellPath; + if (eflag) + av[ac++] = shellErrFlag; + if (cmd_fd >= 0) { + if (xflag) + av[ac++] = "-x"; + av[ac++] = cmd_file; + } else { + av[ac++] = xflag ? "-xc" : "-c"; + av[ac++] = cmd; + } + av[ac] = NULL; + return ac; +} + /* * Execute the command in cmd, and return its output (only stdout, not * stderr, possibly empty). In the output, replace newlines with spaces. @@ -1721,40 +1775,11 @@ Cmd_Exec(const char *cmd, char **error) char *p; int saved_errno; char cmd_file[MAXPATHLEN]; - size_t cmd_len; - int cmd_fd = -1; - if (shellPath == NULL) - Shell_Init(); - - cmd_len = strlen(cmd); - if (cmd_len > 1000) { - cmd_fd = mkTempFile(NULL, cmd_file, sizeof(cmd_file)); - if (cmd_fd >= 0) { - ssize_t n; - - n = write(cmd_fd, cmd, cmd_len); - close(cmd_fd); - if (n < (ssize_t)cmd_len) { - unlink(cmd_file); - cmd_fd = -1; - } - } - } - - args[0] = shellName; - if (cmd_fd >= 0) { - args[1] = cmd_file; - args[2] = NULL; - } else { - cmd_file[0] = '\0'; - args[1] = "-c"; - args[2] = cmd; - args[3] = NULL; - } DEBUG1(VAR, "Capturing the output of command \"%s\"\n", cmd); - if (pipe(pipefds) == -1) { + if (Cmd_Argv(cmd, 0, args, 4, cmd_file, sizeof(cmd_file), false, false) < 0 + || pipe(pipefds) == -1) { *error = str_concat3( "Couldn't create pipe for \"", cmd, "\""); return bmake_strdup(""); @@ -1806,10 +1831,15 @@ Cmd_Exec(const char *cmd, char **error) if (WIFSIGNALED(status)) *error = str_concat3("\"", cmd, "\" exited on a signal"); - else if (WEXITSTATUS(status) != 0) - *error = str_concat3( - "\"", cmd, "\" returned non-zero status"); - else if (saved_errno != 0) + else if (WEXITSTATUS(status) != 0) { + Buffer errBuf; + Buf_Init(&errBuf); + Buf_AddStr(&errBuf, "Command \""); + Buf_AddStr(&errBuf, cmd); + Buf_AddStr(&errBuf, "\" exited with status "); + Buf_AddInt(&errBuf, WEXITSTATUS(status)); + *error = Buf_DoneData(&errBuf); + } else if (saved_errno != 0) *error = str_concat3( "Couldn't read shell's output for \"", cmd, "\""); else @@ -2084,6 +2114,7 @@ void PrintOnError(GNode *gn, const char *msg) { static GNode *errorNode = NULL; + StringListNode *ln; if (DEBUG(HASH)) { Targ_Stats(); @@ -2093,7 +2124,19 @@ PrintOnError(GNode *gn, const char *msg) if (errorNode != NULL) return; /* we've been here! */ - printf("%s%s: stopped in %s\n", msg, progname, curdir); + printf("%s%s: stopped", msg, progname); + ln = opts.create.first; + if (ln != NULL || mainNode != NULL) { + printf(" making \""); + if (ln != NULL) { + printf("%s", (const char *)ln->datum); + for (ln = ln->next; ln != NULL; ln = ln->next) + printf(" %s", (const char *)ln->datum); + } else + printf("%s", mainNode->name); + printf("\""); + } + printf(" in %s\n", curdir); /* we generally want to keep quiet if a sub-make died */ if (shouldDieQuietly(gn, -1)) diff --git a/contrib/bmake/make.1 b/contrib/bmake/make.1 index 1d079e9bd3f3..2f433275d41c 100644 --- a/contrib/bmake/make.1 +++ b/contrib/bmake/make.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 MAKE 1 .Os .Sh NAME @@ -1586,6 +1586,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/make.h b/contrib/bmake/make.h index e9ff48536c97..0023da6b2167 100644 --- a/contrib/bmake/make.h +++ b/contrib/bmake/make.h @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.339 2024/06/15 20:02:45 rillig Exp $ */ +/* $NetBSD: make.h,v 1.344 2024/07/11 20:09:16 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -114,7 +114,7 @@ #define MAKE_GNUC_PREREQ(x, y) 0 #endif -#if MAKE_GNUC_PREREQ(2, 7) +#if MAKE_GNUC_PREREQ(2, 7) || lint #define MAKE_ATTR_UNUSED __attribute__((__unused__)) #else #define MAKE_ATTR_UNUSED /* delete */ @@ -811,7 +811,9 @@ extern char **environ; /* arch.c */ void Arch_Init(void); +#ifdef CLEANUP void Arch_End(void); +#endif bool Arch_ParseArchive(char **, GNodeList *, GNode *); void Arch_Touch(GNode *); @@ -866,8 +868,13 @@ void For_Break(struct ForLoop *); /* job.c */ void JobReapChild(pid_t, int, bool); +/* longer than this we use a temp file */ +#ifndef MAKE_CMDLEN_LIMIT +# define MAKE_CMDLEN_LIMIT 1000 +#endif /* main.c */ void Main_ParseArgLine(const char *); +int Cmd_Argv(const char *, size_t, const char **, size_t, char *, size_t, bool, bool); char *Cmd_Exec(const char *, char **) MAKE_ATTR_USE; void Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2); void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; @@ -882,8 +889,11 @@ const char *cached_realpath(const char *, char *); bool GetBooleanExpr(const char *, bool); /* parse.c */ +extern int parseErrors; void Parse_Init(void); +#ifdef CLEANUP void Parse_End(void); +#endif void PrintLocation(FILE *, bool, const GNode *); void PrintStackTrace(bool); @@ -893,7 +903,6 @@ void Parse_File(const char *, int); void Parse_PushInput(const char *, unsigned, unsigned, Buffer, struct ForLoop *); void Parse_MainName(GNodeList *); -int Parse_NumErrors(void) MAKE_ATTR_USE; unsigned int CurFile_CondMinDepth(void) MAKE_ATTR_USE; void Parse_GuardElse(void); void Parse_GuardEndif(void); @@ -901,7 +910,9 @@ void Parse_GuardEndif(void); /* suff.c */ void Suff_Init(void); +#ifdef CLEANUP void Suff_End(void); +#endif void Suff_ClearSuffixes(void); bool Suff_IsTransform(const char *) MAKE_ATTR_USE; @@ -941,7 +952,6 @@ const char *GNodeMade_Name(GNodeMade) MAKE_ATTR_USE; #ifdef CLEANUP void Parse_RegisterCommand(char *); #else -/* ARGSUSED */ MAKE_INLINE void Parse_RegisterCommand(char *cmd MAKE_ATTR_UNUSED) { @@ -949,8 +959,6 @@ void Parse_RegisterCommand(char *cmd MAKE_ATTR_UNUSED) #endif /* var.c */ -void Var_Init(void); -void Var_End(void); typedef enum VarEvalMode { diff --git a/contrib/bmake/meta.c b/contrib/bmake/meta.c index 84f928785c19..316b1130aa70 100644 --- a/contrib/bmake/meta.c +++ b/contrib/bmake/meta.c @@ -36,6 +36,9 @@ # include "config.h" #endif #include +#if defined(HAVE_SYS_SELECT_H) +# include +#endif #ifdef HAVE_LIBGEN_H #include #elif !defined(HAVE_DIRNAME) diff --git a/contrib/bmake/mk/install-mk b/contrib/bmake/mk/install-mk old mode 100644 new mode 100755 diff --git a/contrib/bmake/parse.c b/contrib/bmake/parse.c index 3fbc71163a66..d530efa0ddce 100644 --- a/contrib/bmake/parse.c +++ b/contrib/bmake/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.731 2024/06/15 19:43:56 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.734 2024/07/09 19:43:01 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -105,23 +105,12 @@ #include #endif -#ifdef HAVE_MMAP -#include - -#ifndef MAP_COPY -#define MAP_COPY MAP_PRIVATE -#endif -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif -#endif - #include "dir.h" #include "job.h" #include "pathnames.h" /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: parse.c,v 1.731 2024/06/15 19:43:56 rillig Exp $"); +MAKE_RCSID("$NetBSD: parse.c,v 1.734 2024/07/09 19:43:01 rillig Exp $"); /* Detects a multiple-inclusion guard in a makefile. */ typedef enum { @@ -247,7 +236,7 @@ static StringList targCmds = LST_INIT; */ static GNode *order_pred; -static int parseErrors; +int parseErrors; /* * The include chain of makefiles. At index 0 is the top-level makefile from @@ -440,6 +429,8 @@ PrintStackTrace(bool includingInnermost) } else debug_printf("\tin %s:%u\n", fname, entry->lineno); } + if (makelevel > 0) + debug_printf("\tin directory %s\n", curdir); } /* Check if the current character is escaped on the current line. */ @@ -554,7 +545,7 @@ ParseVErrorInternal(FILE *f, bool useVars, const GNode *gn, parseErrors++; } - if (DEBUG(PARSE)) + if (level == PARSE_FATAL || DEBUG(PARSE)) PrintStackTrace(false); } @@ -2988,11 +2979,11 @@ Parse_Init(void) HashTable_Init(&guards); } +#ifdef CLEANUP /* Clean up the parsing module. */ void Parse_End(void) { -#ifdef CLEANUP HashIter hi; Lst_DoneFree(&targCmds); @@ -3009,8 +3000,8 @@ Parse_End(void) free(guard); } HashTable_Done(&guards); -#endif } +#endif /* Populate the list with the single main target to create, or error out. */ @@ -3026,9 +3017,3 @@ Parse_MainName(GNodeList *mainList) Global_Append(".TARGETS", mainNode->name); } - -int -Parse_NumErrors(void) -{ - return parseErrors; -} diff --git a/contrib/bmake/str.c b/contrib/bmake/str.c index 1153d0f029fc..f705b0deb874 100644 --- a/contrib/bmake/str.c +++ b/contrib/bmake/str.c @@ -1,4 +1,4 @@ -/* $NetBSD: str.c,v 1.103 2024/04/14 15:21:20 rillig Exp $ */ +/* $NetBSD: str.c,v 1.105 2024/07/07 07:50:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -71,7 +71,7 @@ #include "make.h" /* "@(#)str.c 5.8 (Berkeley) 6/1/90" */ -MAKE_RCSID("$NetBSD: str.c,v 1.103 2024/04/14 15:21:20 rillig Exp $"); +MAKE_RCSID("$NetBSD: str.c,v 1.105 2024/07/07 07:50:57 rillig Exp $"); static HashTable interned_strings; @@ -356,8 +356,10 @@ match_fixed_length: goto no_match; while (*pat != ']' && *pat != '\0') pat++; - if (*pat == '\0') + if (*pat == '\0') { + res.error = "Unfinished character list"; pat--; + } continue; } @@ -406,13 +408,13 @@ Str_Intern_Init(void) HashTable_Init(&interned_strings); } +#ifdef CLEANUP void Str_Intern_End(void) { -#ifdef CLEANUP HashTable_Done(&interned_strings); -#endif } +#endif /* Return a canonical instance of str, with unlimited lifetime. */ const char * diff --git a/contrib/bmake/str.h b/contrib/bmake/str.h index 6bdfbf4d497f..e61506f3d051 100644 --- a/contrib/bmake/str.h +++ b/contrib/bmake/str.h @@ -1,4 +1,4 @@ -/* $NetBSD: str.h,v 1.19 2024/01/05 21:56:55 rillig Exp $ */ +/* $NetBSD: str.h,v 1.20 2024/07/07 07:50:57 rillig Exp $ */ /* Copyright (c) 2021 Roland Illig @@ -333,5 +333,7 @@ char *str_concat3(const char *, const char *, const char *); StrMatchResult Str_Match(const char *, const char *); void Str_Intern_Init(void); +#ifdef CLEANUP void Str_Intern_End(void); +#endif const char *Str_Intern(const char *); diff --git a/contrib/bmake/suff.c b/contrib/bmake/suff.c index e1621eeab378..2ca5bb06da47 100644 --- a/contrib/bmake/suff.c +++ b/contrib/bmake/suff.c @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.380 2024/06/02 15:31:26 rillig Exp $ */ +/* $NetBSD: suff.c,v 1.382 2024/07/07 07:50:57 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -115,7 +115,7 @@ #include "dir.h" /* "@(#)suff.c 8.4 (Berkeley) 3/21/94" */ -MAKE_RCSID("$NetBSD: suff.c,v 1.380 2024/06/02 15:31:26 rillig Exp $"); +MAKE_RCSID("$NetBSD: suff.c,v 1.382 2024/07/07 07:50:57 rillig Exp $"); typedef List SuffixList; typedef ListNode SuffixListNode; @@ -979,7 +979,6 @@ Candidate_New(char *name, char *prefix, Suffix *suff, Candidate *parent, } /* Add a new candidate to the list. */ -/*ARGSUSED*/ static void CandidateList_Add(CandidateList *list, char *srcName, Candidate *targ, Suffix *suff, const char *debug_tag MAKE_ATTR_UNUSED) @@ -2042,11 +2041,11 @@ Suff_Init(void) Suff_ClearSuffixes(); } +#ifdef CLEANUP /* Clean up the suffixes module. */ void Suff_End(void) { -#ifdef CLEANUP SuffixListNode *ln; for (ln = sufflist.first; ln != NULL; ln = ln->next) @@ -2058,8 +2057,8 @@ Suff_End(void) if (nullSuff != NULL) Suffix_Free(nullSuff); Lst_Done(&transforms); -#endif } +#endif static void diff --git a/contrib/bmake/targ.c b/contrib/bmake/targ.c index 5fa9247cdedb..031cfb8b54d8 100644 --- a/contrib/bmake/targ.c +++ b/contrib/bmake/targ.c @@ -1,4 +1,4 @@ -/* $NetBSD: targ.c,v 1.183 2024/05/25 21:07:48 rillig Exp $ */ +/* $NetBSD: targ.c,v 1.184 2024/07/07 09:54:12 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -107,7 +107,7 @@ #include "dir.h" /* "@(#)targ.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: targ.c,v 1.183 2024/05/25 21:07:48 rillig Exp $"); +MAKE_RCSID("$NetBSD: targ.c,v 1.184 2024/07/07 09:54:12 rillig Exp $"); /* * All target nodes that appeared on the left-hand side of one of the @@ -126,23 +126,24 @@ void Targ_Init(void) { HashTable_Init(&allTargetsByName); + SCOPE_INTERNAL = GNode_New("Internal"); + SCOPE_GLOBAL = GNode_New("Global"); + SCOPE_CMDLINE = GNode_New("Command"); } +#ifdef CLEANUP void Targ_End(void) { -#ifdef CLEANUP GNodeListNode *ln; -#endif - Targ_Stats(); -#ifdef CLEANUP + Lst_Done(&allTargets); HashTable_Done(&allTargetsByName); for (ln = allNodes.first; ln != NULL; ln = ln->next) GNode_Free(ln->datum); Lst_Done(&allNodes); -#endif } +#endif void Targ_Stats(void) diff --git a/contrib/bmake/unit-tests/Makefile b/contrib/bmake/unit-tests/Makefile index 1b073af009db..319643b135a0 100644 --- a/contrib/bmake/unit-tests/Makefile +++ b/contrib/bmake/unit-tests/Makefile @@ -1,6 +1,6 @@ -# $Id: Makefile,v 1.219 2024/06/01 16:14:47 sjg Exp $ +# $Id: Makefile,v 1.224 2024/07/13 05:27:35 sjg Exp $ # -# $NetBSD: Makefile,v 1.347 2024/06/01 15:54:40 sjg Exp $ +# $NetBSD: Makefile,v 1.350 2024/07/07 09:37:00 rillig Exp $ # # Unit tests for make(1) # @@ -398,6 +398,7 @@ TESTS+= varmod-to-lower TESTS+= varmod-to-many-words TESTS+= varmod-to-one-word TESTS+= varmod-to-separator +TESTS+= varmod-to-title TESTS+= varmod-to-upper TESTS+= varmod-undefined TESTS+= varmod-unique @@ -465,8 +466,23 @@ _shell := ${.SHELL:tA:T} .if ${_shell} == "dash" # dash fails -x output BROKEN_TESTS+= opt-debug-x-trace -.elif ${_shell} == "ksh" -BROKEN_TESTS+= sh-flags +.elif ${_shell:N*ksh*} == "" +BROKEN_TESTS+= \ + deptgt-silent-jobs \ + job-flags \ + job-output-long-lines \ + opt-debug-x-trace \ + sh-flags \ + var-op-shell \ + +.if ${_shell:Nmksh} == "" +# more broken that pdksh +BROKEN_TESTS+= \ + opt-jobs-no-action \ + sh-errctl \ + sh-leading-hyphen \ + +.endif .endif .if ${UTC_1:Uno} == "" @@ -591,7 +607,7 @@ SED_CMDS.meta-ignore= -e 's,\(\.meta:\) [1-9][0-9]*:,\1 :,' SED_CMDS.opt-debug-graph1= ${STD_SED_CMDS.dg1} SED_CMDS.opt-debug-graph2= ${STD_SED_CMDS.dg2} SED_CMDS.opt-debug-graph3= ${STD_SED_CMDS.dg3} -SED_CMDS.opt-debug-hash= -e 's,\(numEntries\)=[1-9][0-9],\1=,' +SED_CMDS.opt-debug-hash= -e 's,\(entries\)=[1-9][0-9],\1=,' SED_CMDS.opt-debug-jobs= -e 's,([0-9][0-9]*),(),' SED_CMDS.opt-debug-jobs+= -e 's,pid [0-9][0-9]*,pid ,' SED_CMDS.opt-debug-jobs+= -e 's,Process [0-9][0-9]*,Process ,' @@ -807,7 +823,7 @@ LIMIT_RESOURCES?= : # Postprocess the test output to make the output platform-independent. # # Replace anything after 'stopped in' with unit-tests -_SED_CMDS+= -e '/stopped/s, /.*, unit-tests,' +_SED_CMDS+= -e '/stopped/s, in /.*, in unit-tests,' # Allow the test files to be placed anywhere. _SED_CMDS+= -e 's,\(\.PARSEDIR}\) = `'"/[^']*'"',\1 = ,' _SED_CMDS+= -e 's,\(\.INCLUDEDFROMDIR}\) = `'"/[^']*'"',\1 = ,' @@ -833,8 +849,10 @@ _SED_CMDS+= -e '/EGREP=/d' .if ${.MAKE.OS:N*BSD} != "" _SED_CMDS+= -e 's,\(Error code\) 255,\1 1,' .endif -.if ${.SHELL:T} == "ksh" +.if ${_shell:N*ksh*} == "" _SED_CMDS+= -e '/^set [+-]v/d' +SED_CMDS.opt-debug-jobs+= -e 's,Command: ksh -v,Command: ,' +SED_CMDS.opt-debug-jobs+= -e 's,Command: -v,Command: ,' .endif .rawout.out: diff --git a/contrib/bmake/unit-tests/cmd-errors-jobs.exp b/contrib/bmake/unit-tests/cmd-errors-jobs.exp index c8e483a9609b..074ceb3bcf28 100644 --- a/contrib/bmake/unit-tests/cmd-errors-jobs.exp +++ b/contrib/bmake/unit-tests/cmd-errors-jobs.exp @@ -1,9 +1,9 @@ : undefined--eol make: in target "unclosed-expression": Unclosed variable "UNCLOSED" : unclosed-expression- -make: Unclosed expression, expecting '}' for "UNCLOSED" +make: in target "unclosed-modifier": while evaluating variable "UNCLOSED" with value "": Unclosed expression, expecting '}' : unclosed-modifier- -make: in target "unknown-modifier": while evaluating variable "UNKNOWN": Unknown modifier "Z" +make: in target "unknown-modifier": while evaluating variable "UNKNOWN" with value "": Unknown modifier "Z" : unknown-modifier--eol : end-eol -exit status 0 +exit status 2 diff --git a/contrib/bmake/unit-tests/cmd-errors-jobs.mk b/contrib/bmake/unit-tests/cmd-errors-jobs.mk index 7a82c0b416e8..c24aa51907a2 100644 --- a/contrib/bmake/unit-tests/cmd-errors-jobs.mk +++ b/contrib/bmake/unit-tests/cmd-errors-jobs.mk @@ -1,4 +1,4 @@ -# $NetBSD: cmd-errors-jobs.mk,v 1.4 2024/04/23 22:51:28 rillig Exp $ +# $NetBSD: cmd-errors-jobs.mk,v 1.8 2024/07/09 19:43:01 rillig Exp $ # # Demonstrate how errors in expressions affect whether the commands # are actually executed in jobs mode. @@ -13,27 +13,26 @@ all: undefined unclosed-expression unclosed-modifier unknown-modifier end undefined: : $@-${UNDEFINED}-eol -# XXX: This command is executed even though it contains parse errors. -# expect: make: in target "unclosed-expression": Unclosed variable "UNCLOSED" -# expect: : unclosed-expression- unclosed-expression: +# expect: make: in target "unclosed-expression": Unclosed variable "UNCLOSED" +# XXX: This command is executed even though it contains parse errors. +# expect: : unclosed-expression- : $@-${UNCLOSED -# XXX: This command is executed even though it contains parse errors. -# expect: make: Unclosed expression, expecting '}' for "UNCLOSED" -# expect: : unclosed-modifier- unclosed-modifier: +# expect: make: in target "unclosed-modifier": while evaluating variable "UNCLOSED" with value "": Unclosed expression, expecting '}' +# XXX: This command is executed even though it contains parse errors. +# expect: : unclosed-modifier- : $@-${UNCLOSED: -# XXX: This command is executed even though it contains parse errors. -# expect: make: in target "unknown-modifier": while evaluating variable "UNKNOWN": Unknown modifier "Z" -# expect: : unknown-modifier--eol unknown-modifier: +# expect: make: in target "unknown-modifier": while evaluating variable "UNKNOWN" with value "": Unknown modifier "Z" +# XXX: This command is executed even though it contains parse errors. +# expect: : unknown-modifier--eol : $@-${UNKNOWN:Z}-eol # expect: : end-eol end: : $@-eol -# XXX: Despite the parse errors, the exit status is 0. -# expect: exit status 0 +# expect: exit status 2 diff --git a/contrib/bmake/unit-tests/cmd-errors-lint.exp b/contrib/bmake/unit-tests/cmd-errors-lint.exp index d489c6be57c9..a5b129c78f92 100644 --- a/contrib/bmake/unit-tests/cmd-errors-lint.exp +++ b/contrib/bmake/unit-tests/cmd-errors-lint.exp @@ -1,9 +1,9 @@ : undefined make: in target "unclosed-expression": Unclosed variable "UNCLOSED" : unclosed-expression -make: Unclosed expression, expecting '}' for "UNCLOSED" +make: in target "unclosed-modifier": while evaluating variable "UNCLOSED" with value "": Unclosed expression, expecting '}' : unclosed-modifier -make: in target "unknown-modifier": while evaluating variable "UNKNOWN": Unknown modifier "Z" +make: in target "unknown-modifier": while evaluating variable "UNKNOWN" with value "": Unknown modifier "Z" : unknown-modifier : end exit status 2 diff --git a/contrib/bmake/unit-tests/cmd-errors-lint.mk b/contrib/bmake/unit-tests/cmd-errors-lint.mk index 2e7d537f5f1f..f870fceaa5cb 100644 --- a/contrib/bmake/unit-tests/cmd-errors-lint.mk +++ b/contrib/bmake/unit-tests/cmd-errors-lint.mk @@ -1,4 +1,4 @@ -# $NetBSD: cmd-errors-lint.mk,v 1.2 2024/04/23 22:51:28 rillig Exp $ +# $NetBSD: cmd-errors-lint.mk,v 1.4 2024/07/05 18:59:33 rillig Exp $ # # Demonstrate how errors in expressions affect whether the commands # are actually executed. @@ -10,24 +10,29 @@ all: undefined unclosed-expression unclosed-modifier unknown-modifier end # Undefined variables in expressions are not an error. They expand to empty # strings. undefined: +# expect: : undefined : $@ ${UNDEFINED} -# XXX: As of 2020-11-01, this obvious syntax error is not detected. -# XXX: As of 2020-11-01, this command is executed even though it contains -# parse errors. unclosed-expression: +# expect: make: in target "unclosed-expression": Unclosed variable "UNCLOSED" +# XXX: This command is executed even though it contains parse errors. +# expect: : unclosed-expression : $@ ${UNCLOSED -# XXX: As of 2020-11-01, this obvious syntax error is not detected. -# XXX: As of 2020-11-01, this command is executed even though it contains -# parse errors. unclosed-modifier: +# expect: make: in target "unclosed-modifier": while evaluating variable "UNCLOSED" with value "": Unclosed expression, expecting '}' +# XXX: This command is executed even though it contains parse errors. +# expect: : unclosed-modifier : $@ ${UNCLOSED: -# XXX: As of 2020-11-01, this command is executed even though it contains -# parse errors. unknown-modifier: +# expect: make: in target "unknown-modifier": while evaluating variable "UNKNOWN" with value "": Unknown modifier "Z" +# XXX: This command is executed even though it contains parse errors. +# expect: : unknown-modifier : $@ ${UNKNOWN:Z} end: +# expect: : end : $@ + +# expect: exit status 2 diff --git a/contrib/bmake/unit-tests/cmd-errors.exp b/contrib/bmake/unit-tests/cmd-errors.exp index c8e483a9609b..074ceb3bcf28 100644 --- a/contrib/bmake/unit-tests/cmd-errors.exp +++ b/contrib/bmake/unit-tests/cmd-errors.exp @@ -1,9 +1,9 @@ : undefined--eol make: in target "unclosed-expression": Unclosed variable "UNCLOSED" : unclosed-expression- -make: Unclosed expression, expecting '}' for "UNCLOSED" +make: in target "unclosed-modifier": while evaluating variable "UNCLOSED" with value "": Unclosed expression, expecting '}' : unclosed-modifier- -make: in target "unknown-modifier": while evaluating variable "UNKNOWN": Unknown modifier "Z" +make: in target "unknown-modifier": while evaluating variable "UNKNOWN" with value "": Unknown modifier "Z" : unknown-modifier--eol : end-eol -exit status 0 +exit status 2 diff --git a/contrib/bmake/unit-tests/cmd-errors.mk b/contrib/bmake/unit-tests/cmd-errors.mk index d1125d444fcd..d9525df6064e 100644 --- a/contrib/bmake/unit-tests/cmd-errors.mk +++ b/contrib/bmake/unit-tests/cmd-errors.mk @@ -1,4 +1,4 @@ -# $NetBSD: cmd-errors.mk,v 1.6 2024/04/23 22:51:28 rillig Exp $ +# $NetBSD: cmd-errors.mk,v 1.9 2024/07/09 19:43:01 rillig Exp $ # # Demonstrate how errors in expressions affect whether the commands # are actually executed in compat mode. @@ -8,24 +8,29 @@ all: undefined unclosed-expression unclosed-modifier unknown-modifier end # Undefined variables in expressions are not an error. They expand to empty # strings. undefined: +# expect: : undefined--eol : $@-${UNDEFINED}-eol -# XXX: As of 2020-11-01, this command is executed even though it contains -# parse errors. unclosed-expression: +# expect: make: in target "unclosed-expression": Unclosed variable "UNCLOSED" +# XXX: This command is executed even though it contains parse errors. +# expect: : unclosed-expression- : $@-${UNCLOSED -# XXX: As of 2020-11-01, this command is executed even though it contains -# parse errors. unclosed-modifier: +# expect: make: in target "unclosed-modifier": while evaluating variable "UNCLOSED" with value "": Unclosed expression, expecting '}' +# XXX: This command is executed even though it contains parse errors. +# expect: : unclosed-modifier- : $@-${UNCLOSED: -# XXX: As of 2020-11-01, this command is executed even though it contains -# parse errors. unknown-modifier: +# expect: make: in target "unknown-modifier": while evaluating variable "UNKNOWN" with value "": Unknown modifier "Z" +# XXX: This command is executed even though it contains parse errors. +# expect: : unknown-modifier--eol : $@-${UNKNOWN:Z}-eol end: +# expect: : end-eol : $@-eol -# XXX: As of 2020-11-02, despite the parse errors, the exit status is 0. +# expect: exit status 2 diff --git a/contrib/bmake/unit-tests/compat-error.exp b/contrib/bmake/unit-tests/compat-error.exp index 256cb6d4361c..e06265e887d6 100644 --- a/contrib/bmake/unit-tests/compat-error.exp +++ b/contrib/bmake/unit-tests/compat-error.exp @@ -9,7 +9,7 @@ false 'fail2' '${.TARGET}' '$${.TARGET}' : Making success3 out of nothing. Stop. -make: stopped in unit-tests +make: stopped making "success1 fail1 success2 fail2 success3" in unit-tests .ERROR target: .ERROR command: <> exit status 1 diff --git a/contrib/bmake/unit-tests/cond-cmp-numeric.exp b/contrib/bmake/unit-tests/cond-cmp-numeric.exp index 69a8a1e4fca0..77c0154ca29b 100644 --- a/contrib/bmake/unit-tests/cond-cmp-numeric.exp +++ b/contrib/bmake/unit-tests/cond-cmp-numeric.exp @@ -11,5 +11,5 @@ Comparing 123.000000 < 124.000000 CondParser_Eval: ${:U123 } < 124 make: "cond-cmp-numeric.mk" line 54: Comparison with '<' requires both operands '123 ' and '124' to be numeric make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-func-defined.exp b/contrib/bmake/unit-tests/cond-func-defined.exp index 1d4243f9eddd..b9563ac1fa91 100644 --- a/contrib/bmake/unit-tests/cond-func-defined.exp +++ b/contrib/bmake/unit-tests/cond-func-defined.exp @@ -1,5 +1,5 @@ make: "cond-func-defined.mk" line 24: Missing closing parenthesis for defined() make: "cond-func-defined.mk" line 34: Missing closing parenthesis for defined() make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-func.exp b/contrib/bmake/unit-tests/cond-func.exp index eeaa89445887..c2c5e94fe7e2 100644 --- a/contrib/bmake/unit-tests/cond-func.exp +++ b/contrib/bmake/unit-tests/cond-func.exp @@ -1,12 +1,12 @@ make: "cond-func.mk" line 37: Missing closing parenthesis for defined() make: "cond-func.mk" line 53: Missing closing parenthesis for defined() make: "cond-func.mk" line 57: Missing closing parenthesis for defined() -make: "cond-func.mk" line 98: The empty variable is never defined. -make: "cond-func.mk" line 108: A plain function name is parsed as defined(...). -make: "cond-func.mk" line 116: A plain function name is parsed as defined(...). -make: "cond-func.mk" line 127: Symbols may start with a function name. -make: "cond-func.mk" line 133: Symbols may start with a function name. -make: "cond-func.mk" line 139: Missing closing parenthesis for defined() +make: "cond-func.mk" line 91: Unknown operator '&' +make: "cond-func.mk" line 107: A plain function name is parsed as defined(...). +make: "cond-func.mk" line 115: A plain function name is parsed as defined(...). +make: "cond-func.mk" line 126: Symbols may start with a function name. +make: "cond-func.mk" line 132: Symbols may start with a function name. +make: "cond-func.mk" line 138: Missing closing parenthesis for defined() make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-func.mk b/contrib/bmake/unit-tests/cond-func.mk index aabd31b4db46..7ed6f6f5570d 100644 --- a/contrib/bmake/unit-tests/cond-func.mk +++ b/contrib/bmake/unit-tests/cond-func.mk @@ -1,4 +1,4 @@ -# $NetBSD: cond-func.mk,v 1.14 2023/11/19 21:47:52 rillig Exp $ +# $NetBSD: cond-func.mk,v 1.15 2024/07/06 21:21:10 rillig Exp $ # # Tests for those parts of the functions in .if conditions that are common # among several functions. @@ -83,19 +83,18 @@ ${VARNAME_UNBALANCED_BRACES}= variable name with unbalanced braces . error .endif -# The following condition is interpreted as defined(A) && defined(B). -# In lack of a function call expression, each kind of .if directive has a +# Before cond.c 1.366 from 2024-07-06, the following condition was +# interpreted as defined(A) && defined(B). Each kind of .if directive has a # default function that is called when a bare word is parsed. For the plain -# .if directive, this function is defined(); see "struct If ifs" in cond.c. +# .if directive, this function is 'defined'; see "struct If ifs" in cond.c. +# expect+1: Unknown operator '&' .if A&B . error .endif +# The empty variable is never defined. .if defined() . error -.else -# expect+1: The empty variable is never defined. -. info The empty variable is never defined. .endif # The plain word 'defined' is interpreted as 'defined(defined)', see diff --git a/contrib/bmake/unit-tests/cond-late.exp b/contrib/bmake/unit-tests/cond-late.exp index 703677da634c..e97fd3789381 100644 --- a/contrib/bmake/unit-tests/cond-late.exp +++ b/contrib/bmake/unit-tests/cond-late.exp @@ -1,4 +1,7 @@ -make: Bad conditional expression ' != "no"' before '?:' +make: "cond-late.mk" line 38: while evaluating variable "VAR" with value "${${UNDEF} != "no":?:}": while evaluating condition " != "no"": Bad condition + in directory +make: Fatal errors encountered -- cannot continue +make: stopped making "do-parse-time" in unit-tests yes no exit status 0 diff --git a/contrib/bmake/unit-tests/cond-late.mk b/contrib/bmake/unit-tests/cond-late.mk index 8e3d41f60001..4d8c4fbd5d98 100644 --- a/contrib/bmake/unit-tests/cond-late.mk +++ b/contrib/bmake/unit-tests/cond-late.mk @@ -1,4 +1,4 @@ -# $NetBSD: cond-late.mk,v 1.6 2023/12/10 20:12:28 rillig Exp $ +# $NetBSD: cond-late.mk,v 1.8 2024/07/04 17:47:54 rillig Exp $ # # Using the :? modifier, expressions can contain conditional # expressions that are evaluated late, at expansion time. @@ -15,7 +15,10 @@ # actually interpreted as these operators. This is demonstrated below. # -all: cond-literal +all: parse-time cond-literal + +parse-time: .PHONY + @${MAKE} -f ${MAKEFILE} do-parse-time || true COND.true= "yes" == "yes" COND.false= "yes" != "yes" @@ -29,8 +32,9 @@ cond-literal: @echo ${ ${COND.true} :?yes:no} @echo ${ ${COND.false} :?yes:no} +.if make(do-parse-time) VAR= ${${UNDEF} != "no":?:} -# expect-reset -# expect: make: Bad conditional expression ' != "no"' before '?:' -.if empty(VAR:Mpattern) +# expect+1: while evaluating variable "VAR" with value "${${UNDEF} != "no":?:}": while evaluating condition " != "no"": Bad condition +. if empty(VAR:Mpattern) +. endif .endif diff --git a/contrib/bmake/unit-tests/cond-op-and.exp b/contrib/bmake/unit-tests/cond-op-and.exp index 6d5a14b211cc..6d2263dc5d56 100644 --- a/contrib/bmake/unit-tests/cond-op-and.exp +++ b/contrib/bmake/unit-tests/cond-op-and.exp @@ -1,7 +1,11 @@ -make: "cond-op-and.mk" line 37: Malformed conditional (0 || (${DEF} && ${UNDEF})) -make: "cond-op-and.mk" line 42: Malformed conditional (0 || (${UNDEF} && ${UNDEF})) -make: "cond-op-and.mk" line 45: Malformed conditional (0 || (!${UNDEF} && ${UNDEF})) -make: "cond-op-and.mk" line 75: Malformed conditional (0 &&& 0) +make: "cond-op-and.mk" line 36: Malformed conditional (0 || (${DEF} && ${UNDEF})) +make: "cond-op-and.mk" line 41: Malformed conditional (0 || (${UNDEF} && ${UNDEF})) +make: "cond-op-and.mk" line 44: Malformed conditional (0 || (!${UNDEF} && ${UNDEF})) +make: "cond-op-and.mk" line 60: Unknown operator '&' +make: "cond-op-and.mk" line 66: Unknown operator '&' +make: "cond-op-and.mk" line 72: Unknown operator '&' +make: "cond-op-and.mk" line 78: Unknown operator '&' +make: "cond-op-and.mk" line 87: Unknown operator '&' make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-op-and.mk b/contrib/bmake/unit-tests/cond-op-and.mk index 19a0672ba44e..b49fb079b3cf 100644 --- a/contrib/bmake/unit-tests/cond-op-and.mk +++ b/contrib/bmake/unit-tests/cond-op-and.mk @@ -1,4 +1,4 @@ -# $NetBSD: cond-op-and.mk,v 1.9 2023/12/17 09:44:00 rillig Exp $ +# $NetBSD: cond-op-and.mk,v 1.10 2024/07/06 21:21:10 rillig Exp $ # # Tests for the && operator in .if conditions. @@ -25,8 +25,7 @@ .endif # When an outer condition makes the inner '&&' condition irrelevant, neither -# of its operands must be evaluated. -# +# of its operands is evaluated. .if 1 || (${UNDEF} && ${UNDEF}) .endif @@ -57,27 +56,43 @@ DEF= defined # The && operator may be abbreviated as &. This is not widely known though # and is also not documented in the manual page. +# expect+1: Unknown operator '&' .if 0 & 0 . error +.else +. error .endif +# expect+1: Unknown operator '&' .if 1 & 0 . error -.endif -.if 0 & 1 +.else . error .endif +# expect+1: Unknown operator '&' +.if 0 & 1 +. error +.else +. error +.endif +# expect+1: Unknown operator '&' .if !(1 & 1) . error +.else +. error .endif -# There is no operator &&&. -# expect+1: Malformed conditional (0 &&& 0) +# There is no operator '&&&'. The first two '&&' form an operator, the third +# '&' forms the next (incomplete) token. +# expect+1: Unknown operator '&' .if 0 &&& 0 . error +.else +. error .endif # The '&&' operator must be preceded by whitespace, otherwise it becomes part -# of the preceding bare word. The condition is parsed as '"1&&" != "" && 1'. +# of the preceding bare word. The condition starts with a digit and is thus +# parsed as '"1&&" != "" && 1'. .if 1&& && 1 .else . error diff --git a/contrib/bmake/unit-tests/cond-op-not.exp b/contrib/bmake/unit-tests/cond-op-not.exp index fcdceee9af21..86d8289d9233 100644 --- a/contrib/bmake/unit-tests/cond-op-not.exp +++ b/contrib/bmake/unit-tests/cond-op-not.exp @@ -5,5 +5,5 @@ make: "cond-op-not.mk" line 53: Not 1 evaluates to false. make: "cond-op-not.mk" line 60: Not word evaluates to false. make: "cond-op-not.mk" line 65: Malformed conditional (!) make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-op-or.exp b/contrib/bmake/unit-tests/cond-op-or.exp index b10bc4bf7c52..dddd29d5bca0 100644 --- a/contrib/bmake/unit-tests/cond-op-or.exp +++ b/contrib/bmake/unit-tests/cond-op-or.exp @@ -1,7 +1,11 @@ -make: "cond-op-or.mk" line 47: Malformed conditional (1 && (!${DEF} || ${UNDEF})) -make: "cond-op-or.mk" line 50: Malformed conditional (1 && (${UNDEF} || ${UNDEF})) -make: "cond-op-or.mk" line 53: Malformed conditional (1 && (!${UNDEF} || ${UNDEF})) -make: "cond-op-or.mk" line 75: Malformed conditional (0 ||| 0) +make: "cond-op-or.mk" line 36: Malformed conditional (1 && (!${DEF} || ${UNDEF})) +make: "cond-op-or.mk" line 41: Malformed conditional (1 && (!${UNDEF} || ${UNDEF})) +make: "cond-op-or.mk" line 44: Malformed conditional (1 && (${UNDEF} || ${UNDEF})) +make: "cond-op-or.mk" line 60: Unknown operator '|' +make: "cond-op-or.mk" line 66: Unknown operator '|' +make: "cond-op-or.mk" line 72: Unknown operator '|' +make: "cond-op-or.mk" line 78: Unknown operator '|' +make: "cond-op-or.mk" line 87: Unknown operator '|' make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-op-or.mk b/contrib/bmake/unit-tests/cond-op-or.mk index 165408f3c130..b01fcaf04a28 100644 --- a/contrib/bmake/unit-tests/cond-op-or.mk +++ b/contrib/bmake/unit-tests/cond-op-or.mk @@ -1,4 +1,4 @@ -# $NetBSD: cond-op-or.mk,v 1.11 2023/12/17 09:44:00 rillig Exp $ +# $NetBSD: cond-op-or.mk,v 1.12 2024/07/06 21:21:10 rillig Exp $ # # Tests for the || operator in .if conditions. @@ -25,60 +25,75 @@ .endif # When an outer condition makes the inner '||' condition irrelevant, neither -# of its operands must be evaluated. This had been wrong in cond.c 1.283 from -# 2021-12-09 and was reverted in cond.c 1.284 an hour later. +# of its operands is evaluated. .if 0 && (!defined(UNDEF) || ${UNDEF}) .endif # Test combinations of outer '&&' with inner '||', to ensure that the operands -# of the inner '||' is only evaluated if necessary. +# of the inner '||' are only evaluated if necessary. DEF= defined -.if 0 && (${DEF} || ${UNDEF}) -.endif -.if 0 && (!${DEF} || ${UNDEF}) -.endif -.if 0 && (${UNDEF} || ${UNDEF}) -.endif -.if 0 && (!${UNDEF} || ${UNDEF}) +# expect+1: Malformed conditional (1 && (!${DEF} || ${UNDEF})) +.if 1 && (!${DEF} || ${UNDEF}) .endif .if 1 && (${DEF} || ${UNDEF}) .endif -# expect+1: Malformed conditional (1 && (!${DEF} || ${UNDEF})) -.if 1 && (!${DEF} || ${UNDEF}) +# expect+1: Malformed conditional (1 && (!${UNDEF} || ${UNDEF})) +.if 1 && (!${UNDEF} || ${UNDEF}) .endif # expect+1: Malformed conditional (1 && (${UNDEF} || ${UNDEF})) .if 1 && (${UNDEF} || ${UNDEF}) .endif -# expect+1: Malformed conditional (1 && (!${UNDEF} || ${UNDEF})) -.if 1 && (!${UNDEF} || ${UNDEF}) +.if 0 && (!${DEF} || ${UNDEF}) +.endif +.if 0 && (${DEF} || ${UNDEF}) +.endif +.if 0 && (!${UNDEF} || ${UNDEF}) +.endif +.if 0 && (${UNDEF} || ${UNDEF}) .endif # The || operator may be abbreviated as |. This is not widely known though # and is also not documented in the manual page. +# expect+1: Unknown operator '|' .if 0 | 0 . error +.else +. error .endif +# expect+1: Unknown operator '|' .if !(1 | 0) . error -.endif -.if !(0 | 1) +.else . error .endif +# expect+1: Unknown operator '|' +.if !(0 | 1) +. error +.else +. error +.endif +# expect+1: Unknown operator '|' .if !(1 | 1) . error +.else +. error .endif -# There is no operator |||. -# expect+1: Malformed conditional (0 ||| 0) +# There is no operator '|||'. The first two '||' form an operator, the third +# '|' forms the next (incomplete) token. +# expect+1: Unknown operator '|' .if 0 ||| 0 . error +.else +. error .endif # The '||' operator must be preceded by whitespace, otherwise it becomes part -# of the preceding bare word. The condition is parsed as '"1||" != "" || 0'. -.if 1|| || 0 +# of the preceding bare word. The condition starts with a digit and is thus +# parsed as '"0||" != "" || 0'. +.if 0|| || 0 .else . error .endif diff --git a/contrib/bmake/unit-tests/cond-op-parentheses.exp b/contrib/bmake/unit-tests/cond-op-parentheses.exp index 1daad92b2682..f14e62b6d4e3 100644 --- a/contrib/bmake/unit-tests/cond-op-parentheses.exp +++ b/contrib/bmake/unit-tests/cond-op-parentheses.exp @@ -3,5 +3,5 @@ make: "cond-op-parentheses.mk" line 25: Malformed conditional ((3) > 2) make: "cond-op-parentheses.mk" line 44: Malformed conditional (() make: "cond-op-parentheses.mk" line 58: Malformed conditional ()) make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-op.exp b/contrib/bmake/unit-tests/cond-op.exp index 33bab484a6c8..1ce5436f023a 100644 --- a/contrib/bmake/unit-tests/cond-op.exp +++ b/contrib/bmake/unit-tests/cond-op.exp @@ -17,5 +17,5 @@ make: "cond-op.mk" line 129: Malformed conditional (0 &&) make: "cond-op.mk" line 138: Malformed conditional (1 ||) make: "cond-op.mk" line 148: Malformed conditional (0 ||) make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-short.exp b/contrib/bmake/unit-tests/cond-short.exp index 44681b57ebc1..e9c13d979233 100644 --- a/contrib/bmake/unit-tests/cond-short.exp +++ b/contrib/bmake/unit-tests/cond-short.exp @@ -9,5 +9,5 @@ expected or exists expected or empty make: "cond-short.mk" line 231: Comparison with '<' requires both operands '' and '42' to be numeric make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-token-number.exp b/contrib/bmake/unit-tests/cond-token-number.exp index d05833b4e01b..aaa4ec7fe184 100644 --- a/contrib/bmake/unit-tests/cond-token-number.exp +++ b/contrib/bmake/unit-tests/cond-token-number.exp @@ -3,5 +3,5 @@ make: "cond-token-number.mk" line 27: Malformed conditional (+0) make: "cond-token-number.mk" line 38: Malformed conditional (!-1) make: "cond-token-number.mk" line 49: Malformed conditional (!+1) make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-token-string.exp b/contrib/bmake/unit-tests/cond-token-string.exp index 4fbafc5e1986..f970a21bf69f 100644 --- a/contrib/bmake/unit-tests/cond-token-string.exp +++ b/contrib/bmake/unit-tests/cond-token-string.exp @@ -1,4 +1,4 @@ -make: "cond-token-string.mk" line 15: while evaluating "${:Uvalue:Z}"": Unknown modifier "Z" +make: "cond-token-string.mk" line 15: while evaluating "${:Uvalue:Z}"" with value "value": Unknown modifier "Z" make: "cond-token-string.mk" line 15: Malformed conditional ("" != "${:Uvalue:Z}") make: "cond-token-string.mk" line 25: xvalue is not defined. make: "cond-token-string.mk" line 32: Malformed conditional (x${:Uvalue} == "") @@ -17,5 +17,5 @@ CondParser_Eval: ("${VAR}") CondParser_Eval: "quoted" == quoted Comparing "quoted" == "quoted" make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/cond-token-string.mk b/contrib/bmake/unit-tests/cond-token-string.mk index edc9936b7d53..d24645748233 100644 --- a/contrib/bmake/unit-tests/cond-token-string.mk +++ b/contrib/bmake/unit-tests/cond-token-string.mk @@ -1,4 +1,4 @@ -# $NetBSD: cond-token-string.mk,v 1.10 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: cond-token-string.mk,v 1.11 2024/07/05 19:47:22 rillig Exp $ # # Tests for quoted string literals in .if conditions. # @@ -11,7 +11,7 @@ # Cover the code in CondParser_String that frees the memory after parsing # an expression based on an undefined variable. # expect+2: Malformed conditional ("" != "${:Uvalue:Z}") -# expect+1: while evaluating "${:Uvalue:Z}"": Unknown modifier "Z" +# expect+1: while evaluating "${:Uvalue:Z}"" with value "value": Unknown modifier "Z" .if "" != "${:Uvalue:Z}" . error .else diff --git a/contrib/bmake/unit-tests/dep-op-missing.exp b/contrib/bmake/unit-tests/dep-op-missing.exp index 9b42c5080122..2a25286aa407 100644 --- a/contrib/bmake/unit-tests/dep-op-missing.exp +++ b/contrib/bmake/unit-tests/dep-op-missing.exp @@ -1,4 +1,5 @@ make: "dep-op-missing.tmp" line 1: Invalid line 'target' + in directory make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 0 diff --git a/contrib/bmake/unit-tests/dep-percent.exp b/contrib/bmake/unit-tests/dep-percent.exp index 1e6c04d2e167..fd3748d42d0f 100644 --- a/contrib/bmake/unit-tests/dep-percent.exp +++ b/contrib/bmake/unit-tests/dep-percent.exp @@ -2,5 +2,5 @@ make: don't know how to make dep-percent.o (continuing) `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/dep-var.exp b/contrib/bmake/unit-tests/dep-var.exp index a12c2e7a8e96..194c723fc1a8 100755 --- a/contrib/bmake/unit-tests/dep-var.exp +++ b/contrib/bmake/unit-tests/dep-var.exp @@ -27,4 +27,4 @@ def2 a-def2-b 1-2-NDIRECT_2-2-1 ) -exit status 0 +exit status 2 diff --git a/contrib/bmake/unit-tests/dep.exp b/contrib/bmake/unit-tests/dep.exp index 6b7f0fabb12b..c12fa3f90b3e 100644 --- a/contrib/bmake/unit-tests/dep.exp +++ b/contrib/bmake/unit-tests/dep.exp @@ -1,5 +1,5 @@ make: "dep.mk" line 11: Inconsistent operator for only-colon make: "dep.mk" line 13: Inconsistent operator for only-colon make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/depsrc-ignore.exp b/contrib/bmake/unit-tests/depsrc-ignore.exp index 608671f58ed8..1fc45d3d7239 100644 --- a/contrib/bmake/unit-tests/depsrc-ignore.exp +++ b/contrib/bmake/unit-tests/depsrc-ignore.exp @@ -7,5 +7,5 @@ false all *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/deptgt-begin-fail-indirect.exp b/contrib/bmake/unit-tests/deptgt-begin-fail-indirect.exp index 59575e839a4a..46ae9ff95ff9 100644 --- a/contrib/bmake/unit-tests/deptgt-begin-fail-indirect.exp +++ b/contrib/bmake/unit-tests/deptgt-begin-fail-indirect.exp @@ -2,5 +2,5 @@ false *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/deptgt-begin-fail.exp b/contrib/bmake/unit-tests/deptgt-begin-fail.exp index 59575e839a4a..46ae9ff95ff9 100644 --- a/contrib/bmake/unit-tests/deptgt-begin-fail.exp +++ b/contrib/bmake/unit-tests/deptgt-begin-fail.exp @@ -2,5 +2,5 @@ false *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/deptgt-delete_on_error.exp b/contrib/bmake/unit-tests/deptgt-delete_on_error.exp index e60aa01351e2..9171c9931972 100644 --- a/contrib/bmake/unit-tests/deptgt-delete_on_error.exp +++ b/contrib/bmake/unit-tests/deptgt-delete_on_error.exp @@ -15,7 +15,7 @@ make: *** deptgt-delete_on_error-regular-delete removed *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "deptgt-delete_on_error-regular deptgt-delete_on_error-regular-delete deptgt-delete_on_error-phony deptgt-delete_on_error-phony-delete deptgt-delete_on_error-precious deptgt-delete_on_error-precious-delete" in unit-tests *** Error code 1 (ignored) Parallel mode @@ -23,27 +23,27 @@ Parallel mode *** [deptgt-delete_on_error-regular] Error code 1 make: *** deptgt-delete_on_error-regular removed -make: stopped in unit-tests +make: stopped making "deptgt-delete_on_error-regular deptgt-delete_on_error-regular-delete deptgt-delete_on_error-phony deptgt-delete_on_error-phony-delete deptgt-delete_on_error-precious deptgt-delete_on_error-precious-delete" in unit-tests > deptgt-delete_on_error-regular-delete; false *** [deptgt-delete_on_error-regular-delete] Error code 1 make: *** deptgt-delete_on_error-regular-delete removed -make: stopped in unit-tests +make: stopped making "deptgt-delete_on_error-regular deptgt-delete_on_error-regular-delete deptgt-delete_on_error-phony deptgt-delete_on_error-phony-delete deptgt-delete_on_error-precious deptgt-delete_on_error-precious-delete" in unit-tests > deptgt-delete_on_error-phony; false *** [deptgt-delete_on_error-phony] Error code 1 -make: stopped in unit-tests +make: stopped making "deptgt-delete_on_error-regular deptgt-delete_on_error-regular-delete deptgt-delete_on_error-phony deptgt-delete_on_error-phony-delete deptgt-delete_on_error-precious deptgt-delete_on_error-precious-delete" in unit-tests > deptgt-delete_on_error-phony-delete; false *** [deptgt-delete_on_error-phony-delete] Error code 1 -make: stopped in unit-tests +make: stopped making "deptgt-delete_on_error-regular deptgt-delete_on_error-regular-delete deptgt-delete_on_error-phony deptgt-delete_on_error-phony-delete deptgt-delete_on_error-precious deptgt-delete_on_error-precious-delete" in unit-tests > deptgt-delete_on_error-precious; false *** [deptgt-delete_on_error-precious] Error code 1 -make: stopped in unit-tests +make: stopped making "deptgt-delete_on_error-regular deptgt-delete_on_error-regular-delete deptgt-delete_on_error-phony deptgt-delete_on_error-phony-delete deptgt-delete_on_error-precious deptgt-delete_on_error-precious-delete" in unit-tests > deptgt-delete_on_error-precious-delete; false *** [deptgt-delete_on_error-precious-delete] Error code 1 -make: stopped in unit-tests +make: stopped making "deptgt-delete_on_error-regular deptgt-delete_on_error-regular-delete deptgt-delete_on_error-phony deptgt-delete_on_error-phony-delete deptgt-delete_on_error-precious deptgt-delete_on_error-precious-delete" in unit-tests *** Error code 1 (ignored) exit status 0 diff --git a/contrib/bmake/unit-tests/deptgt-end-fail-all.exp b/contrib/bmake/unit-tests/deptgt-end-fail-all.exp index 2e2ee11f481a..39209f9709ce 100644 --- a/contrib/bmake/unit-tests/deptgt-end-fail-all.exp +++ b/contrib/bmake/unit-tests/deptgt-end-fail-all.exp @@ -3,5 +3,5 @@ false *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/deptgt-end-fail-indirect.exp b/contrib/bmake/unit-tests/deptgt-end-fail-indirect.exp index 17e509600617..e0733527e59d 100644 --- a/contrib/bmake/unit-tests/deptgt-end-fail-indirect.exp +++ b/contrib/bmake/unit-tests/deptgt-end-fail-indirect.exp @@ -3,5 +3,5 @@ false *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/deptgt-end-fail.exp b/contrib/bmake/unit-tests/deptgt-end-fail.exp index 9db907c209d5..8f4e22059829 100644 --- a/contrib/bmake/unit-tests/deptgt-end-fail.exp +++ b/contrib/bmake/unit-tests/deptgt-end-fail.exp @@ -13,7 +13,7 @@ Test case all=ok all-dep=ok end=ok end-dep=ERR. *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -25,7 +25,7 @@ Test case all=ok all-dep=ok end=ERR end-dep=ok. *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -36,7 +36,7 @@ Test case all=ok all-dep=ok end=ERR end-dep=ERR. *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -46,7 +46,7 @@ Test case all=ok all-dep=ERR end=ok end-dep=ok. `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -56,7 +56,7 @@ Test case all=ok all-dep=ERR end=ok end-dep=ERR. `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -66,7 +66,7 @@ Test case all=ok all-dep=ERR end=ERR end-dep=ok. `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -76,7 +76,7 @@ Test case all=ok all-dep=ERR end=ERR end-dep=ERR. `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -86,7 +86,7 @@ Test case all=ERR all-dep=ok end=ok end-dep=ok. *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -96,7 +96,7 @@ Test case all=ERR all-dep=ok end=ok end-dep=ERR. *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -106,7 +106,7 @@ Test case all=ERR all-dep=ok end=ERR end-dep=ok. *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -116,7 +116,7 @@ Test case all=ERR all-dep=ok end=ERR end-dep=ERR. *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -126,7 +126,7 @@ Test case all=ERR all-dep=ERR end=ok end-dep=ok. `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -136,7 +136,7 @@ Test case all=ERR all-dep=ERR end=ok end-dep=ERR. `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -146,7 +146,7 @@ Test case all=ERR all-dep=ERR end=ERR end-dep=ok. `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 @@ -156,7 +156,7 @@ Test case all=ERR all-dep=ERR end=ERR end-dep=ERR. `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/deptgt-error.exp b/contrib/bmake/unit-tests/deptgt-error.exp index 48e2f90954cf..cc518aaa1b84 100644 --- a/contrib/bmake/unit-tests/deptgt-error.exp +++ b/contrib/bmake/unit-tests/deptgt-error.exp @@ -2,7 +2,7 @@ false fails *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests ERROR_INFO='This information is printed on 'errors'.' Making sub-error as prerequisite. Making .ERROR out of nothing. diff --git a/contrib/bmake/unit-tests/deptgt-ignore.exp b/contrib/bmake/unit-tests/deptgt-ignore.exp index 2aa1311c8ff7..8679b83af0d5 100644 --- a/contrib/bmake/unit-tests/deptgt-ignore.exp +++ b/contrib/bmake/unit-tests/deptgt-ignore.exp @@ -7,5 +7,5 @@ Making depends-on-ignored from error-ignored. `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/deptgt-path-suffix.exp b/contrib/bmake/unit-tests/deptgt-path-suffix.exp index 228a29851f48..8c2437f3010f 100644 --- a/contrib/bmake/unit-tests/deptgt-path-suffix.exp +++ b/contrib/bmake/unit-tests/deptgt-path-suffix.exp @@ -1,4 +1,4 @@ make: "deptgt-path-suffix.mk" line 8: Suffix '.c' not defined (yet) make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/deptgt.exp b/contrib/bmake/unit-tests/deptgt.exp index 90213fe44fb5..ae7315716d8c 100644 --- a/contrib/bmake/unit-tests/deptgt.exp +++ b/contrib/bmake/unit-tests/deptgt.exp @@ -8,10 +8,11 @@ ParseDependency(: empty-source) Parsing line 39: : command for empty targets list Parsing line 40: .MAKEFLAGS: -d0 ParseDependency(.MAKEFLAGS: -d0) -make: "deptgt.mk" line 49: while evaluating "${:U:Z}:": Unknown modifier "Z" +make: "deptgt.mk" line 45: while evaluating "${:U:Z}:" with value "": Unknown modifier "Z" +make: "deptgt.mk" line 49: while parsing "${:U:Z}:": Unknown modifier "Z" make: "deptgt.mk" line 52: warning: Extra target 'ordinary' ignored make: "deptgt.mk" line 55: warning: Extra target (ordinary) ignored make: "deptgt.mk" line 58: warning: Special and mundane targets don't mix. Mundane ones ignored make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "target1" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/deptgt.mk b/contrib/bmake/unit-tests/deptgt.mk index eb948918abb7..2e6845b88038 100644 --- a/contrib/bmake/unit-tests/deptgt.mk +++ b/contrib/bmake/unit-tests/deptgt.mk @@ -1,4 +1,4 @@ -# $NetBSD: deptgt.mk,v 1.17 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: deptgt.mk,v 1.20 2024/07/06 10:14:35 rillig Exp $ # # Tests for special targets like .BEGIN or .SUFFIXES in dependency # declarations. @@ -39,14 +39,14 @@ ${:U}: empty-source : command for empty targets list .MAKEFLAGS: -d0 -# Just to show that a malformed expression is only expanded once in -# ParseDependencyTargetWord. The only way to produce an expression that -# is well-formed on the first expansion and ill-formed on the second -# expansion would be to use the variable modifier '::=' to modify the -# targets. This in turn would be such an extreme and unreliable edge case -# that nobody uses it. -# expect+1: while evaluating "${:U:Z}:": Unknown modifier "Z" -$$$$$$$${:U:Z}: +# In a dependency declaration, the whole line is expanded before interpreting +# the line. +# expect+1: while evaluating "${:U:Z}:" with value "": Unknown modifier "Z" +${:U:Z}: +# After expanding the line as a whole, each target is parsed but not +# evaluated, separately, in ParseDependencyTargetWord. +# expect+1: while parsing "${:U:Z}:": Unknown modifier "Z" +$${:U:Z}: # expect+1: warning: Extra target 'ordinary' ignored .END ordinary: @@ -56,6 +56,3 @@ $$$$$$$${:U:Z}: # expect+1: warning: Special and mundane targets don't mix. Mundane ones ignored ordinary .PATH: - -all: - @:; diff --git a/contrib/bmake/unit-tests/directive-dinclude.exp b/contrib/bmake/unit-tests/directive-dinclude.exp index 8f71e42c0515..58bcb105b829 100755 --- a/contrib/bmake/unit-tests/directive-dinclude.exp +++ b/contrib/bmake/unit-tests/directive-dinclude.exp @@ -1,4 +1,5 @@ make: "directive-dinclude-error.inc" line 1: Invalid line 'syntax error' + in directive-dinclude.mk:21 make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-elif.exp b/contrib/bmake/unit-tests/directive-elif.exp index 15dd6bf1430b..fc0e749ed61a 100644 --- a/contrib/bmake/unit-tests/directive-elif.exp +++ b/contrib/bmake/unit-tests/directive-elif.exp @@ -17,5 +17,5 @@ make: "directive-elif.mk" line 143: 2-elsif make: "directive-elif.mk" line 149: if-less elif make: "directive-elif.mk" line 154: warning: extra elif make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-else.exp b/contrib/bmake/unit-tests/directive-else.exp index 992b60e9308b..8d34f94aa12f 100644 --- a/contrib/bmake/unit-tests/directive-else.exp +++ b/contrib/bmake/unit-tests/directive-else.exp @@ -7,5 +7,5 @@ make: "directive-else.mk" line 36: ok make: "directive-else.mk" line 38: warning: extra else make: "directive-else.mk" line 51: The .else directive does not take arguments make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-export-gmake.exp b/contrib/bmake/unit-tests/directive-export-gmake.exp index c37d3b2d8591..fe966893f4a9 100644 --- a/contrib/bmake/unit-tests/directive-export-gmake.exp +++ b/contrib/bmake/unit-tests/directive-export-gmake.exp @@ -1,4 +1,5 @@ make: "directive-export-gmake.mk" line 71: Invalid line 'export VAR=${:U1}', expanded to 'export VAR=1' + in .for loop from directive-export-gmake.mk:67 with value = 1 make: "directive-export-gmake.mk" line 85: 16:00:00 make: "directive-export-gmake.mk" line 92: Variable/Value missing from "export" make: Fatal errors encountered -- cannot continue diff --git a/contrib/bmake/unit-tests/directive-for-break.exp b/contrib/bmake/unit-tests/directive-for-break.exp index 64941448141c..df2064a4eca0 100644 --- a/contrib/bmake/unit-tests/directive-for-break.exp +++ b/contrib/bmake/unit-tests/directive-for-break.exp @@ -1,5 +1,6 @@ make: "directive-for-break.mk" line 45: break outside of for loop make: "directive-for-break.mk" line 65: The .break directive does not take arguments + in .for loop from directive-for-break.mk:63 with i = 1 make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-for-errors.exp b/contrib/bmake/unit-tests/directive-for-errors.exp index 9c1aa5c0b1ed..463f5a376997 100644 --- a/contrib/bmake/unit-tests/directive-for-errors.exp +++ b/contrib/bmake/unit-tests/directive-for-errors.exp @@ -1,17 +1,17 @@ make: "directive-for-errors.mk" line 9: Unknown directive "fori" -make: "directive-for-errors.mk" line 10: warning: <> -make: "directive-for-errors.mk" line 11: for-less endfor +make: "directive-for-errors.mk" line 11: warning: <> +make: "directive-for-errors.mk" line 13: for-less endfor make: "directive-for-errors.mk" line 25: Unknown directive "for" -make: "directive-for-errors.mk" line 26: warning: <> -make: "directive-for-errors.mk" line 27: for-less endfor +make: "directive-for-errors.mk" line 27: warning: <> +make: "directive-for-errors.mk" line 29: for-less endfor make: "directive-for-errors.mk" line 44: invalid character '$' in .for loop variable name make: "directive-for-errors.mk" line 52: no iteration variables in for make: "directive-for-errors.mk" line 64: Wrong number of words (5) in .for substitution list with 3 variables make: "directive-for-errors.mk" line 78: missing `in' in for -make: "directive-for-errors.mk" line 89: while evaluating "${:U3:Z} 4": Unknown modifier "Z" -make: "directive-for-errors.mk" line 90: warning: Should not be reached. -make: "directive-for-errors.mk" line 90: warning: Should not be reached. -make: "directive-for-errors.mk" line 90: warning: Should not be reached. +make: "directive-for-errors.mk" line 89: while evaluating "${:U3:Z} 4" with value "3": Unknown modifier "Z" +make: "directive-for-errors.mk" line 93: warning: Should not be reached. +make: "directive-for-errors.mk" line 93: warning: Should not be reached. +make: "directive-for-errors.mk" line 93: warning: Should not be reached. make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-for-errors.mk b/contrib/bmake/unit-tests/directive-for-errors.mk index e64bb97b6560..3cbf457622e8 100644 --- a/contrib/bmake/unit-tests/directive-for-errors.mk +++ b/contrib/bmake/unit-tests/directive-for-errors.mk @@ -1,4 +1,4 @@ -# $NetBSD: directive-for-errors.mk,v 1.11 2024/06/01 11:24:11 rillig Exp $ +# $NetBSD: directive-for-errors.mk,v 1.13 2024/07/06 10:14:35 rillig Exp $ # # Tests for error handling in .for loops. @@ -7,10 +7,10 @@ # in a parse error. # expect+1: Unknown directive "fori" .fori in 1 2 3 +# expect+1: warning: <> . warning <${i}> +# expect+1: for-less endfor .endfor -# expect-2: warning: <> -# expect-2: for-less endfor # A slash is not whitespace, therefore this is not parsed as a .for loop. @@ -23,10 +23,10 @@ # name is parsed a bit differently. # expect+1: Unknown directive "for" .for/i in 1 2 3 +# expect+1: warning: <> . warning <${i}> +# expect+1: for-less endfor .endfor -# expect-2: warning: <> -# expect-2: for-less endfor # Before for.c 1.173 from 2023-05-08, the variable name could be an arbitrary @@ -85,10 +85,10 @@ ${:U\\}= backslash # see whether the "variable" '\' is local # # XXX: As of 2020-12-31, Var_Subst doesn't report any errors, therefore # the loop body is expanded as if no error had happened. -# expect+1: while evaluating "${:U3:Z} 4": Unknown modifier "Z" +# expect+1: while evaluating "${:U3:Z} 4" with value "3": Unknown modifier "Z" .for i in 1 2 ${:U3:Z} 4 +# expect+3: warning: Should not be reached. +# expect+2: warning: Should not be reached. +# expect+1: warning: Should not be reached. . warning Should not be reached. .endfor -# expect-2: warning: Should not be reached. -# expect-3: warning: Should not be reached. -# expect-4: warning: Should not be reached. diff --git a/contrib/bmake/unit-tests/directive-for-escape.exp b/contrib/bmake/unit-tests/directive-for-escape.exp index 1f4305185d65..6dfea5e79bb6 100644 --- a/contrib/bmake/unit-tests/directive-for-escape.exp +++ b/contrib/bmake/unit-tests/directive-for-escape.exp @@ -1,45 +1,47 @@ For: end for 1 For: loop body with chars = !"#$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~: . info ${:U!"#$%&'()*+,-./0-9\:;<=>?@A-Z[\\]_^a-z{|\}~} -make: Unclosed expression, expecting '}' for modifier "U!"" of variable "" with value "!"" -make: "directive-for-escape.mk" line 19: !" +make: "directive-for-escape.mk" line 21: while evaluating "${:U!"" with value "!"": Unclosed expression, expecting '}' for modifier "U!"" + in .for loop from directive-for-escape.mk:20 with chars = !"#$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~ +make: "directive-for-escape.mk" line 21: !" For: end for 1 For: loop body with chars = !"\\#$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~: . info ${:U!"\\\\#$%&'()*+,-./0-9\:;<=>?@A-Z[\\]_^a-z{|\}~} -make: Unclosed expression, expecting '}' for modifier "U!"\\\\" of variable "" with value "!"\\" -make: "directive-for-escape.mk" line 30: !"\\ +make: "directive-for-escape.mk" line 33: while evaluating "${:U!"\\\\" with value "!"\\": Unclosed expression, expecting '}' for modifier "U!"\\\\" + in .for loop from directive-for-escape.mk:32 with chars = !"\\#$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~ +make: "directive-for-escape.mk" line 33: !"\\ For: end for 1 For: loop body with i = $: . info ${:U\$} -make: "directive-for-escape.mk" line 45: $ +make: "directive-for-escape.mk" line 57: $ For: loop body with i = ${V}: . info ${:U${V}} -make: "directive-for-escape.mk" line 45: value +make: "directive-for-escape.mk" line 57: value For: loop body with i = ${V:=-with-modifier}: . info ${:U${V:=-with-modifier}} -make: "directive-for-escape.mk" line 45: value-with-modifier +make: "directive-for-escape.mk" line 57: value-with-modifier For: loop body with i = $(V): . info ${:U$(V)} -make: "directive-for-escape.mk" line 45: value +make: "directive-for-escape.mk" line 57: value For: loop body with i = $(V:=-with-modifier): . info ${:U$(V:=-with-modifier)} -make: "directive-for-escape.mk" line 45: value-with-modifier +make: "directive-for-escape.mk" line 57: value-with-modifier For: end for 1 For: loop body with i = $: . info ${:U\$} -make: "directive-for-escape.mk" line 60: $ +make: "directive-for-escape.mk" line 69: $ For: loop body with i = ${V}: . info ${:U${V}} -make: "directive-for-escape.mk" line 60: value +make: "directive-for-escape.mk" line 69: value For: loop body with i = ${V:=-with-modifier}: . info ${:U${V:=-with-modifier}} -make: "directive-for-escape.mk" line 60: value-with-modifier +make: "directive-for-escape.mk" line 69: value-with-modifier For: loop body with i = $(V): . info ${:U$(V)} -make: "directive-for-escape.mk" line 60: value +make: "directive-for-escape.mk" line 69: value For: loop body with i = $(V:=-with-modifier): . info ${:U$(V:=-with-modifier)} -make: "directive-for-escape.mk" line 60: value-with-modifier +make: "directive-for-escape.mk" line 69: value-with-modifier For: end for 1 For: loop body with i = ${UNDEF:U\$\$: # ${:U\${UNDEF\:U\\$\\$} @@ -50,77 +52,73 @@ For: loop body with i = end}: For: end for 1 For: loop body with i = ${UNDEF:U\$\$: . info ${:U\${UNDEF\:U\\$\\$} -make: "directive-for-escape.mk" line 115: ${UNDEF:U\backslash$ +make: "directive-for-escape.mk" line 120: ${UNDEF:U\backslash$ For: loop body with i = {{}}: . info ${:U{{\}\}} -make: "directive-for-escape.mk" line 115: {{}} +make: "directive-for-escape.mk" line 120: {{}} For: loop body with i = end}: . info ${:Uend\}} -make: "directive-for-escape.mk" line 115: end} +make: "directive-for-escape.mk" line 120: end} For: end for 1 For: loop body with i = begin<${UNDEF:Ufallback:N{{{}}}}>end: . info ${:Ubegin<${UNDEF:Ufallback:N{{{}}}}>end} -make: "directive-for-escape.mk" line 136: beginend +make: "directive-for-escape.mk" line 138: beginend For: end for 1 For: loop body with i = $: . info ${:U\$} -make: "directive-for-escape.mk" line 145: $ -make: "directive-for-escape.mk" line 154: invalid character ':' in .for loop variable name +make: "directive-for-escape.mk" line 147: $ +make: "directive-for-escape.mk" line 155: invalid character ':' in .for loop variable name For: end for 1 -make: "directive-for-escape.mk" line 164: invalid character '}' in .for loop variable name +make: "directive-for-escape.mk" line 165: invalid character '}' in .for loop variable name For: end for 1 For: end for 1 For: loop body with i = inner: -. info . $$i: ${:Uinner} -. info . $${i}: ${:Uinner} -. info . $${i:M*}: ${:Uinner:M*} -. info . $$(i): $(:Uinner) -. info . $$(i:M*): $(:Uinner:M*) -. info . $${i$${:U}}: ${i${:U}} -. info . $${i\}}: ${:Uinner\}} # XXX: unclear why ForLoop_SubstVarLong needs this -. info . $${i2}: ${i2} -. info . $${i,}: ${i,} -. info . adjacent: ${:Uinner}${:Uinner}${:Uinner:M*}${:Uinner} -make: "directive-for-escape.mk" line 173: . $i: inner -make: "directive-for-escape.mk" line 174: . ${i}: inner -make: "directive-for-escape.mk" line 175: . ${i:M*}: inner -make: "directive-for-escape.mk" line 176: . $(i): inner -make: "directive-for-escape.mk" line 177: . $(i:M*): inner -make: "directive-for-escape.mk" line 178: . ${i${:U}}: outer -make: "directive-for-escape.mk" line 179: . ${i\}}: inner} -make: "directive-for-escape.mk" line 180: . ${i2}: two -make: "directive-for-escape.mk" line 181: . ${i,}: comma -make: "directive-for-escape.mk" line 182: . adjacent: innerinnerinnerinner -make: "directive-for-escape.mk" line 201: invalid character '$' in .for loop variable name +. info ${:Uinner} ${:Uinner} ${:Uinner:M*} $(:Uinner) $(:Uinner:M*) +make: "directive-for-escape.mk" line 175: inner inner inner inner inner For: end for 1 -make: "directive-for-escape.mk" line 213: eight and no cents. +For: loop body with i = inner: +. info ${i${:U}} +make: "directive-for-escape.mk" line 179: outer For: end for 1 -make: "directive-for-escape.mk" line 226: newline in .for value -make: "directive-for-escape.mk" line 226: newline in .for value +For: loop body with i = inner: +. info ${:Uinner\}} # XXX: unclear why ForLoop_SubstVarLong needs this +make: "directive-for-escape.mk" line 183: inner} +For: end for 1 +For: loop body with i = inner: +. info ${i2} ${i,} ${:Uinner}${:Uinner}${:Uinner:M*}${:Uinner} +make: "directive-for-escape.mk" line 187: two comma innerinnerinnerinner +make: "directive-for-escape.mk" line 196: invalid character '$' in .for loop variable name +For: end for 1 +make: "directive-for-escape.mk" line 208: eight and no cents. +For: end for 1 +make: "directive-for-escape.mk" line 222: newline in .for value + in .for loop from directive-for-escape.mk:222 with i = " +" +make: "directive-for-escape.mk" line 222: newline in .for value + in .for loop from directive-for-escape.mk:222 with i = " +" For: loop body with i = " ": -. info short: ${:U" "} -. info long: ${:U" "} -make: "directive-for-escape.mk" line 227: short: " " -make: "directive-for-escape.mk" line 228: long: " " +. info short: ${:U" "}, long: ${:U" "} +make: "directive-for-escape.mk" line 223: short: " ", long: " " For: end for 1 For: loop body with i = " ": -Parsing line 244: .for i in "${.newline}" +Parsing line 236: .for i in "${.newline}" For: end for 1 -Parse_PushInput: .for loop in directive-for-escape.mk, line 244 -make: "directive-for-escape.mk" line 244: newline in .for value - in .for loop from directive-for-escape.mk:244 with i = " +Parse_PushInput: .for loop in directive-for-escape.mk, line 236 +make: "directive-for-escape.mk" line 236: newline in .for value + in .for loop from directive-for-escape.mk:236 with i = " " For: loop body with i = " ": : ${:U" "} SetFilenameVars: ${.PARSEDIR} = ${.PARSEFILE} = `directive-for-escape.mk' -Parsing line 245: : ${:U" "} +Parsing line 237: : ${:U" "} ParseDependency(: " ") -ParseEOF: returning to file directive-for-escape.mk, line 247 +ParseEOF: returning to file directive-for-escape.mk, line 239 SetFilenameVars: ${.PARSEDIR} = ${.PARSEFILE} = `directive-for-escape.mk' -Parsing line 247: .MAKEFLAGS: -d0 +Parsing line 239: .MAKEFLAGS: -d0 ParseDependency(.MAKEFLAGS: -d0) For: end for 1 For: loop body with i = #: diff --git a/contrib/bmake/unit-tests/directive-for-escape.mk b/contrib/bmake/unit-tests/directive-for-escape.mk index 16df5b1db4e3..dcd13e1392c0 100644 --- a/contrib/bmake/unit-tests/directive-for-escape.mk +++ b/contrib/bmake/unit-tests/directive-for-escape.mk @@ -1,4 +1,4 @@ -# $NetBSD: directive-for-escape.mk,v 1.23 2023/11/19 22:32:44 rillig Exp $ +# $NetBSD: directive-for-escape.mk,v 1.28 2024/07/07 11:20:10 rillig Exp $ # # Test escaping of special characters in the iteration values of a .for loop. # These values get expanded later using the :U variable modifier, and this @@ -15,10 +15,11 @@ ASCII= !"\#$$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~ # XXX: As of 2020-12-31, the '#' is not preserved in the expanded body of # the loop. Not only would it need the escaping for the variable modifier # ':U' but also the escaping for the line-end comment. +# expect+3: while evaluating "${:U!"" with value "!"": Unclosed expression, expecting '}' for modifier "U!"" +# expect+2: !" .for chars in ${ASCII} . info ${chars} .endfor -# expect-2: !" # As of 2020-12-31, using 2 backslashes before be '#' would treat the '#' # as comment character. Using 3 backslashes doesn't help either since @@ -26,10 +27,11 @@ ASCII= !"\#$$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~ # This means that a '#' sign cannot be passed in the value of a .for loop # at all. ASCII.2020-12-31= !"\\\#$$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~ +# expect+3: while evaluating "${:U!"\\\\" with value "!"\\": Unclosed expression, expecting '}' for modifier "U!"\\\\" +# expect+2: !"\\ .for chars in ${ASCII.2020-12-31} . info ${chars} .endfor -# expect-2: !"\\ # Cover the code in ExprLen. # @@ -41,31 +43,31 @@ ASCII.2020-12-31= !"\\\#$$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~ # See for.c, function ExprLen. V= value VALUES= $$ $${V} $${V:=-with-modifier} $$(V) $$(V:=-with-modifier) +# expect: . info ${:U\$} +# expect+10: $ +# expect: . info ${:U${V}} +# expect+8: value +# expect: . info ${:U${V:=-with-modifier}} +# expect+6: value-with-modifier +# expect: . info ${:U$(V)} +# expect+4: value +# expect: . info ${:U$(V:=-with-modifier)} +# expect+2: value-with-modifier .for i in ${VALUES} . info $i .endfor -# expect: . info ${:U\$} -# expect-3: $ -# expect: . info ${:U${V}} -# expect-5: value -# expect: . info ${:U${V:=-with-modifier}} -# expect-7: value-with-modifier -# expect: . info ${:U$(V)} -# expect-9: value -# expect: . info ${:U$(V:=-with-modifier)} -# expect-11: value-with-modifier # # Providing the loop items directly has the same effect. +# expect: . info ${:U\$} +# expect+7: $ +# expect: . info ${:U${V}} +# expect+5: value +# expect+4: value-with-modifier +# expect+3: value +# expect+2: value-with-modifier .for i in $$ $${V} $${V:=-with-modifier} $$(V) $$(V:=-with-modifier) . info $i .endfor -# expect: . info ${:U\$} -# expect-3: $ -# expect: . info ${:U${V}} -# expect-5: value -# expect-6: value-with-modifier -# expect-7: value -# expect-8: value-with-modifier # Try to cover the code for nested '{}' in ExprLen, without success. # @@ -111,19 +113,18 @@ VALUES= $${UNDEF:U\$$\$$ {{}} end} # # To make the expression '$\' visible, define it to an actual word: ${:U\\}= backslash +# expect+4: ${UNDEF:U\backslash$ +# expect+3: {{}} +# expect+2: end} .for i in ${VALUES} . info $i .endfor # -# expect-3: ${UNDEF:U\backslash$ -# expect-4: {{}} -# expect-5: end} -# # FIXME: There was no expression '$\' in the original text of the variable # 'VALUES', that's a surprise in the parser. -# Second try to cover the code for nested '{}' in ExprLen. +# The second attempt to cover the code for nested '{}' in ExprLen. # # XXX: It is not the job of ExprLen to parse an expression, it is naive to # expect ExprLen to get all the details right in just a few lines of code. @@ -132,19 +133,19 @@ ${:U\\}= backslash # ':D' for details.) The only sensible thing to do is therefore to let # Var_Parse do all the parsing work. VALUES= begin<$${UNDEF:Ufallback:N{{{}}}}>end +# expect+2: beginend .for i in ${VALUES} . info $i .endfor -# expect-2: beginend # A single trailing dollar doesn't happen in practice. # The dollar sign is correctly passed through to the body of the .for loop. # There, it is expanded by the .info directive, but even there a trailing # dollar sign is kept as-is. +# expect+2: $ .for i in ${:U\$} . info ${i} .endfor -# expect-2: $ # Before for.c 1.173 from 2023-05-08, the name of the iteration variable # could contain colons, which affected expressions having this exact @@ -169,28 +170,22 @@ EXT= .c i= outer i2= two i,= comma +# expect+2: inner inner inner inner inner .for i in inner -. info . $$i: $i -. info . $${i}: ${i} -. info . $${i:M*}: ${i:M*} -. info . $$(i): $(i) -. info . $$(i:M*): $(i:M*) -. info . $${i$${:U}}: ${i${:U}} -. info . $${i\}}: ${i\}} # XXX: unclear why ForLoop_SubstVarLong needs this -. info . $${i2}: ${i2} -. info . $${i,}: ${i,} -. info . adjacent: $i${i}${i:M*}$i +. info $i ${i} ${i:M*} $(i) $(i:M*) +.endfor +# expect+2: outer +.for i in inner +. info ${i${:U}} +.endfor +# expect+2: inner} +.for i in inner +. info ${i\}} # XXX: unclear why ForLoop_SubstVarLong needs this +.endfor +# expect+2: two comma innerinnerinnerinner +.for i in inner +. info ${i2} ${i,} $i${i}${i:M*}$i .endfor -# expect-11: . $i: inner -# expect-11: . ${i}: inner -# expect-11: . ${i:M*}: inner -# expect-11: . $(i): inner -# expect-11: . $(i:M*): inner -# expect-11: . ${i${:U}}: outer -# expect-11: . ${i\}}: inner} -# expect-11: . ${i2}: two -# expect-11: . ${i,}: comma -# expect-11: . adjacent: innerinnerinnerinner # Before for.c 1.173 from 2023-05-08, the variable name could be a single '$' # since there was no check on valid variable names. ForLoop_SubstVarShort @@ -221,16 +216,13 @@ ${closing-brace}= # alternative interpretation # The error message occurs in the line of the .for loop since that's the place # where the body of the .for loop is constructed, and at this point the # newline character gets replaced with a plain space. +# expect+3: newline in .for value # expect+2: newline in .for value -# expect+1: newline in .for value +# expect+2: short: " ", long: " " .for i in "${.newline}" -. info short: $i -. info long: ${i} +. info short: $i, long: ${i} .endfor -# expect-3: short: " " -# expect-3: long: " " - -# No error since the newline character is not actually used. +# No error since the newline character is not actually used in the body. .for i in "${.newline}" .endfor diff --git a/contrib/bmake/unit-tests/directive-for-generating-endif.exp b/contrib/bmake/unit-tests/directive-for-generating-endif.exp index ecdeb0962202..142189f70579 100755 --- a/contrib/bmake/unit-tests/directive-for-generating-endif.exp +++ b/contrib/bmake/unit-tests/directive-for-generating-endif.exp @@ -1,7 +1,10 @@ make: "directive-for-generating-endif.mk" line 24: if-less endif + in .for loop from directive-for-generating-endif.mk:20 with i = 3 make: "directive-for-generating-endif.mk" line 24: if-less endif + in .for loop from directive-for-generating-endif.mk:20 with i = 2 make: "directive-for-generating-endif.mk" line 24: if-less endif + in .for loop from directive-for-generating-endif.mk:20 with i = 1 make: "directive-for-generating-endif.mk" line 30: 3 open conditionals make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-for-if.exp b/contrib/bmake/unit-tests/directive-for-if.exp index f30171f4db87..71ea8ae63569 100644 --- a/contrib/bmake/unit-tests/directive-for-if.exp +++ b/contrib/bmake/unit-tests/directive-for-if.exp @@ -1,8 +1,11 @@ make: "directive-for-if.mk" line 51: if-less endif + in .for loop from directive-for-if.mk:46 with directive = if make: "directive-for-if.mk" line 51: if-less endif + in .for loop from directive-for-if.mk:46 with directive = ifdef make: "directive-for-if.mk" line 51: if-less endif + in .for loop from directive-for-if.mk:46 with directive = ifndef VAR1 VAR3 make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "." in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-for-null.exp b/contrib/bmake/unit-tests/directive-for-null.exp index d6198c644817..8aa36598550d 100644 --- a/contrib/bmake/unit-tests/directive-for-null.exp +++ b/contrib/bmake/unit-tests/directive-for-null.exp @@ -1,6 +1,7 @@ make: "(stdin)" line 2: Zero byte read from file + in directory *** Error code 2 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-for.exp b/contrib/bmake/unit-tests/directive-for.exp index 3e346dfab4ea..62b51aa406bf 100755 --- a/contrib/bmake/unit-tests/directive-for.exp +++ b/contrib/bmake/unit-tests/directive-for.exp @@ -1,31 +1,33 @@ make: "directive-for.mk" line 117: outer -make: "directive-for.mk" line 135: a:\ a:\file.txt -make: "directive-for.mk" line 135: d:\\ -make: "directive-for.mk" line 135: d:\\file.txt -make: "directive-for.mk" line 146: ( ( ( -make: "directive-for.mk" line 146: [ [ [ -make: "directive-for.mk" line 146: { { { -make: "directive-for.mk" line 146: ) ) ) -make: "directive-for.mk" line 146: ] ] ] -make: "directive-for.mk" line 146: } } } -make: "directive-for.mk" line 146: (()) (()) (()) -make: "directive-for.mk" line 146: [[]] [[]] [[]] -make: "directive-for.mk" line 146: {{}} {{}} {{}} -make: "directive-for.mk" line 146: )( )( )( -make: "directive-for.mk" line 146: ][ ][ ][ -make: "directive-for.mk" line 146: }{ }{ }{ +make: "directive-for.mk" line 138: a:\ a:\file.txt +make: "directive-for.mk" line 138: d:\\ +make: "directive-for.mk" line 138: d:\\file.txt +make: "directive-for.mk" line 158: ( ( ( +make: "directive-for.mk" line 158: [ [ [ +make: "directive-for.mk" line 158: { { { +make: "directive-for.mk" line 158: ) ) ) +make: "directive-for.mk" line 158: ] ] ] +make: "directive-for.mk" line 158: } } } +make: "directive-for.mk" line 158: (()) (()) (()) +make: "directive-for.mk" line 158: [[]] [[]] [[]] +make: "directive-for.mk" line 158: {{}} {{}} {{}} +make: "directive-for.mk" line 158: )( )( )( +make: "directive-for.mk" line 158: ][ ][ ][ +make: "directive-for.mk" line 158: }{ }{ }{ make: "directive-for.mk" line 166: invalid character ':' in .for loop variable name make: "directive-for.mk" line 173: invalid character '$' in .for loop variable name make: "directive-for.mk" line 185: invalid character '$' in .for loop variable name -make: "directive-for.mk" line 210: while evaluating "${:Uword2:Z}-after word3": Unknown modifier "Z" -make: "directive-for.mk" line 211: XXX: Should not reach word1 -make: "directive-for.mk" line 211: XXX: Should not reach before--after -make: "directive-for.mk" line 211: XXX: Should not reach word3 +make: "directive-for.mk" line 210: while evaluating "${:Uword2:Z}-after word3" with value "word2": Unknown modifier "Z" +make: "directive-for.mk" line 214: XXX: Should not reach word1 +make: "directive-for.mk" line 214: XXX: Should not reach before--after +make: "directive-for.mk" line 214: XXX: Should not reach word3 make: "directive-for.mk" line 219: no iteration variables in for make: "directive-for.mk" line 245: 1 open conditional + in .for loop from directive-for.mk:243 with var = value make: "directive-for.mk" line 261: for-less endfor make: "directive-for.mk" line 262: if-less endif make: "directive-for.mk" line 270: if-less endif + in .for loop from directive-for.mk:269 with var = value For: new loop 2 For: end for 2 For: end for 1 @@ -36,7 +38,7 @@ For: loop body with outer = o: endfor For: end for 1 For: loop body with inner = i: -make: "directive-for.mk" line 318: newline-item=(a) +make: "directive-for.mk" line 319: newline-item=(a) make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-for.mk b/contrib/bmake/unit-tests/directive-for.mk index d777c3921556..96c1a492a5f7 100755 --- a/contrib/bmake/unit-tests/directive-for.mk +++ b/contrib/bmake/unit-tests/directive-for.mk @@ -1,4 +1,4 @@ -# $NetBSD: directive-for.mk,v 1.25 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: directive-for.mk,v 1.27 2024/07/06 10:14:35 rillig Exp $ # # Tests for the .for directive. # @@ -132,31 +132,31 @@ EXPANSION${plus}= value # variable values have been replaced with expressions of the form ${:U...}, # which are not interpreted as code anymore. .for path in a:\ a:\file.txt d:\\ d:\\file.txt +# expect+3: a:\ a:\file.txt +# expect+2: d:\\ +# expect+1: d:\\file.txt . info ${path} .endfor -# expect-2: a:\ a:\file.txt -# expect-3: d:\\ -# expect-4: d:\\file.txt # Ensure that braces and parentheses are properly escaped by the .for loop. # Each line must print the same word 3 times. # See ForLoop_SubstBody. .for v in ( [ { ) ] } (()) [[]] {{}} )( ][ }{ +# expect+12: ( ( ( +# expect+11: [ [ [ +# expect+10: { { { +# expect+9: ) ) ) +# expect+8: ] ] ] +# expect+7: } } } +# expect+6: (()) (()) (()) +# expect+5: [[]] [[]] [[]] +# expect+4: {{}} {{}} {{}} +# expect+3: )( )( )( +# expect+2: ][ ][ ][ +# expect+1: }{ }{ }{ . info $v ${v} $(v) .endfor -# expect-02: ( ( ( -# expect-03: [ [ [ -# expect-04: { { { -# expect-05: ) ) ) -# expect-06: ] ] ] -# expect-07: } } } -# expect-08: (()) (()) (()) -# expect-09: [[]] [[]] [[]] -# expect-10: {{}} {{}} {{}} -# expect-11: )( )( )( -# expect-12: ][ ][ ][ -# expect-13: }{ }{ }{ # Before 2023-05-09, the variable names could contain arbitrary characters, # except for whitespace, allowing for creative side effects, as usual for @@ -206,13 +206,13 @@ INDIRECT= ${DIRECT} # XXX: A parse error or evaluation error in the items of the .for loop # should skip the whole loop. As of 2023-05-09, the loop is expanded as # usual. -# expect+1: while evaluating "${:Uword2:Z}-after word3": Unknown modifier "Z" +# expect+1: while evaluating "${:Uword2:Z}-after word3" with value "word2": Unknown modifier "Z" .for var in word1 before-${:Uword2:Z}-after word3 +# expect+3: XXX: Should not reach word1 +# expect+2: XXX: Should not reach before--after +# expect+1: XXX: Should not reach word3 . info XXX: Should not reach ${var} .endfor -# expect-2: XXX: Should not reach word1 -# expect-3: XXX: Should not reach before--after -# expect-4: XXX: Should not reach word3 # An empty list of variables to the left of the 'in' is a parse error. @@ -315,6 +315,6 @@ INDIRECT= ${DIRECT} # Back then, the .newline variable didn't exist, therefore it was unlikely # that a newline ever occurred. .for var in a${.newline}b${.newline}c +# expect+1: newline-item=(a) . info newline-item=(${var}) .endfor -# expect-2: newline-item=(a) diff --git a/contrib/bmake/unit-tests/directive-hyphen-include.exp b/contrib/bmake/unit-tests/directive-hyphen-include.exp index 308a444890d5..d840a247102d 100755 --- a/contrib/bmake/unit-tests/directive-hyphen-include.exp +++ b/contrib/bmake/unit-tests/directive-hyphen-include.exp @@ -1,4 +1,5 @@ make: "directive-hyphen-include-error.inc" line 1: Invalid line 'syntax error' + in directive-hyphen-include.mk:20 make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-ifmake.exp b/contrib/bmake/unit-tests/directive-ifmake.exp index e607726fd87c..53727e4449e0 100644 --- a/contrib/bmake/unit-tests/directive-ifmake.exp +++ b/contrib/bmake/unit-tests/directive-ifmake.exp @@ -11,5 +11,5 @@ make: "directive-ifmake.mk" line 82: ok make: don't know how to make !edge (continuing) Stop. -make: stopped in unit-tests +make: stopped making "first second late-target !edge" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-include-fatal.exp b/contrib/bmake/unit-tests/directive-include-fatal.exp index cae0fc97a59d..edb32df1a59b 100755 --- a/contrib/bmake/unit-tests/directive-include-fatal.exp +++ b/contrib/bmake/unit-tests/directive-include-fatal.exp @@ -1,4 +1,4 @@ make: "directive-include-fatal.mk" line 14: Malformed conditional (${UNDEF}) make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-include.exp b/contrib/bmake/unit-tests/directive-include.exp index 6454b6835edf..4c395d7532aa 100755 --- a/contrib/bmake/unit-tests/directive-include.exp +++ b/contrib/bmake/unit-tests/directive-include.exp @@ -4,10 +4,10 @@ CondParser_Eval: ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null" Comparing "directive-include.mk null" != "directive-include.mk null" make: "directive-include.mk" line 26: Could not find nonexistent.mk make: "directive-include.mk" line 49: Could not find " -make: "directive-include.mk" line 56: while evaluating "${:U123:Z}.mk": Unknown modifier "Z" +make: "directive-include.mk" line 56: while evaluating "${:U123:Z}.mk" with value "123": Unknown modifier "Z" make: "directive-include.mk" line 56: Could not find nonexistent.mk make: "directive-include.mk" line 61: Cannot open /nonexistent make: "directive-include.mk" line 66: Invalid line 'include' make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-include.mk b/contrib/bmake/unit-tests/directive-include.mk index 14d00600cb8f..e2ef8dc55e3c 100755 --- a/contrib/bmake/unit-tests/directive-include.mk +++ b/contrib/bmake/unit-tests/directive-include.mk @@ -1,4 +1,4 @@ -# $NetBSD: directive-include.mk,v 1.14 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: directive-include.mk,v 1.15 2024/07/05 19:47:22 rillig Exp $ # # Tests for the .include directive, which includes another file. @@ -52,7 +52,7 @@ DQUOT= " # expression is skipped and the file is included nevertheless. # FIXME: Add proper error handling, no file must be included here. # expect+2: Could not find nonexistent.mk -# expect+1: while evaluating "${:U123:Z}.mk": Unknown modifier "Z" +# expect+1: while evaluating "${:U123:Z}.mk" with value "123": Unknown modifier "Z" .include "nonexistent${:U123:Z}.mk" # The traditional include directive is seldom used. diff --git a/contrib/bmake/unit-tests/directive-info.exp b/contrib/bmake/unit-tests/directive-info.exp index 397d9d31ef38..17c72caf1b23 100644 --- a/contrib/bmake/unit-tests/directive-info.exp +++ b/contrib/bmake/unit-tests/directive-info.exp @@ -11,5 +11,5 @@ make: "directive-info.mk" line 36: Unknown directive "info-message" make: "directive-info.mk" line 38: no-target: no-source make: "directive-info.mk" line 47: expect line 35 for multi-line message make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making ".info.man" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-sinclude.exp b/contrib/bmake/unit-tests/directive-sinclude.exp index 5e8ecd710dc6..5b5560542c5a 100755 --- a/contrib/bmake/unit-tests/directive-sinclude.exp +++ b/contrib/bmake/unit-tests/directive-sinclude.exp @@ -1,4 +1,5 @@ make: "directive-include-error.inc" line 1: Invalid line 'syntax error' + in directive-sinclude.mk:20 make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-undef.exp b/contrib/bmake/unit-tests/directive-undef.exp index 329dc8d6282a..c3d01fc480c6 100644 --- a/contrib/bmake/unit-tests/directive-undef.exp +++ b/contrib/bmake/unit-tests/directive-undef.exp @@ -1,6 +1,6 @@ make: "directive-undef.mk" line 30: The .undef directive requires an argument -make: "directive-undef.mk" line 88: while evaluating variable "VARNAMES": Unknown modifier "Z" +make: "directive-undef.mk" line 88: while evaluating variable "VARNAMES" with value "VARNAMES": Unknown modifier "Z" make: "directive-undef.mk" line 105: warning: UT_EXPORTED is still listed in .MAKE.EXPORTED even though spaceit is not exported anymore. make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-undef.mk b/contrib/bmake/unit-tests/directive-undef.mk index ac4b20d3e858..43938e3170ea 100644 --- a/contrib/bmake/unit-tests/directive-undef.mk +++ b/contrib/bmake/unit-tests/directive-undef.mk @@ -1,4 +1,4 @@ -# $NetBSD: directive-undef.mk,v 1.14 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: directive-undef.mk,v 1.15 2024/07/04 17:47:54 rillig Exp $ # # Tests for the .undef directive. # @@ -84,7 +84,7 @@ ${DOLLAR}= dollar # # As of var.c 1.762, this doesn't happen though because the error handling # in Var_Parse and Var_Subst is not done properly. -# expect+1: while evaluating variable "VARNAMES": Unknown modifier "Z" +# expect+1: while evaluating variable "VARNAMES" with value "VARNAMES": Unknown modifier "Z" .undef ${VARNAMES:L:Z} diff --git a/contrib/bmake/unit-tests/directive-unexport-env.exp b/contrib/bmake/unit-tests/directive-unexport-env.exp index 663034cee12c..57cf2d4b1dd9 100644 --- a/contrib/bmake/unit-tests/directive-unexport-env.exp +++ b/contrib/bmake/unit-tests/directive-unexport-env.exp @@ -14,5 +14,5 @@ Global: delete .MAKE.EXPORTED Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive-warning.exp b/contrib/bmake/unit-tests/directive-warning.exp index 6fbeed91df0f..82bc06c55072 100644 --- a/contrib/bmake/unit-tests/directive-warning.exp +++ b/contrib/bmake/unit-tests/directive-warning.exp @@ -7,5 +7,5 @@ make: "directive-warning.mk" line 19: warning: message make: "directive-warning.mk" line 21: Unknown directive "warnings" make: "directive-warning.mk" line 23: Unknown directive "warnings" make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/directive.exp b/contrib/bmake/unit-tests/directive.exp index cad8a9bb97e0..a1532ee564dc 100644 --- a/contrib/bmake/unit-tests/directive.exp +++ b/contrib/bmake/unit-tests/directive.exp @@ -10,5 +10,5 @@ Global: .MAKEFLAGS = -r -k -d v -d 0 make: "directive.mk" line 40: Invalid line 'target-without-colon' make: "directive.mk" line 43: Invalid line 'target-without-colon another-target' make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making ".target" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/doterror.exp b/contrib/bmake/unit-tests/doterror.exp index 5655644c32e2..1d7e41961c48 100644 --- a/contrib/bmake/unit-tests/doterror.exp +++ b/contrib/bmake/unit-tests/doterror.exp @@ -4,6 +4,6 @@ and now: sad *** Error code 1 Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests .ERROR: Looks like 'sad' is upset. exit status 1 diff --git a/contrib/bmake/unit-tests/jobs-empty-commands-error.exp b/contrib/bmake/unit-tests/jobs-empty-commands-error.exp index 1639425d9013..22acf79be242 100644 --- a/contrib/bmake/unit-tests/jobs-empty-commands-error.exp +++ b/contrib/bmake/unit-tests/jobs-empty-commands-error.exp @@ -1,5 +1,5 @@ : 'Making existing-target out of nothing.' make: don't know how to make nonexistent-target (continuing) -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 2 diff --git a/contrib/bmake/unit-tests/jobs-error-indirect.exp b/contrib/bmake/unit-tests/jobs-error-indirect.exp index 79843a235666..989d80c99cee 100644 --- a/contrib/bmake/unit-tests/jobs-error-indirect.exp +++ b/contrib/bmake/unit-tests/jobs-error-indirect.exp @@ -1,8 +1,8 @@ false *** [indirect] Error code 1 -make: stopped in unit-tests +make: stopped making "all" in unit-tests make: 1 error -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 2 diff --git a/contrib/bmake/unit-tests/jobs-error-nested-make.exp b/contrib/bmake/unit-tests/jobs-error-nested-make.exp index 2baf893c6623..cd9c8d17336f 100644 --- a/contrib/bmake/unit-tests/jobs-error-nested-make.exp +++ b/contrib/bmake/unit-tests/jobs-error-nested-make.exp @@ -2,10 +2,10 @@ make -f jobs-error-nested-make.mk nested false *** [nested] Error code 1 -make: stopped in unit-tests +make: stopped making "nested" in unit-tests make: 1 error -make: stopped in unit-tests +make: stopped making "nested" in unit-tests -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 2 diff --git a/contrib/bmake/unit-tests/jobs-error-nested.exp b/contrib/bmake/unit-tests/jobs-error-nested.exp index 873613d40d48..5f5f8029ffd9 100644 --- a/contrib/bmake/unit-tests/jobs-error-nested.exp +++ b/contrib/bmake/unit-tests/jobs-error-nested.exp @@ -2,14 +2,14 @@ make -f jobs-error-nested.mk nested false *** [nested] Error code 1 -make: stopped in unit-tests +make: stopped making "nested" in unit-tests make: 1 error -make: stopped in unit-tests +make: stopped making "nested" in unit-tests *** [all] Error code 2 -make: stopped in unit-tests +make: stopped making "all" in unit-tests make: 1 error -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 2 diff --git a/contrib/bmake/unit-tests/lint.exp b/contrib/bmake/unit-tests/lint.exp index 78761c862298..714093ca2b7d 100755 --- a/contrib/bmake/unit-tests/lint.exp +++ b/contrib/bmake/unit-tests/lint.exp @@ -1,4 +1,4 @@ -make: in target "mod-loop-varname": while evaluating variable "VAR": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar +make: in target "mod-loop-varname": while evaluating variable "VAR" with value "value": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar y@:Q} xvaluey exit status 2 diff --git a/contrib/bmake/unit-tests/moderrs.exp b/contrib/bmake/unit-tests/moderrs.exp index 0d1bcdc5b0f9..05a5108935cd 100644 --- a/contrib/bmake/unit-tests/moderrs.exp +++ b/contrib/bmake/unit-tests/moderrs.exp @@ -1,137 +1,115 @@ -mod-unknown-direct: -want: Unknown modifier 'Z' -make: in target "mod-unknown-direct": while evaluating variable "VAR": Unknown modifier "Z" +make: in target "mod-unknown-direct": while evaluating variable "VAR" with value "TheVariable": Unknown modifier "Z" VAR:Z=before--after -mod-unknown-indirect: -want: Unknown modifier 'Z' -make: in target "mod-unknown-indirect": while evaluating variable "VAR": Unknown modifier "Z" +make: in target "mod-unknown-indirect": while evaluating variable "VAR" with value "TheVariable": Unknown modifier "Z" VAR:Z=before-inner}-after unclosed-direct: -want: Unclosed expression, expecting '}' for modifier "S,V,v," of variable "VAR" with value "Thevariable" -make: Unclosed expression, expecting '}' for modifier "S,V,v," of variable "VAR" with value "Thevariable" +make: in target "unclosed-direct": while evaluating variable "VAR" with value "Thevariable": Unclosed expression, expecting '}' for modifier "S,V,v," VAR:S,V,v,=Thevariable unclosed-indirect: -want: Unclosed expression after indirect modifier, expecting '}' for variable "VAR" -make: Unclosed expression after indirect modifier, expecting '}' for variable "VAR" +make: in target "unclosed-indirect": while evaluating variable "VAR" with value "Thevariable": Unclosed expression after indirect modifier, expecting '}' VAR:S,V,v,=Thevariable -unfinished-indirect: -want: Unfinished modifier for VAR (',' missing) -make: Unfinished modifier for "VAR" (',' missing) +make: in target "unfinished-indirect": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) VAR:S,V,v= -unfinished-loop: -want: Unfinished modifier for UNDEF ('@' missing) -make: Unfinished modifier for "UNDEF" ('@' missing) +make: in target "unfinished-loop": while evaluating variable "UNDEF" with value "1 2 3": Unfinished modifier ('@' missing) -want: Unfinished modifier for UNDEF ('@' missing) -make: Unfinished modifier for "UNDEF" ('@' missing) +make: in target "unfinished-loop": while evaluating variable "UNDEF" with value "1 2 3": Unfinished modifier ('@' missing) 1 2 3 loop-close: -make: Unclosed expression, expecting '}' for modifier "@var@${var}}...@" of variable "UNDEF" with value "1}... 2}... 3}..." +make: in target "loop-close": while evaluating variable "UNDEF" with value "1}... 2}... 3}...": Unclosed expression, expecting '}' for modifier "@var@${var}}...@" 1}... 2}... 3}... 1}... 2}... 3}... -words: -want: Unfinished modifier for UNDEF (']' missing) -make: Unfinished modifier for "UNDEF" (']' missing) +make: in target "words": while evaluating variable "UNDEF" with value "1 2 3": Unfinished modifier (']' missing) -want: Unfinished modifier for UNDEF (']' missing) -make: Unfinished modifier for "UNDEF" (']' missing) +make: in target "words": while evaluating variable "UNDEF" with value "1 2 3": Unfinished modifier (']' missing) 13= -make: Bad modifier ":[123451234512345123451234512345]" for variable "UNDEF" +make: in target "words": while evaluating variable "UNDEF" with value "1 2 3": Bad modifier ":[123451234512345123451234512345]" 12345=S,^ok,:S,^3ok,} -exclam: -want: Unfinished modifier for VARNAME ('!' missing) -make: Unfinished modifier for "VARNAME" ('!' missing) +make: in target "exclam": while evaluating variable "VARNAME" with value "": Unfinished modifier ('!' missing) -want: Unfinished modifier for ! ('!' missing) -make: Unfinished modifier for "!" ('!' missing) +make: in target "exclam": while evaluating variable "!" with value "!": Unfinished modifier ('!' missing) -mod-subst-delimiter: -make: Missing delimiter for modifier ':S' +make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Missing delimiter for modifier ':S' 1: -make: Unfinished modifier for "VAR" (',' missing) +make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) 2: -make: Unfinished modifier for "VAR" (',' missing) +make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) 3: -make: Unfinished modifier for "VAR" (',' missing) +make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) 4: -make: Unfinished modifier for "VAR" (',' missing) +make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) 5: -make: Unclosed expression, expecting '}' for modifier "S,from,to," of variable "VAR" with value "TheVariable" +make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Unclosed expression, expecting '}' for modifier "S,from,to," 6: TheVariable 7: TheVariable -mod-regex-delimiter: -make: Missing delimiter for :C modifier +make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Missing delimiter for modifier ':C' 1: -make: Unfinished modifier for "VAR" (',' missing) +make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) 2: -make: Unfinished modifier for "VAR" (',' missing) +make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) 3: -make: Unfinished modifier for "VAR" (',' missing) +make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) 4: -make: Unfinished modifier for "VAR" (',' missing) +make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) 5: -make: Unclosed expression, expecting '}' for modifier "C,from,to," of variable "VAR" with value "TheVariable" +make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Unclosed expression, expecting '}' for modifier "C,from,to," 6: TheVariable 7: TheVariable mod-ts-parse: 112358132134 15152535558513521534 -make: Bad modifier ":ts\65oct" for variable "FIB" +make: in target "mod-ts-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":ts\65oct" 65oct} -make: Bad modifier ":ts\65oct" for variable "" +make: in target "mod-ts-parse": while evaluating "${:U${FIB}:ts\65oct} # bad modifier, variable name is """ with value "1 1 2 3 5 8 13 21 34": Bad modifier ":ts\65oct" 65oct} -make: Bad modifier ":tsxy" for variable "FIB" +make: in target "mod-ts-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":tsxy" xy} mod-t-parse: -make: Bad modifier ":t" for variable "FIB" +make: in target "mod-t-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":t" -make: Bad modifier ":txy" for variable "FIB" +make: in target "mod-t-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":txy" y} -make: Bad modifier ":t" for variable "FIB" +make: in target "mod-t-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":t" -make: Bad modifier ":t" for variable "FIB" +make: in target "mod-t-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":t" M*} -mod-ifelse-parse: -make: Unfinished modifier for "FIB" (':' missing) +make: in target "mod-ifelse-parse": while evaluating then-branch of condition "FIB": Unfinished modifier (':' missing) -make: Unfinished modifier for "FIB" (':' missing) +make: in target "mod-ifelse-parse": while evaluating then-branch of condition "FIB": Unfinished modifier (':' missing) -make: Unfinished modifier for "FIB" ('}' missing) +make: in target "mod-ifelse-parse": while evaluating else-branch of condition "FIB": Unfinished modifier ('}' missing) -make: Unfinished modifier for "FIB" ('}' missing) +make: in target "mod-ifelse-parse": while evaluating else-branch of condition "FIB": Unfinished modifier ('}' missing) then -mod-remember-parse: 1 1 2 3 5 8 13 21 34 -make: in target "mod-remember-parse": while evaluating variable "FIB": Unknown modifier "__" +make: in target "mod-remember-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Unknown modifier "__" -mod-sysv-parse: -make: in target "mod-sysv-parse": while evaluating variable "FIB": Unknown modifier "3" -make: Unclosed expression, expecting '}' for modifier "3" of variable "FIB" with value "" +make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Unknown modifier "3" +make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "": Unclosed expression, expecting '}' for modifier "3" -make: in target "mod-sysv-parse": while evaluating variable "FIB": Unknown modifier "3=" -make: Unclosed expression, expecting '}' for modifier "3=" of variable "FIB" with value "" +make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Unknown modifier "3=" +make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "": Unclosed expression, expecting '}' for modifier "3=" -make: in target "mod-sysv-parse": while evaluating variable "FIB": Unknown modifier "3=x3" -make: Unclosed expression, expecting '}' for modifier "3=x3" of variable "FIB" with value "" +make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Unknown modifier "3=x3" +make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "": Unclosed expression, expecting '}' for modifier "3=x3" 1 1 2 x3 5 8 1x3 21 34 -exit status 0 +exit status 2 diff --git a/contrib/bmake/unit-tests/moderrs.mk b/contrib/bmake/unit-tests/moderrs.mk index bde263af4079..66af52c14a65 100644 --- a/contrib/bmake/unit-tests/moderrs.mk +++ b/contrib/bmake/unit-tests/moderrs.mk @@ -1,8 +1,7 @@ -# $NetBSD: moderrs.mk,v 1.31 2023/11/19 22:32:44 rillig Exp $ +# $NetBSD: moderrs.mk,v 1.38 2024/07/05 19:47:22 rillig Exp $ # # various modifier error tests -'= '\'' VAR= TheVariable # in case we have to change it ;-) MOD_UNKN= Z @@ -25,30 +24,30 @@ all: mod-ifelse-parse all: mod-remember-parse all: mod-sysv-parse -mod-unknown-direct: print-header print-footer - @echo 'want: Unknown modifier $'Z$'' +mod-unknown-direct: print-footer +# expect: make: in target "mod-unknown-direct": while evaluating variable "VAR" with value "TheVariable": Unknown modifier "Z" @echo 'VAR:Z=before-${VAR:Z}-after' -mod-unknown-indirect: print-header print-footer - @echo 'want: Unknown modifier $'Z$'' +mod-unknown-indirect: print-footer +# expect: make: in target "mod-unknown-indirect": while evaluating variable "VAR" with value "TheVariable": Unknown modifier "Z" @echo 'VAR:${MOD_UNKN}=before-${VAR:${MOD_UNKN}:inner}-after' unclosed-direct: print-header print-footer - @echo 'want: Unclosed expression, expecting $'}$' for modifier "S,V,v," of variable "VAR" with value "Thevariable"' +# expect: make: in target "unclosed-direct": while evaluating variable "VAR" with value "Thevariable": Unclosed expression, expecting '}' for modifier "S,V,v," @echo VAR:S,V,v,=${VAR:S,V,v, unclosed-indirect: print-header print-footer - @echo 'want: Unclosed expression after indirect modifier, expecting $'}$' for variable "VAR"' +# expect: make: in target "unclosed-indirect": while evaluating variable "VAR" with value "Thevariable": Unclosed expression after indirect modifier, expecting '}' @echo VAR:${MOD_TERM},=${VAR:${MOD_S} -unfinished-indirect: print-header print-footer - @echo 'want: Unfinished modifier for VAR ($',$' missing)' +unfinished-indirect: print-footer +# expect: make: in target "unfinished-indirect": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) -@echo "VAR:${MOD_TERM}=${VAR:${MOD_TERM}}" -unfinished-loop: print-header print-footer - @echo 'want: Unfinished modifier for UNDEF ($'@$' missing)' +unfinished-loop: print-footer +# expect: make: in target "unfinished-loop": while evaluating variable "UNDEF" with value "1 2 3": Unfinished modifier ('@' missing) @echo ${UNDEF:U1 2 3:@var} - @echo 'want: Unfinished modifier for UNDEF ($'@$' missing)' +# expect: make: in target "unfinished-loop": while evaluating variable "UNDEF" with value "1 2 3": Unfinished modifier ('@' missing) @echo ${UNDEF:U1 2 3:@var@...} @echo ${UNDEF:U1 2 3:@var@${var}@} @@ -59,13 +58,14 @@ unfinished-loop: print-header print-footer # This is also contrary to the SysV modifier, where only the actually # used delimiter (either braces or parentheses) must be balanced. loop-close: print-header print-footer +# expect: make: in target "loop-close": while evaluating variable "UNDEF" with value "1}... 2}... 3}...": Unclosed expression, expecting '}' for modifier "@var@${var}}...@" @echo ${UNDEF:U1 2 3:@var@${var}}...@ @echo ${UNDEF:U1 2 3:@var@${var}}...@} -words: print-header print-footer - @echo 'want: Unfinished modifier for UNDEF ($']$' missing)' +words: print-footer +# expect: make: in target "words": while evaluating variable "UNDEF" with value "1 2 3": Unfinished modifier (']' missing) @echo ${UNDEF:U1 2 3:[} - @echo 'want: Unfinished modifier for UNDEF ($']$' missing)' +# expect: make: in target "words": while evaluating variable "UNDEF" with value "1 2 3": Unfinished modifier (']' missing) @echo ${UNDEF:U1 2 3:[#} # out of bounds => empty @@ -90,61 +90,91 @@ words: print-header print-footer # That variable is undefined, resulting in an empty string. @echo 12345=${UNDEF:U1 2 3:[123451234512345123451234512345]:S,^$,ok,:S,^3$,ok,} -exclam: print-header print-footer - @echo 'want: Unfinished modifier for VARNAME ($'!$' missing)' +exclam: print-footer +# expect: make: in target "exclam": while evaluating variable "VARNAME" with value "": Unfinished modifier ('!' missing) @echo ${VARNAME:!echo} # When the final exclamation mark is missing, there is no # fallback to the SysV substitution modifier. # If there were a fallback, the output would be "exclam", # and the above would have produced an "Unknown modifier '!'". - @echo 'want: Unfinished modifier for ! ($'!$' missing)' +# expect: make: in target "exclam": while evaluating variable "!" with value "!": Unfinished modifier ('!' missing) @echo ${!:L:!=exclam} -mod-subst-delimiter: print-header print-footer +mod-subst-delimiter: print-footer +# expect: make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Missing delimiter for modifier ':S' @echo 1: ${VAR:S +# expect: make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) @echo 2: ${VAR:S, +# expect: make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) @echo 3: ${VAR:S,from +# expect: make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) @echo 4: ${VAR:S,from, +# expect: make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) @echo 5: ${VAR:S,from,to +# expect: make: in target "mod-subst-delimiter": while evaluating variable "VAR" with value "TheVariable": Unclosed expression, expecting '}' for modifier "S,from,to," @echo 6: ${VAR:S,from,to, @echo 7: ${VAR:S,from,to,} -mod-regex-delimiter: print-header print-footer +mod-regex-delimiter: print-footer +# expect: make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Missing delimiter for modifier ':C' @echo 1: ${VAR:C +# expect: make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) @echo 2: ${VAR:C, +# expect: make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) @echo 3: ${VAR:C,from +# expect: make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) @echo 4: ${VAR:C,from, +# expect: make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Unfinished modifier (',' missing) @echo 5: ${VAR:C,from,to +# expect: make: in target "mod-regex-delimiter": while evaluating variable "VAR" with value "TheVariable": Unclosed expression, expecting '}' for modifier "C,from,to," @echo 6: ${VAR:C,from,to, @echo 7: ${VAR:C,from,to,} mod-ts-parse: print-header print-footer @echo ${FIB:ts} @echo ${FIB:ts\65} # octal 065 == U+0035 == '5' +# expect: make: in target "mod-ts-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":ts\65oct" @echo ${FIB:ts\65oct} # bad modifier +# expect: make: in target "mod-ts-parse": while evaluating "${:U${FIB}:ts\65oct} # bad modifier, variable name is """ with value "1 1 2 3 5 8 13 21 34": Bad modifier ":ts\65oct" @echo ${:U${FIB}:ts\65oct} # bad modifier, variable name is "" +# expect: make: in target "mod-ts-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":tsxy" @echo ${FIB:tsxy} # modifier too long mod-t-parse: print-header print-footer +# expect: make: in target "mod-t-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":t" @echo ${FIB:t +# expect: make: in target "mod-t-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":txy" @echo ${FIB:txy} +# expect: make: in target "mod-t-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":t" @echo ${FIB:t} +# expect: make: in target "mod-t-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":t" @echo ${FIB:t:M*} -mod-ifelse-parse: print-header print-footer +mod-ifelse-parse: print-footer +# expect: make: in target "mod-ifelse-parse": while evaluating then-branch of condition "FIB": Unfinished modifier (':' missing) @echo ${FIB:? +# expect: make: in target "mod-ifelse-parse": while evaluating then-branch of condition "FIB": Unfinished modifier (':' missing) @echo ${FIB:?then +# expect: make: in target "mod-ifelse-parse": while evaluating else-branch of condition "FIB": Unfinished modifier ('}' missing) @echo ${FIB:?then: +# expect: make: in target "mod-ifelse-parse": while evaluating else-branch of condition "FIB": Unfinished modifier ('}' missing) @echo ${FIB:?then:else @echo ${FIB:?then:else} -mod-remember-parse: print-header print-footer +mod-remember-parse: print-footer @echo ${FIB:_} # ok +# expect: make: in target "mod-remember-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Unknown modifier "__" @echo ${FIB:__} # modifier name too long -mod-sysv-parse: print-header print-footer +mod-sysv-parse: print-footer +# expect: make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Unknown modifier "3" +# expect: make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "": Unclosed expression, expecting '}' for modifier "3" @echo ${FIB:3 +# expect: make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Unknown modifier "3=" +# expect: make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "": Unclosed expression, expecting '}' for modifier "3=" @echo ${FIB:3= +# expect: make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Unknown modifier "3=x3" +# expect: make: in target "mod-sysv-parse": while evaluating variable "FIB" with value "": Unclosed expression, expecting '}' for modifier "3=x3" @echo ${FIB:3=x3 @echo ${FIB:3=x3} # ok diff --git a/contrib/bmake/unit-tests/opt-debug-errors-jobs.exp b/contrib/bmake/unit-tests/opt-debug-errors-jobs.exp index 614bb33b9208..a2ad864ba4e6 100644 --- a/contrib/bmake/unit-tests/opt-debug-errors-jobs.exp +++ b/contrib/bmake/unit-tests/opt-debug-errors-jobs.exp @@ -7,7 +7,7 @@ echo '3 spaces'; false echo '3 spaces'; false *** [fail-spaces] Error code 1 -make: stopped in unit-tests +make: stopped making "all" in unit-tests echo \ indented; false indented @@ -17,7 +17,7 @@ echo \ indented; false echo \ indented; false *** [fail-escaped-space] Error code 1 -make: stopped in unit-tests +make: stopped making "all" in unit-tests echo 'line1 line2'; false line1 @@ -31,7 +31,7 @@ line2 line2'; false *** [fail-newline] Error code 1 -make: stopped in unit-tests +make: stopped making "all" in unit-tests echo 'line1 line2'; false line1 line2 @@ -41,7 +41,7 @@ line1 line2 echo 'line1 line2'; false *** [fail-multiline] Error code 1 -make: stopped in unit-tests +make: stopped making "all" in unit-tests echo 'word1' 'word2'; false word1 word2 @@ -51,7 +51,7 @@ word1 word2 echo 'word1' 'word2'; false *** [fail-multiline-intention] Error code 1 -make: stopped in unit-tests +make: stopped making "all" in unit-tests *** Failed target: fail-vars *** In directory: @@ -60,5 +60,5 @@ make: stopped in unit-tests => @false c-compiler flag1 -macro="several words" *** [fail-vars] Error code 1 -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/opt-debug-errors.exp b/contrib/bmake/unit-tests/opt-debug-errors.exp index 859a431f23bb..b0685a3c7126 100644 --- a/contrib/bmake/unit-tests/opt-debug-errors.exp +++ b/contrib/bmake/unit-tests/opt-debug-errors.exp @@ -33,5 +33,5 @@ word1 word2 `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/opt-debug-file.exp b/contrib/bmake/unit-tests/opt-debug-file.exp index 8bdaca612310..aa647456baf7 100644 --- a/contrib/bmake/unit-tests/opt-debug-file.exp +++ b/contrib/bmake/unit-tests/opt-debug-file.exp @@ -3,10 +3,10 @@ make: "opt-debug-file.mk" line 47: This goes to stderr only, once. make: "opt-debug-file.mk" line 50: This goes to stderr, and in addition to the debug log. CondParser_Eval: ${:!cat opt-debug-file.debuglog!:Maddition:[#]} != 1 Comparing 1.000000 != 1.000000 -make: Missing delimiter for modifier ':S' -make: Missing delimiter for modifier ':S' -make: Missing delimiter for modifier ':S' -CondParser_Eval: ${:!cat opt-debug-file.debuglog!:Mdelimiter:[#]} != 1 +make: Unterminated quoted string [make 'This goes to stdout only, once.] +make: Unterminated quoted string [make 'This goes to stderr only, once.] +make: Unterminated quoted string [make 'This goes to stderr, and in addition to the debug log.] +CondParser_Eval: ${:!cat opt-debug-file.debuglog!:MUnterminated:[#]} != 1 Comparing 1.000000 != 1.000000 Cannot open debug file "/nonexistent-6f21c672-a22d-4ef7/opt-debug-file.debuglog" exit status 2 diff --git a/contrib/bmake/unit-tests/opt-debug-file.mk b/contrib/bmake/unit-tests/opt-debug-file.mk index e6c23c4faa1a..33a35e0a458a 100644 --- a/contrib/bmake/unit-tests/opt-debug-file.mk +++ b/contrib/bmake/unit-tests/opt-debug-file.mk @@ -1,4 +1,4 @@ -# $NetBSD: opt-debug-file.mk,v 1.10 2023/11/19 21:47:52 rillig Exp $ +# $NetBSD: opt-debug-file.mk,v 1.11 2024/06/30 15:21:24 rillig Exp $ # # Tests for the -dF command line option, which redirects the debug log # to a file instead of writing it to stderr. @@ -54,15 +54,18 @@ DEBUG_OUTPUT:= ${:!cat opt-debug-file.debuglog!} .endif -# See ApplyModifier_Subst, which calls Error. +# See Main_ParseArgLine, which calls Error. .MAKEFLAGS: -dFstdout -: This goes to stderr only, once. ${:U:S +# expect: make: Unterminated quoted string [make 'This goes to stdout only, once.] +.MAKEFLAGS: 'This goes to stdout only, once. .MAKEFLAGS: -dFstderr -: This goes to stderr only, once. ${:U:S +# expect: make: Unterminated quoted string [make 'This goes to stderr only, once.] +.MAKEFLAGS: 'This goes to stderr only, once. .MAKEFLAGS: -dFopt-debug-file.debuglog -: This goes to stderr, and in addition to the debug log. ${:U:S +# expect: make: Unterminated quoted string [make 'This goes to stderr, and in addition to the debug log.] +.MAKEFLAGS: 'This goes to stderr, and in addition to the debug log. .MAKEFLAGS: -dFstderr -d0c -.if ${:!cat opt-debug-file.debuglog!:Mdelimiter:[#]} != 1 +.if ${:!cat opt-debug-file.debuglog!:MUnterminated:[#]} != 1 . error .endif diff --git a/contrib/bmake/unit-tests/opt-debug-graph2.exp b/contrib/bmake/unit-tests/opt-debug-graph2.exp index d4182650baed..b590e7379ddb 100644 --- a/contrib/bmake/unit-tests/opt-debug-graph2.exp +++ b/contrib/bmake/unit-tests/opt-debug-graph2.exp @@ -87,5 +87,5 @@ MFLAGS = -r -k -d g2 #*** Transformations: Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/opt-debug-graph3.exp b/contrib/bmake/unit-tests/opt-debug-graph3.exp index fea3c658cb72..d1be69f89630 100644 --- a/contrib/bmake/unit-tests/opt-debug-graph3.exp +++ b/contrib/bmake/unit-tests/opt-debug-graph3.exp @@ -87,5 +87,5 @@ MFLAGS = -r -k -d g3 #*** Transformations: Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/opt-debug-hash.exp b/contrib/bmake/unit-tests/opt-debug-hash.exp index d8b60450e222..605161fa797e 100644 --- a/contrib/bmake/unit-tests/opt-debug-hash.exp +++ b/contrib/bmake/unit-tests/opt-debug-hash.exp @@ -1,6 +1,6 @@ make: "opt-debug-hash.mk" line 13: Missing argument for ".error" make: Fatal errors encountered -- cannot continue -HashTable targets: size=16 numEntries=0 maxchain=0 -HashTable Global variables: size=16 numEntries= maxchain=3 +HashTable "targets": size=16 entries=0 maxchain=0 +HashTable "Global variables": size=16 entries= maxchain=4 make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/opt-debug-lint.exp b/contrib/bmake/unit-tests/opt-debug-lint.exp index c6cd748acd5d..eea6c8db5a49 100644 --- a/contrib/bmake/unit-tests/opt-debug-lint.exp +++ b/contrib/bmake/unit-tests/opt-debug-lint.exp @@ -2,9 +2,9 @@ make: "opt-debug-lint.mk" line 21: Variable "X" is undefined make: "opt-debug-lint.mk" line 21: Malformed conditional ($X) make: "opt-debug-lint.mk" line 45: Variable "UNDEF" is undefined make: "opt-debug-lint.mk" line 45: Malformed conditional (${UNDEF}) -make: "opt-debug-lint.mk" line 67: while evaluating variable "value": Missing delimiter ':' after modifier "L" -make: "opt-debug-lint.mk" line 67: while evaluating variable "value": Missing delimiter ':' after modifier "P" -make: "opt-debug-lint.mk" line 76: while evaluating variable "value": Unknown modifier "${" +make: "opt-debug-lint.mk" line 67: while evaluating variable "value" with value "value": Missing delimiter ':' after modifier "L" +make: "opt-debug-lint.mk" line 67: while evaluating variable "value" with value "value": Missing delimiter ':' after modifier "P" +make: "opt-debug-lint.mk" line 76: while evaluating variable "value" with value "": Unknown modifier "${" make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/opt-debug-lint.mk b/contrib/bmake/unit-tests/opt-debug-lint.mk index 3e946ac6ad61..cc20694e268c 100644 --- a/contrib/bmake/unit-tests/opt-debug-lint.mk +++ b/contrib/bmake/unit-tests/opt-debug-lint.mk @@ -1,4 +1,4 @@ -# $NetBSD: opt-debug-lint.mk,v 1.17 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: opt-debug-lint.mk,v 1.18 2024/07/04 17:47:54 rillig Exp $ # # Tests for the -dL command line option, which runs additional checks # to catch common mistakes, such as unclosed expressions. @@ -62,8 +62,8 @@ ${UNDEF}: ${UNDEF} # Since 2020-10-03, in lint mode the variable modifier must be separated # by colons. See varparse-mod.mk. -# expect+2: while evaluating variable "value": Missing delimiter ':' after modifier "L" -# expect+1: while evaluating variable "value": Missing delimiter ':' after modifier "P" +# expect+2: while evaluating variable "value" with value "value": Missing delimiter ':' after modifier "L" +# expect+1: while evaluating variable "value" with value "value": Missing delimiter ':' after modifier "P" .if ${value:LPL} != "value" . error .endif @@ -72,7 +72,7 @@ ${UNDEF}: ${UNDEF} # variable modifier had to be separated by colons. This was wrong though # since make always fell back trying to parse the indirect modifier as a # SysV modifier. -# expect+1: while evaluating variable "value": Unknown modifier "${" +# expect+1: while evaluating variable "value" with value "": Unknown modifier "${" .if ${value:${:UL}PL} != "LPL}" # FIXME: "LPL}" is unexpected here. . error ${value:${:UL}PL} .endif diff --git a/contrib/bmake/unit-tests/opt-file.exp b/contrib/bmake/unit-tests/opt-file.exp index 9550958fea37..78d1bfd0df4f 100644 --- a/contrib/bmake/unit-tests/opt-file.exp +++ b/contrib/bmake/unit-tests/opt-file.exp @@ -2,9 +2,10 @@ value value line-with-trailing-whitespace make: "(stdin)" line 1: Zero byte read from file + in directory *** Error code 2 (continuing) `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/opt-keep-going-indirect.exp b/contrib/bmake/unit-tests/opt-keep-going-indirect.exp index 0c00c75395fa..4ac1b180cabd 100644 --- a/contrib/bmake/unit-tests/opt-keep-going-indirect.exp +++ b/contrib/bmake/unit-tests/opt-keep-going-indirect.exp @@ -3,14 +3,14 @@ false *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "direct" in unit-tests exited 1 direct jobs false *** [direct] Error code 1 -make: stopped in unit-tests +make: stopped making "direct" in unit-tests exited 1 indirect compat @@ -19,14 +19,14 @@ false `indirect' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "indirect" in unit-tests exited 1 indirect jobs false *** [direct] Error code 1 -make: stopped in unit-tests +make: stopped making "indirect" in unit-tests exited 1 exit status 0 diff --git a/contrib/bmake/unit-tests/opt-keep-going-multiple.exp b/contrib/bmake/unit-tests/opt-keep-going-multiple.exp index 6d1bec18977b..00f944be735e 100644 --- a/contrib/bmake/unit-tests/opt-keep-going-multiple.exp +++ b/contrib/bmake/unit-tests/opt-keep-going-multiple.exp @@ -5,5 +5,5 @@ false fail2 true succeed Stop. -make: stopped in unit-tests +make: stopped making "fail1 fail2 succeed" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/opt-keep-going.exp b/contrib/bmake/unit-tests/opt-keep-going.exp index 2dbeb9927a30..06332333d355 100644 --- a/contrib/bmake/unit-tests/opt-keep-going.exp +++ b/contrib/bmake/unit-tests/opt-keep-going.exp @@ -5,5 +5,5 @@ other 1 `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/opt-warnings-as-errors.exp b/contrib/bmake/unit-tests/opt-warnings-as-errors.exp index 87d1db249a20..8e392f9f9c6d 100644 --- a/contrib/bmake/unit-tests/opt-warnings-as-errors.exp +++ b/contrib/bmake/unit-tests/opt-warnings-as-errors.exp @@ -3,5 +3,5 @@ make: parsing warnings being treated as errors make: "opt-warnings-as-errors.mk" line 15: warning: message 2 parsing continues make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/opt.exp b/contrib/bmake/unit-tests/opt.exp index 3c96cf25025f..daeecc8ca726 100644 --- a/contrib/bmake/unit-tests/opt.exp +++ b/contrib/bmake/unit-tests/opt.exp @@ -13,7 +13,7 @@ make: don't know how to make -f (continuing) `/dev/null' is up to date. Stop. -make: stopped in unit-tests +make: stopped making "-f /dev/null" in unit-tests *** Error code 1 (ignored) make -? diff --git a/contrib/bmake/unit-tests/parse.exp b/contrib/bmake/unit-tests/parse.exp index cc8c450d51ac..b55904c4df56 100644 --- a/contrib/bmake/unit-tests/parse.exp +++ b/contrib/bmake/unit-tests/parse.exp @@ -2,5 +2,5 @@ make: "parse.mk" line 7: Invalid line '<<<<<< old' make: "parse.mk" line 14: Invalid line '>>>>>> new' make: "parse.mk" line 25: Invalid line 'one-target ${:U }', expanded to 'one-target ' make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "Try_to_crash_FreeBSD.xxxxxxxxxxxxxxxxxx" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/posix.exp b/contrib/bmake/unit-tests/posix.exp index 01961f363f59..3af8361b1193 100644 --- a/contrib/bmake/unit-tests/posix.exp +++ b/contrib/bmake/unit-tests/posix.exp @@ -22,5 +22,5 @@ Now we expect an error... `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/sh-jobs.exp b/contrib/bmake/unit-tests/sh-jobs.exp index ef0c574fceed..25568145c049 100644 --- a/contrib/bmake/unit-tests/sh-jobs.exp +++ b/contrib/bmake/unit-tests/sh-jobs.exp @@ -2,5 +2,5 @@ comment-with-followup-line: This is printed. no-comment: This is printed. *** [no-comment] Error code 1 -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/suff-add-later.exp b/contrib/bmake/unit-tests/suff-add-later.exp index 663016a672c1..ee19c851d57a 100644 --- a/contrib/bmake/unit-tests/suff-add-later.exp +++ b/contrib/bmake/unit-tests/suff-add-later.exp @@ -17,5 +17,5 @@ make: don't know how to make issue5e.d (continuing) `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/suff-clear-regular.exp b/contrib/bmake/unit-tests/suff-clear-regular.exp index 75db9b47a55b..a14c722f35bb 100644 --- a/contrib/bmake/unit-tests/suff-clear-regular.exp +++ b/contrib/bmake/unit-tests/suff-clear-regular.exp @@ -4,5 +4,5 @@ make: don't know how to make .b.a (continuing) `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/suff-clear-single.exp b/contrib/bmake/unit-tests/suff-clear-single.exp index aa46ac75f6da..3a187abca478 100644 --- a/contrib/bmake/unit-tests/suff-clear-single.exp +++ b/contrib/bmake/unit-tests/suff-clear-single.exp @@ -2,5 +2,5 @@ make: don't know how to make issue3 (continuing) `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/suff-main-several.exp b/contrib/bmake/unit-tests/suff-main-several.exp index 8aa1ff4bf17d..99585102029e 100644 --- a/contrib/bmake/unit-tests/suff-main-several.exp +++ b/contrib/bmake/unit-tests/suff-main-several.exp @@ -137,5 +137,5 @@ make: don't know how to make suff-main-several.4 (continuing) `next-main' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "next-main" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/suff-self.exp b/contrib/bmake/unit-tests/suff-self.exp index 6192c508ab96..2fb3ac493513 100644 --- a/contrib/bmake/unit-tests/suff-self.exp +++ b/contrib/bmake/unit-tests/suff-self.exp @@ -2,5 +2,5 @@ make: Graph cycles through suff-self.suff `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/suff-transform-endless.exp b/contrib/bmake/unit-tests/suff-transform-endless.exp index 620c46626e22..552d77355939 100644 --- a/contrib/bmake/unit-tests/suff-transform-endless.exp +++ b/contrib/bmake/unit-tests/suff-transform-endless.exp @@ -42,5 +42,5 @@ make: Graph cycles through issue6.f `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/suff-transform-expand.exp b/contrib/bmake/unit-tests/suff-transform-expand.exp index c1821852707d..5ad429b8a852 100644 --- a/contrib/bmake/unit-tests/suff-transform-expand.exp +++ b/contrib/bmake/unit-tests/suff-transform-expand.exp @@ -4,5 +4,5 @@ make: don't know how to make .first (continuing) `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/suff-transform-select.exp b/contrib/bmake/unit-tests/suff-transform-select.exp index 29065154c891..df852a603a99 100644 --- a/contrib/bmake/unit-tests/suff-transform-select.exp +++ b/contrib/bmake/unit-tests/suff-transform-select.exp @@ -43,5 +43,5 @@ make: don't know how to make issue10.e (continuing) `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/suff-use.exp b/contrib/bmake/unit-tests/suff-use.exp index 4a9374d8e156..ea6a20ece9e7 100644 --- a/contrib/bmake/unit-tests/suff-use.exp +++ b/contrib/bmake/unit-tests/suff-use.exp @@ -3,5 +3,5 @@ make: don't know how to make demo.o (continuing) `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/use-inference.exp b/contrib/bmake/unit-tests/use-inference.exp index 135deabc918e..12ed67354edd 100644 --- a/contrib/bmake/unit-tests/use-inference.exp +++ b/contrib/bmake/unit-tests/use-inference.exp @@ -3,5 +3,5 @@ make: don't know how to make use-inference.to (continuing) `all' not remade because of errors. Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/var-eval-short.exp b/contrib/bmake/unit-tests/var-eval-short.exp index 4b553857df29..12e2b78d7a3d 100644 --- a/contrib/bmake/unit-tests/var-eval-short.exp +++ b/contrib/bmake/unit-tests/var-eval-short.exp @@ -1,4 +1,4 @@ -make: "var-eval-short.mk" line 46: while evaluating "${:Uword:@${FAIL}@expr@}": In the :@ modifier, the variable name "${FAIL}" must not contain a dollar +make: "var-eval-short.mk" line 46: while parsing "${:Uword:@${FAIL}@expr@}": In the :@ modifier, the variable name "${FAIL}" must not contain a dollar make: "var-eval-short.mk" line 46: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@}) Parsing line 159: .if 0 && ${0:?${FAIL}then:${FAIL}else} CondParser_Eval: 0 && ${0:?${FAIL}then:${FAIL}else} @@ -27,5 +27,5 @@ ParseDependency(.MAKEFLAGS: -d0) Global: .MAKEFLAGS = -r -k -d cpv -d Global: .MAKEFLAGS = -r -k -d cpv -d 0 make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/var-eval-short.mk b/contrib/bmake/unit-tests/var-eval-short.mk index 5a42335a4474..d6872d158e32 100644 --- a/contrib/bmake/unit-tests/var-eval-short.mk +++ b/contrib/bmake/unit-tests/var-eval-short.mk @@ -1,4 +1,4 @@ -# $NetBSD: var-eval-short.mk,v 1.12 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: var-eval-short.mk,v 1.14 2024/07/05 20:01:52 rillig Exp $ # # Tests for each variable modifier to ensure that they only do the minimum # necessary computations. If the result of the expression is irrelevant, @@ -41,7 +41,7 @@ FAIL= ${:!echo unexpected 1>&2!} # after the loop, when undefining the temporary global loop variable. # Since var.c 1.907 from 2021-04-04, a '$' is no longer allowed in the # variable name. -# expect+2: while evaluating "${:Uword:@${FAIL}@expr@}": In the :@ modifier, the variable name "${FAIL}" must not contain a dollar +# expect+2: while parsing "${:Uword:@${FAIL}@expr@}": In the :@ modifier, the variable name "${FAIL}" must not contain a dollar # expect+1: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@}) .if 0 && ${:Uword:@${FAIL}@expr@} .endif diff --git a/contrib/bmake/unit-tests/var-op-assign.exp b/contrib/bmake/unit-tests/var-op-assign.exp index 5fad47ca67c4..de88eac21d0c 100644 --- a/contrib/bmake/unit-tests/var-op-assign.exp +++ b/contrib/bmake/unit-tests/var-op-assign.exp @@ -2,5 +2,5 @@ this will be evaluated later make: "var-op-assign.mk" line 60: Invalid line 'VARIABLE NAME= variable value' make: "var-op-assign.mk" line 95: Parsing still continues until here. make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/var-op-expand.exp b/contrib/bmake/unit-tests/var-op-expand.exp index 0eafc9ae4c39..63d74f313737 100644 --- a/contrib/bmake/unit-tests/var-op-expand.exp +++ b/contrib/bmake/unit-tests/var-op-expand.exp @@ -1,7 +1,7 @@ -make: "var-op-expand.mk" line 274: while evaluating variable "indirect": while evaluating variable "later": Unknown modifier "s,value,replaced," +make: "var-op-expand.mk" line 274: while evaluating variable "indirect" with value "${later:s,value,replaced,} ok ${later:value=sysv}": while evaluating variable "later" with value "": Unknown modifier "s,value,replaced," make: "var-op-expand.mk" line 278: warning: XXX Neither branch should be taken. -make: "var-op-expand.mk" line 283: while evaluating variable "indirect": while evaluating variable "later": Unknown modifier "s,value,replaced," +make: "var-op-expand.mk" line 283: while evaluating variable "indirect" with value "${later:s,value,replaced,} ok ${later:value=sysv}": while evaluating variable "later" with value "lowercase-value": Unknown modifier "s,value,replaced," make: "var-op-expand.mk" line 285: warning: XXX Neither branch should be taken. make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/var-op-expand.mk b/contrib/bmake/unit-tests/var-op-expand.mk index fb1e6d2c390f..a2ae8b0e22d1 100644 --- a/contrib/bmake/unit-tests/var-op-expand.mk +++ b/contrib/bmake/unit-tests/var-op-expand.mk @@ -1,4 +1,4 @@ -# $NetBSD: var-op-expand.mk,v 1.20 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: var-op-expand.mk,v 1.21 2024/07/04 17:47:54 rillig Exp $ # # Tests for the := variable assignment operator, which expands its # right-hand side. @@ -270,7 +270,7 @@ later= lowercase-value .undef later INDIRECT:= ${LATER:S,value,replaced,} OK ${LATER:value=sysv} indirect:= ${INDIRECT:tl} -# expect+1: while evaluating variable "indirect": while evaluating variable "later": Unknown modifier "s,value,replaced," +# expect+1: while evaluating variable "indirect" with value "${later:s,value,replaced,} ok ${later:value=sysv}": while evaluating variable "later" with value "": Unknown modifier "s,value,replaced," .if ${indirect} != " ok " . error .else @@ -279,7 +279,7 @@ indirect:= ${INDIRECT:tl} .endif LATER= uppercase-value later= lowercase-value -# expect+1: while evaluating variable "indirect": while evaluating variable "later": Unknown modifier "s,value,replaced," +# expect+1: while evaluating variable "indirect" with value "${later:s,value,replaced,} ok ${later:value=sysv}": while evaluating variable "later" with value "lowercase-value": Unknown modifier "s,value,replaced," .if ${indirect} != "uppercase-replaced ok uppercase-sysv" # expect+1: warning: XXX Neither branch should be taken. . warning XXX Neither branch should be taken. diff --git a/contrib/bmake/unit-tests/var-op-shell.exp b/contrib/bmake/unit-tests/var-op-shell.exp index 0837cd4f832e..952af6df5518 100644 --- a/contrib/bmake/unit-tests/var-op-shell.exp +++ b/contrib/bmake/unit-tests/var-op-shell.exp @@ -1,8 +1,8 @@ -make: "var-op-shell.mk" line 32: warning: "echo "failed"; false" returned non-zero status -make: "var-op-shell.mk" line 39: warning: "false" returned non-zero status +make: "var-op-shell.mk" line 32: warning: Command "echo "failed"; (exit 13)" exited with status 13 +make: "var-op-shell.mk" line 39: warning: Command "exit 13" exited with status 13 make: "var-op-shell.mk" line 62: warning: "kill $$" exited on a signal /bin/no/such/command: not found -make: "var-op-shell.mk" line 69: warning: "/bin/no/such/command" returned non-zero status +make: "var-op-shell.mk" line 69: warning: Command "/bin/no/such/command" exited with status 127 stderr Capturing the output of command "echo '$$$$'" Global: OUTPUT = $$$$ diff --git a/contrib/bmake/unit-tests/var-op-shell.mk b/contrib/bmake/unit-tests/var-op-shell.mk index 4441efaf4a90..bfc2e4f1361d 100644 --- a/contrib/bmake/unit-tests/var-op-shell.mk +++ b/contrib/bmake/unit-tests/var-op-shell.mk @@ -1,4 +1,4 @@ -# $NetBSD: var-op-shell.mk,v 1.8 2024/01/05 23:36:45 rillig Exp $ +# $NetBSD: var-op-shell.mk,v 1.10 2024/07/11 20:09:16 sjg Exp $ # # Tests for the != variable assignment operator, which runs its right-hand # side through the shell. @@ -28,15 +28,15 @@ OUTPUT!= true # '::!=', expression modifier ':!...!'), a failed command generates only a # warning, not an "error". These "errors" are ignored in default mode, for # compatibility, but not in lint mode (-dL). -# expect+1: warning: "echo "failed"; false" returned non-zero status -OUTPUT!= echo "failed"; false +# expect+1: warning: Command "echo "failed"; (exit 13)" exited with status 13 +OUTPUT!= echo "failed"; (exit 13) .if ${OUTPUT} != "failed" . error .endif # A command with empty output may fail as well. -# expect+1: warning: "false" returned non-zero status -OUTPUT!= false +# expect+1: warning: Command "exit 13" exited with status 13 +OUTPUT!= exit 13 .if ${OUTPUT} != "" . error .endif @@ -50,7 +50,7 @@ OUTPUT!= echo "line 1"; echo "line 2" # A failing command in the middle results in the exit status 0, which in the # end means that the whole sequence of commands succeeded. -OUTPUT!= echo "before"; false; echo "after" +OUTPUT!= echo "before"; (exit 13); echo "after" .if ${OUTPUT} != "before after" . error .endif @@ -65,7 +65,7 @@ OUTPUT!= kill $$$$ .endif # A nonexistent command produces a non-zero exit status. -# expect+1: warning: "/bin/no/such/command" returned non-zero status +# expect+1: warning: Command "/bin/no/such/command" exited with status 127 OUTPUT!= /bin/no/such/command .if ${OUTPUT} != "" . error @@ -99,7 +99,7 @@ OUTPUT_SHORT!= echo "$$0" OUTPUT_LONG!= echo "$$0" || : ${:U:range=1000} # When running '$shell -c $command', '$0' in the shell evaluates to the name # of the shell. -.if ${OUTPUT_SHORT} != ${.SHELL:T} +.if ${OUTPUT_SHORT:T} != ${.SHELL:T} . error .endif # When running '$shell $tmpfile', '$0' in the shell evaluates to the name of diff --git a/contrib/bmake/unit-tests/var-recursive.exp b/contrib/bmake/unit-tests/var-recursive.exp index 5415dc93a53d..c92c22b125dc 100644 --- a/contrib/bmake/unit-tests/var-recursive.exp +++ b/contrib/bmake/unit-tests/var-recursive.exp @@ -1,19 +1,22 @@ make: "var-recursive.mk" line 21: still there make: Variable DIRECT is recursive. in var-recursive.mk:22 + in directory make: stopped in unit-tests make: Variable INDIRECT1 is recursive. in var-recursive.mk:29 + in directory make: stopped in unit-tests make: "var-recursive.mk" line 37: ok make: Variable V is recursive. in var-recursive.mk:45 + in directory make: stopped in unit-tests : OK In a command near "var-recursive.mk" line 57: make[1]: Variable VAR is recursive. -make: stopped in unit-tests +make: stopped making "target" in unit-tests exit status 0 diff --git a/contrib/bmake/unit-tests/vardebug.exp b/contrib/bmake/unit-tests/vardebug.exp index 86f2ac0b420d..9937185ae807 100644 --- a/contrib/bmake/unit-tests/vardebug.exp +++ b/contrib/bmake/unit-tests/vardebug.exp @@ -54,7 +54,7 @@ Var_Parse: ${:Uvariable:unknown} (eval-defined) Evaluating modifier ${:U...} on value "" (eval-defined, undefined) Result of ${:Uvariable} is "variable" (eval-defined, defined) Evaluating modifier ${:u...} on value "variable" (eval-defined, defined) -make: "vardebug.mk" line 63: while evaluating "${:Uvariable:unknown}": Unknown modifier "unknown" +make: "vardebug.mk" line 63: while evaluating "${:Uvariable:unknown}" with value "variable": Unknown modifier "unknown" Result of ${:unknown} is error (eval-defined, defined) make: "vardebug.mk" line 63: Malformed conditional (${:Uvariable:unknown}) Var_Parse: ${UNDEFINED} (eval-defined) diff --git a/contrib/bmake/unit-tests/vardebug.mk b/contrib/bmake/unit-tests/vardebug.mk index 6c5703cb526f..7e6154d7e52c 100644 --- a/contrib/bmake/unit-tests/vardebug.mk +++ b/contrib/bmake/unit-tests/vardebug.mk @@ -1,4 +1,4 @@ -# $NetBSD: vardebug.mk,v 1.10 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: vardebug.mk,v 1.11 2024/07/05 19:47:22 rillig Exp $ # # Demonstrates the debugging output for var.c. @@ -59,7 +59,7 @@ VAR+= 3 # as "is error", without surrounding quotes. # expect: Result of ${:unknown} is error (eval-defined, defined) # expect+2: Malformed conditional (${:Uvariable:unknown}) -# expect+1: while evaluating "${:Uvariable:unknown}": Unknown modifier "unknown" +# expect+1: while evaluating "${:Uvariable:unknown}" with value "variable": Unknown modifier "unknown" .if ${:Uvariable:unknown} .endif diff --git a/contrib/bmake/unit-tests/varmisc.exp b/contrib/bmake/unit-tests/varmisc.exp index dd24a419fe75..5e63f9f6563a 100644 --- a/contrib/bmake/unit-tests/varmisc.exp +++ b/contrib/bmake/unit-tests/varmisc.exp @@ -50,8 +50,8 @@ make: in target "varerror-unclosed": Unclosed variable "UNCLOSED" make: in target "varerror-unclosed": Unclosed variable "UNCLOSED" -make: in target "varerror-unclosed": while evaluating variable "UNCLOSED": Unclosed variable "PATTERN" -make: Unclosed expression, expecting '}' for modifier "M${PATTERN" of variable "UNCLOSED" with value "" +make: in target "varerror-unclosed": while evaluating variable "UNCLOSED" with value "": Unclosed variable "PATTERN" +make: in target "varerror-unclosed": while evaluating variable "UNCLOSED" with value "": Unclosed expression, expecting '}' for modifier "M${PATTERN" make: in target "varerror-unclosed": Unclosed variable "param" make: in target "varerror-unclosed": Unclosed variable "UNCLOSED." @@ -63,9 +63,9 @@ make: in target "varerror-unclosed": Unclosed variable "UNCLOSED.2" make: in target "varerror-unclosed": Unclosed variable "UNCLOSED.3" -make: in target "varerror-unclosed": while evaluating variable "UNCLOSED_INDIR_2": while evaluating variable "UNCLOSED_INDIR_1": Unclosed variable "UNCLOSED_ORIG" +make: in target "varerror-unclosed": while evaluating variable "UNCLOSED_INDIR_2" with value "${UNCLOSED_INDIR_1}": while evaluating variable "UNCLOSED_INDIR_1" with value "${UNCLOSED_ORIG": Unclosed variable "UNCLOSED_ORIG" varerror-unclosed:end target1-flags: we have: one two target2-flags: we have: one two three four -exit status 0 +exit status 2 diff --git a/contrib/bmake/unit-tests/varmisc.mk b/contrib/bmake/unit-tests/varmisc.mk index f6a0e4da2d88..94ac32812d87 100644 --- a/contrib/bmake/unit-tests/varmisc.mk +++ b/contrib/bmake/unit-tests/varmisc.mk @@ -1,5 +1,5 @@ -# $Id: varmisc.mk,v 1.26 2023/11/25 01:39:31 sjg Exp $ -# $NetBSD: varmisc.mk,v 1.33 2023/10/19 18:24:33 rillig Exp $ +# $Id: varmisc.mk,v 1.27 2024/07/06 18:23:18 sjg Exp $ +# $NetBSD: varmisc.mk,v 1.35 2024/07/05 18:59:33 rillig Exp $ # # Miscellaneous variable tests. @@ -191,13 +191,22 @@ target2-flags: target2.c varerror-unclosed: @echo $@:begin +# expect: make: in target "varerror-unclosed": Unclosed variable "" @echo $( +# expect: make: in target "varerror-unclosed": Unclosed variable "UNCLOSED" @echo $(UNCLOSED +# expect: make: in target "varerror-unclosed": Unclosed variable "UNCLOSED" @echo ${UNCLOSED +# expect: make: in target "varerror-unclosed": while evaluating variable "UNCLOSED" with value "": Unclosed expression, expecting '}' for modifier "M${PATTERN" @echo ${UNCLOSED:M${PATTERN +# expect: make: in target "varerror-unclosed": Unclosed variable "param" +# expect: make: in target "varerror-unclosed": Unclosed variable "UNCLOSED." @echo ${UNCLOSED.${param @echo $ .for i in 1 2 3 +# expect: make: in target "varerror-unclosed": Unclosed variable "UNCLOSED.1" +# expect: make: in target "varerror-unclosed": Unclosed variable "UNCLOSED.2" +# expect: make: in target "varerror-unclosed": Unclosed variable "UNCLOSED.3" @echo ${UNCLOSED.${i} .endfor @echo ${UNCLOSED_INDIR_2} diff --git a/contrib/bmake/unit-tests/varmod-assign-shell.exp b/contrib/bmake/unit-tests/varmod-assign-shell.exp index b7c6cd223f24..819fa6a5f304 100644 --- a/contrib/bmake/unit-tests/varmod-assign-shell.exp +++ b/contrib/bmake/unit-tests/varmod-assign-shell.exp @@ -1,11 +1,11 @@ -make: "varmod-assign-shell.mk" line 28: warning: "echo output; false" returned non-zero status +make: "varmod-assign-shell.mk" line 21: warning: Command "echo output; (exit 13)" exited with status 13 Global: _ = # (empty) -Var_Parse: ${ASSIGNED::!=echo output; ${:Ufalse}} (eval-keep-dollar-and-undefined) +Var_Parse: ${ASSIGNED::!=echo output; ${:U(exit 13)}} (eval-keep-dollar-and-undefined) Evaluating modifier ${ASSIGNED::...} on value "previous" (eval-keep-dollar-and-undefined, regular) -Modifier part: "echo output; false" -Capturing the output of command "echo output; false" -make: "echo output; false" returned non-zero status -Result of ${ASSIGNED::!=echo output; ${:Ufalse}} is "" (eval-keep-dollar-and-undefined, regular) +Modifier part: "echo output; (exit 13)" +Capturing the output of command "echo output; (exit 13)" +make: "varmod-assign-shell.mk" line 26: warning: while evaluating variable "ASSIGNED" with value "previous": Command "echo output; (exit 13)" exited with status 13 +Result of ${ASSIGNED::!=echo output; ${:U(exit 13)}} is "" (eval-keep-dollar-and-undefined, regular) Global: _ = # (empty) Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 diff --git a/contrib/bmake/unit-tests/varmod-assign-shell.mk b/contrib/bmake/unit-tests/varmod-assign-shell.mk index 6158bac14eaa..0b3e553055b3 100644 --- a/contrib/bmake/unit-tests/varmod-assign-shell.mk +++ b/contrib/bmake/unit-tests/varmod-assign-shell.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-assign-shell.mk,v 1.5 2023/06/01 20:56:35 rillig Exp $ +# $NetBSD: varmod-assign-shell.mk,v 1.8 2024/07/04 17:47:54 rillig Exp $ # # Tests for the variable modifier '::!=', which assigns the output of a shell # command to the variable, but only if the command exited successfully. This @@ -15,21 +15,15 @@ # error message instead of the command that was executed. That's where the # counterintuitive error message 'make: "previous" returned non-zero status' # comes from. -# -# BUGS -# Even though the variable modifier '::!=' produces an error message, -# the exit status of make is still 0. -# -# Having an error message instead of a warning like for the variable -# assignment operator '!=' is another unnecessary inconsistency. DIRECT= previous -# expect+1: warning: "echo output; false" returned non-zero status -DIRECT!= echo output; false +# expect+1: warning: Command "echo output; (exit 13)" exited with status 13 +DIRECT!= echo output; (exit 13) ASSIGNED= previous -.MAKEFLAGS: -dv # to see the actual command -_:= ${ASSIGNED::!=echo output; ${:Ufalse}} +.MAKEFLAGS: -dv # to see the "Capturing" debug output +# expect+1: warning: while evaluating variable "ASSIGNED" with value "previous": Command "echo output; (exit 13)" exited with status 13 +_:= ${ASSIGNED::!=echo output; ${:U(exit 13)}} .MAKEFLAGS: -d0 all: diff --git a/contrib/bmake/unit-tests/varmod-assign.exp b/contrib/bmake/unit-tests/varmod-assign.exp index db1fa64c8479..6c8bfb5cd6e8 100644 --- a/contrib/bmake/unit-tests/varmod-assign.exp +++ b/contrib/bmake/unit-tests/varmod-assign.exp @@ -37,18 +37,18 @@ Global: .MAKEOVERRIDES = FIRST LAST LAST LAST APPENDED RAN RAN RAN IT1 THEN1 IE Result of ${CMD_NEW_VAR::=new-value} is "" (eval, undefined) Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d 0 -make: Bad modifier ":" for variable "" +make: in target "mod-assign-empty": while evaluating "${::=value}" with value "": Bad modifier ":" mod-assign-empty: value} -make: Bad modifier ":" for variable "" +make: in target "mod-assign-empty": while evaluating "${:Uvalue::=overwritten}" with value "value": Bad modifier ":" mod-assign-empty: overwritten} mod-assign-empty: VAR=overwritten -make: in target "mod-assign-parse": while evaluating variable "ASSIGN": Unknown modifier ":x" +make: in target "mod-assign-parse": while evaluating variable "ASSIGN" with value "": Unknown modifier ":x" sysv:y -make: Unfinished modifier for "ASSIGN" ('}' missing) +make: in target "mod-assign-parse": while evaluating variable "ASSIGN" with value "": Unfinished modifier ('}' missing) ok=word -make: " echo word; false " returned non-zero status +make: warning: in target "mod-assign-shell-error": while evaluating variable "SH_ERR" with value "previous": Command " echo word; (exit 13) " exited with status 13 err=previous Command: TARGET_CMD_VAR = cmd-value Global: TARGET_GLOBAL_VAR = global-value @@ -57,4 +57,4 @@ target: TARGET_TARGET_VAR = new-value Global: TARGET_GLOBAL_VAR = new-value Global: TARGET_ENV_VAR = new-value target: TARGET_NEW_VAR = new-value -exit status 0 +exit status 2 diff --git a/contrib/bmake/unit-tests/varmod-assign.mk b/contrib/bmake/unit-tests/varmod-assign.mk index 17d9df764be1..ee1c86c039f5 100644 --- a/contrib/bmake/unit-tests/varmod-assign.mk +++ b/contrib/bmake/unit-tests/varmod-assign.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-assign.mk,v 1.20 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: varmod-assign.mk,v 1.23 2024/07/04 17:47:54 rillig Exp $ # # Tests for the obscure ::= variable modifiers, which perform variable # assignments during evaluation, just like the = operator in C. @@ -90,13 +90,14 @@ mod-assign-empty: mod-assign-parse: # The modifier for assignment operators starts with a ':'. # An 'x' after that is an invalid modifier. - # expect: make: in target "mod-assign-parse": while evaluating variable "ASSIGN": Unknown modifier ":x" + # expect: make: in target "mod-assign-parse": while evaluating variable "ASSIGN" with value "": Unknown modifier ":x" @echo ${ASSIGN::x} # When parsing an assignment operator fails because the operator is # incomplete, make falls back to the SysV modifier. @echo ${SYSV::=sysv\:x}${SYSV::x=:y} +# expect: make: in target "mod-assign-parse": while evaluating variable "ASSIGN" with value "": Unfinished modifier ('}' missing) @echo ${ASSIGN::=value # missing closing brace mod-assign-shell-error: @@ -105,7 +106,7 @@ mod-assign-shell-error: # If the command fails, the variable keeps its previous value. @${SH_ERR::=previous} - @${SH_ERR::!= echo word; false } echo err=${SH_ERR} + @${SH_ERR::!= echo word; (exit 13) } echo err=${SH_ERR} # XXX: The ::= modifier expands its right-hand side exactly once. # This differs subtly from normal assignments such as '+=' or '=', which copy diff --git a/contrib/bmake/unit-tests/varmod-edge.exp b/contrib/bmake/unit-tests/varmod-edge.exp index fad5cb2c3c94..ff4f73d30939 100644 --- a/contrib/bmake/unit-tests/varmod-edge.exp +++ b/contrib/bmake/unit-tests/varmod-edge.exp @@ -1,27 +1,12 @@ -make: "varmod-edge.mk" line 184: ok M-paren -make: "varmod-edge.mk" line 184: ok M-mixed -make: "varmod-edge.mk" line 184: ok M-unescape -make: Unclosed expression, expecting '}' for modifier "U*)" of variable "" with value "*)" -make: "varmod-edge.mk" line 184: ok M-nest-mix -make: "varmod-edge.mk" line 184: ok M-nest-brk -make: "varmod-edge.mk" line 184: ok M-pat-err -make: "varmod-edge.mk" line 184: ok M-bsbs -make: "varmod-edge.mk" line 184: ok M-bs1-par -make: "varmod-edge.mk" line 184: ok M-bs2-par -make: "varmod-edge.mk" line 184: ok M-128 -make: "varmod-edge.mk" line 184: ok eq-ext -make: "varmod-edge.mk" line 184: ok eq-q -make: "varmod-edge.mk" line 184: ok eq-bs -make: Unfinished modifier for "INP.eq-esc" ('=' missing) -make: "varmod-edge.mk" line 184: ok eq-esc -make: "varmod-edge.mk" line 184: ok colon -make: "varmod-edge.mk" line 167: while evaluating variable "MOD.colons": while evaluating variable "INP.colons": Unknown modifier ":" -make: "varmod-edge.mk" line 167: while evaluating variable "MOD.colons": while evaluating variable "INP.colons": Unknown modifier ":" -make: "varmod-edge.mk" line 184: ok colons -make: "varmod-edge.mk" line 195: while evaluating "${:Z}": Unknown modifier "Z" -make: "varmod-edge.mk" line 195: Malformed conditional (${:Z}) -make: Unfinished modifier for "" (',' missing) -make: "varmod-edge.mk" line 209: Malformed conditional (${:S,}) +make: "varmod-edge.mk" line 60: while evaluating variable "MOD" with value "${INP:M${:U*)}}": while evaluating variable "INP" with value "(parentheses)": while evaluating "${:U*)" with value "*)": Unclosed expression, expecting '}' for modifier "U*)" +make: "varmod-edge.mk" line 88: while evaluating variable "MOD" with value "${INP:M${:U[[}}": while evaluating variable "INP" with value "[ [[ [[[": Unfinished character list in pattern '[[' of modifier ':M' +make: "varmod-edge.mk" line 178: while evaluating variable "MOD" with value "${INP:a\=b}": while evaluating variable "INP" with value "file.c file...": Unfinished modifier ('=' missing) +make: "varmod-edge.mk" line 194: while evaluating variable "MOD" with value "${INP::::}": while evaluating variable "INP" with value "value": Unknown modifier ":" +make: "varmod-edge.mk" line 194: while evaluating variable "MOD" with value "${INP::::}": while evaluating variable "INP" with value "": Unknown modifier ":" +make: "varmod-edge.mk" line 203: while evaluating "${:Z}" with value "": Unknown modifier "Z" +make: "varmod-edge.mk" line 203: Malformed conditional (${:Z}) +make: "varmod-edge.mk" line 217: while evaluating "${:S,}" with value "": Unfinished modifier (',' missing) +make: "varmod-edge.mk" line 217: Malformed conditional (${:S,}) make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-edge.mk b/contrib/bmake/unit-tests/varmod-edge.mk index 2f8f8c793de1..77c080ef3e5f 100644 --- a/contrib/bmake/unit-tests/varmod-edge.mk +++ b/contrib/bmake/unit-tests/varmod-edge.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-edge.mk,v 1.20 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: varmod-edge.mk,v 1.29 2024/07/09 17:07:23 rillig Exp $ # # Tests for edge cases in variable modifiers. # @@ -10,19 +10,23 @@ # - MOD, the expression for testing the modifier # - EXP, the expected output -TESTS+= M-paren -INP.M-paren= (parentheses) {braces} (opening closing) () -MOD.M-paren= ${INP.M-paren:M(*)} -EXP.M-paren= (parentheses) () +INP= (parentheses) {braces} (opening closing) () +MOD= ${INP:M(*)} +EXP= (parentheses) () +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # The first closing brace matches the opening parenthesis. # The second closing brace actually ends the expression. # # XXX: This is unexpected but rarely occurs in practice. -TESTS+= M-mixed -INP.M-mixed= (paren-brace} ( -MOD.M-mixed= ${INP.M-mixed:M(*}} -EXP.M-mixed= (paren-brace} +INP= (paren-brace} ( +MOD= ${INP:M(*}} +EXP= (paren-brace} +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # After the :M modifier has parsed the pattern, only the closing brace # and the colon are unescaped. The other characters are left as-is. @@ -31,10 +35,12 @@ EXP.M-mixed= (paren-brace} # Str_Match. # # XXX: This is unexpected. The opening brace should also be unescaped. -TESTS+= M-unescape -INP.M-unescape= ({}): \(\{\}\)\: \(\{}\): -MOD.M-unescape= ${INP.M-unescape:M\\(\\{\\}\\)\\:} -EXP.M-unescape= \(\{}\): +INP= ({}): \(\{\}\)\: \(\{}\): +MOD= ${INP:M\\(\\{\\}\\)\\:} +EXP= \(\{}\): +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # When the :M and :N modifiers are parsed, the pattern finishes as soon # as open_parens + open_braces == closing_parens + closing_braces. This @@ -47,50 +53,59 @@ EXP.M-unescape= \(\{}\): # The final brace in the output comes from the end of M.nest-mix. # # XXX: This is unexpected but rarely occurs in practice. -TESTS+= M-nest-mix -INP.M-nest-mix= (parentheses) -MOD.M-nest-mix= ${INP.M-nest-mix:M${:U*)}} -EXP.M-nest-mix= (parentheses)} -# make: Unclosed expression, expecting '}' for modifier "U*)" of variable "" with value "*)" +INP= (parentheses) +MOD= ${INP:M${:U*)}} +EXP= (parentheses)} +# expect+1: while evaluating variable "MOD" with value "${INP:M${:U*)}}": while evaluating variable "INP" with value "(parentheses)": while evaluating "${:U*)" with value "*)": Unclosed expression, expecting '}' for modifier "U*)" +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif + # In contrast to parentheses and braces, the brackets are not counted -# when the :M modifier is parsed since Makefile variables only take the +# when the :M modifier is parsed since Makefile expressions only take the # ${VAR} or $(VAR) forms, but not $[VAR]. # # The final ] in the pattern is needed to close the character class. -TESTS+= M-nest-brk -INP.M-nest-brk= [ [[ [[[ -MOD.M-nest-brk= ${INP.M-nest-brk:M${:U[[[[[]}} -EXP.M-nest-brk= [ +INP= [ [[ [[[ +MOD= ${INP:M${:U[[[[[]}} +EXP= [ +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif + # The pattern in the nested variable has an unclosed character class. -# No error is reported though, and the pattern is closed implicitly. # -# XXX: It is unexpected that no error is reported. -# See str.c, function Str_Match. +# Before str.c 1.104 from 2024-07-06, no error was reported. # # Before 2019-12-02, this test case triggered an out-of-bounds read # in Str_Match. -TESTS+= M-pat-err -INP.M-pat-err= [ [[ [[[ -MOD.M-pat-err= ${INP.M-pat-err:M${:U[[}} -EXP.M-pat-err= [ +INP= [ [[ [[[ +MOD= ${INP:M${:U[[}} +EXP= [ +# expect+1: while evaluating variable "MOD" with value "${INP:M${:U[[}}": while evaluating variable "INP" with value "[ [[ [[[": Unfinished character list in pattern '[[' of modifier ':M' +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # The first backslash does not escape the second backslash. # Therefore, the second backslash escapes the parenthesis. # This means that the pattern ends there. -# The final } in the output comes from the end of MOD.M-bsbs. +# The final } in the output comes from the end of MOD. # # If the first backslash were to escape the second backslash, the first -# closing brace would match the opening parenthesis (see M-mixed), and +# closing brace would match the opening parenthesis (see paren-brace), and # the second closing brace would be needed to close the variable. # After that, the remaining backslash would escape the parenthesis in # the pattern, therefore (} would match. -TESTS+= M-bsbs -INP.M-bsbs= (} \( \(} -MOD.M-bsbs= ${INP.M-bsbs:M\\(}} -EXP.M-bsbs= \(} -#EXP.M-bsbs= (} # If the first backslash were to escape ... +INP= (} \( \(} +MOD= ${INP:M\\(}} +EXP= \(} +#EXP= (} # If the first backslash were to escape ... +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # The backslash in \( does not escape the parenthesis, therefore it # counts for the nesting level and matches with the first closing brace. @@ -99,99 +114,92 @@ EXP.M-bsbs= \(} # # The second :M in the pattern is nested between ( and }, therefore it # does not start a new modifier. -TESTS+= M-bs1-par -INP.M-bs1-par= ( (:M (:M} \( \(:M \(:M} -MOD.M-bs1-par= ${INP.M-bs1-par:M\(:M*}}} -EXP.M-bs1-par= (:M}} +INP= ( (:M (:M} \( \(:M \(:M} +MOD= ${INP:M\(:M*}}} +EXP= (:M}} +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # The double backslash is passed verbatim to the pattern matcher. # The Str_Match pattern is \\(:M*}, and there the backslash is unescaped. # Again, the ( takes place in the nesting level, and there is no way to # prevent this, no matter how many backslashes are used. -TESTS+= M-bs2-par -INP.M-bs2-par= ( (:M (:M} \( \(:M \(:M} -MOD.M-bs2-par= ${INP.M-bs2-par:M\\(:M*}}} -EXP.M-bs2-par= \(:M}} +INP= ( (:M (:M} \( \(:M \(:M} +MOD= ${INP:M\\(:M*}}} +EXP= \(:M}} +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif -# Str_Match uses a recursive algorithm for matching the * patterns. -# Make sure that it survives patterns with 128 asterisks. -# That should be enough for all practical purposes. -# To produce a stack overflow, just add more :Qs below. -TESTS+= M-128 -INP.M-128= ${:U\\:Q:Q:Q:Q:Q:Q:Q:S,\\,x,g} -PAT.M-128= ${:U\\:Q:Q:Q:Q:Q:Q:Q:S,\\,*,g} -MOD.M-128= ${INP.M-128:M${PAT.M-128}} -EXP.M-128= ${INP.M-128} +# Before str.c 1.48 from 2020-06-15, Str_Match used a recursive algorithm for +# matching the '*' patterns and did not optimize for multiple '*' in a row. +# Test a pattern with 65536 asterisks. +INP= ${:U\\:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:S,\\,x,g} +PAT= ${:U\\:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:Q:S,\\,*,g} +MOD= ${INP:M${PAT}} +EXP= ${INP} +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # This is the normal SysV substitution. Nothing surprising here. -TESTS+= eq-ext -INP.eq-ext= file.c file.cc -MOD.eq-ext= ${INP.eq-ext:%.c=%.o} -EXP.eq-ext= file.o file.cc +INP= file.c file.cc +MOD= ${INP:%.c=%.o} +EXP= file.o file.cc +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # The SysV := modifier is greedy and consumes all the modifier text # up until the closing brace or parenthesis. The :Q may look like a # modifier, but it really isn't, that's why it appears in the output. -TESTS+= eq-q -INP.eq-q= file.c file.cc -MOD.eq-q= ${INP.eq-q:%.c=%.o:Q} -EXP.eq-q= file.o:Q file.cc +INP= file.c file.cc +MOD= ${INP:%.c=%.o:Q} +EXP= file.o:Q file.cc +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # The = in the := modifier can be escaped. -TESTS+= eq-bs -INP.eq-bs= file.c file.c=%.o -MOD.eq-bs= ${INP.eq-bs:%.c\=%.o=%.ext} -EXP.eq-bs= file.c file.ext +INP= file.c file.c=%.o +MOD= ${INP:%.c\=%.o=%.ext} +EXP= file.c file.ext +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # Having only an escaped '=' results in a parse error. # The call to "pattern.lhs = ParseModifierPart" fails. -TESTS+= eq-esc -INP.eq-esc= file.c file... -MOD.eq-esc= ${INP.eq-esc:a\=b} -EXP.eq-esc= # empty -# make: Unfinished modifier for INP.eq-esc ('=' missing) +INP= file.c file... +MOD= ${INP:a\=b} +EXP= # empty +# expect+1: while evaluating variable "MOD" with value "${INP:a\=b}": while evaluating variable "INP" with value "file.c file...": Unfinished modifier ('=' missing) +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif -TESTS+= colon -INP.colon= value -MOD.colon= ${INP.colon:} -EXP.colon= value +INP= value +MOD= ${INP:} +EXP= value +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif -TESTS+= colons -INP.colons= value -MOD.colons= ${INP.colons::::} -EXP.colons= # empty - -.for test in ${TESTS} -# expect+2: while evaluating variable "MOD.colons": while evaluating variable "INP.colons": Unknown modifier ":" -# expect+1: while evaluating variable "MOD.colons": while evaluating variable "INP.colons": Unknown modifier ":" -. if ${MOD.${test}} == ${EXP.${test}} -# expect+16: ok M-paren -# expect+15: ok M-mixed -# expect+14: ok M-unescape -# expect+13: ok M-nest-mix -# expect+12: ok M-nest-brk -# expect+11: ok M-pat-err -# expect+10: ok M-bsbs -# expect+09: ok M-bs1-par -# expect+08: ok M-bs2-par -# expect+07: ok M-128 -# expect+06: ok eq-ext -# expect+05: ok eq-q -# expect+04: ok eq-bs -# expect+03: ok eq-esc -# expect+02: ok colon -# expect+01: ok colons -. info ok ${test} -. else -. warning error in ${test}: expected "${EXP.${test}}", got "${MOD.${test}}" -. endif -.endfor +INP= value +MOD= ${INP::::} +EXP= # empty +# expect+2: while evaluating variable "MOD" with value "${INP::::}": while evaluating variable "INP" with value "value": Unknown modifier ":" +# expect+1: while evaluating variable "MOD" with value "${INP::::}": while evaluating variable "INP" with value "": Unknown modifier ":" +.if ${MOD} != ${EXP} +. warning expected "${EXP}", got "${MOD}" +.endif # Even in expressions based on an unnamed variable, there may be errors. # XXX: The error message should mention the variable name of the expression, # even though that name is empty in this case. # expect+2: Malformed conditional (${:Z}) -# expect+1: while evaluating "${:Z}": Unknown modifier "Z" +# expect+1: while evaluating "${:Z}" with value "": Unknown modifier "Z" .if ${:Z} . error .else @@ -204,13 +212,10 @@ EXP.colons= # empty # variable name with quotes, leading to the rather confusing "Unfinished # modifier for (',' missing)", having two spaces in a row. # -# XXX: The error message should report the filename:lineno. +# expect+2: while evaluating "${:S,}" with value "": Unfinished modifier (',' missing) # expect+1: Malformed conditional (${:S,}) .if ${:S,} . error .else . error .endif - -all: - @echo ok diff --git a/contrib/bmake/unit-tests/varmod-gmtime.exp b/contrib/bmake/unit-tests/varmod-gmtime.exp index 1b12ead96d85..c41e96723f65 100644 --- a/contrib/bmake/unit-tests/varmod-gmtime.exp +++ b/contrib/bmake/unit-tests/varmod-gmtime.exp @@ -1,13 +1,13 @@ -make: "varmod-gmtime.mk" line 61: while evaluating "${:L:gmtime=-1} != """: Invalid time value "-1" +make: "varmod-gmtime.mk" line 61: while evaluating "${:L:gmtime=-1} != """ with value "": Invalid time value "-1" make: "varmod-gmtime.mk" line 61: Malformed conditional (${:L:gmtime=-1} != "") -make: "varmod-gmtime.mk" line 72: while evaluating "${:L:gmtime= 1} != """: Invalid time value " 1" +make: "varmod-gmtime.mk" line 72: while evaluating "${:L:gmtime= 1} != """ with value "": Invalid time value " 1" make: "varmod-gmtime.mk" line 72: Malformed conditional (${:L:gmtime= 1} != "") -make: "varmod-gmtime.mk" line 120: while evaluating "${:L:gmtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000" +make: "varmod-gmtime.mk" line 120: while evaluating "${:L:gmtime=10000000000000000000000000000000} != """ with value "": Invalid time value "10000000000000000000000000000000" make: "varmod-gmtime.mk" line 120: Malformed conditional (${:L:gmtime=10000000000000000000000000000000} != "") -make: "varmod-gmtime.mk" line 133: while evaluating "${:L:gmtime=error} != """: Invalid time value "error" +make: "varmod-gmtime.mk" line 133: while evaluating "${:L:gmtime=error} != """ with value "": Invalid time value "error" make: "varmod-gmtime.mk" line 133: Malformed conditional (${:L:gmtime=error} != "") -make: "varmod-gmtime.mk" line 144: while evaluating variable "%Y": Invalid time value "100000S,1970,bad," +make: "varmod-gmtime.mk" line 144: while evaluating variable "%Y" with value "%Y": Invalid time value "100000S,1970,bad," make: "varmod-gmtime.mk" line 144: Malformed conditional (${%Y:L:gmtime=100000S,1970,bad,} != "bad") make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-gmtime.mk b/contrib/bmake/unit-tests/varmod-gmtime.mk index db24b1680c46..a2b983508be5 100644 --- a/contrib/bmake/unit-tests/varmod-gmtime.mk +++ b/contrib/bmake/unit-tests/varmod-gmtime.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-gmtime.mk,v 1.22 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: varmod-gmtime.mk,v 1.24 2024/07/05 19:47:22 rillig Exp $ # # Tests for the :gmtime variable modifier, which formats a timestamp # using strftime(3) in UTC. @@ -56,7 +56,7 @@ # 1970. Going back 50 years in the past is not a practical use case for # make. Therefore, since var.c 1.631, negative time stamps produce a # parse error. -# expect+2: while evaluating "${:L:gmtime=-1} != """: Invalid time value "-1" +# expect+2: while evaluating "${:L:gmtime=-1} != """ with value "": Invalid time value "-1" # expect+1: Malformed conditional (${:L:gmtime=-1} != "") .if ${:L:gmtime=-1} != "" . error @@ -67,7 +67,7 @@ # Spaces were allowed before var.c 1.631 from 2020-10-31 21:40:20, not # because it would make sense but just as a side-effect from using strtoul. -# expect+2: while evaluating "${:L:gmtime= 1} != """: Invalid time value " 1" +# expect+2: while evaluating "${:L:gmtime= 1} != """ with value "": Invalid time value " 1" # expect+1: Malformed conditional (${:L:gmtime= 1} != "") .if ${:L:gmtime= 1} != "" . error @@ -115,7 +115,7 @@ # # Since var.c 1.631 from 2020-10-31, the overflow is detected and produces a # parse error. -# expect+2: while evaluating "${:L:gmtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000" +# expect+2: while evaluating "${:L:gmtime=10000000000000000000000000000000} != """ with value "": Invalid time value "10000000000000000000000000000000" # expect+1: Malformed conditional (${:L:gmtime=10000000000000000000000000000000} != "") .if ${:L:gmtime=10000000000000000000000000000000} != "" . error @@ -128,7 +128,7 @@ # stopped after the '=', and the remaining string was parsed for more variable # modifiers. Because of the unknown modifier 'e' from the 'error', the whole # variable value was discarded and thus not printed. -# expect+2: while evaluating "${:L:gmtime=error} != """: Invalid time value "error" +# expect+2: while evaluating "${:L:gmtime=error} != """ with value "": Invalid time value "error" # expect+1: Malformed conditional (${:L:gmtime=error} != "") .if ${:L:gmtime=error} != "" . error @@ -139,7 +139,7 @@ # Before var.c 1.1050 from 2023-05-09, the timestamp could be directly # followed by the next modifier, without a ':' separator. This was the same # bug as for the ':L' and ':P' modifiers. -# expect+2: while evaluating variable "%Y": Invalid time value "100000S,1970,bad," +# expect+2: while evaluating variable "%Y" with value "%Y": Invalid time value "100000S,1970,bad," # expect+1: Malformed conditional (${%Y:L:gmtime=100000S,1970,bad,} != "bad") .if ${%Y:L:gmtime=100000S,1970,bad,} != "bad" . error diff --git a/contrib/bmake/unit-tests/varmod-hash.exp b/contrib/bmake/unit-tests/varmod-hash.exp index e385c3b3ae11..55f43dbb56d8 100644 --- a/contrib/bmake/unit-tests/varmod-hash.exp +++ b/contrib/bmake/unit-tests/varmod-hash.exp @@ -1,9 +1,9 @@ -make: in target "all": while evaluating variable "12345": Unknown modifier "has" +make: in target "all": while evaluating variable "12345" with value "12345": Unknown modifier "has" 26bb0f5f 12345 -make: in target "all": while evaluating variable "12345": Unknown modifier "hasX" +make: in target "all": while evaluating variable "12345" with value "12345": Unknown modifier "hasX" -make: in target "all": while evaluating variable "12345": Unknown modifier "hashed" +make: in target "all": while evaluating variable "12345" with value "12345": Unknown modifier "hashed" -exit status 0 +exit status 2 diff --git a/contrib/bmake/unit-tests/varmod-ifelse.exp b/contrib/bmake/unit-tests/varmod-ifelse.exp index 8b9d41bd2427..c93a9ec71716 100644 --- a/contrib/bmake/unit-tests/varmod-ifelse.exp +++ b/contrib/bmake/unit-tests/varmod-ifelse.exp @@ -1,32 +1,32 @@ -make: Bad conditional expression 'bare words == "literal"' before '?bad:bad' -make: "varmod-ifelse.mk" line 28: Malformed conditional (${${:Ubare words} == "literal":?bad:bad}) -make: Bad conditional expression ' == ""' before '?bad-assign:bad-assign' -make: Bad conditional expression ' == ""' before '?bad-cond:bad-cond' -make: "varmod-ifelse.mk" line 46: Malformed conditional (${${UNDEF} == "":?bad-cond:bad-cond}) -make: Bad conditional expression '1 == == 2' before '?yes:no' -make: "varmod-ifelse.mk" line 69: Malformed conditional (${1 == == 2:?yes:no} != "") +make: "varmod-ifelse.mk" line 29: while evaluating condition "bare words == "literal"": Bad condition +make: "varmod-ifelse.mk" line 29: Malformed conditional (${${:Ubare words} == "literal":?bad:bad}) +make: "varmod-ifelse.mk" line 40: while evaluating condition " == """: Bad condition +make: "varmod-ifelse.mk" line 49: while evaluating condition " == """: Bad condition +make: "varmod-ifelse.mk" line 49: Malformed conditional (${${UNDEF} == "":?bad-cond:bad-cond}) +make: "varmod-ifelse.mk" line 73: while evaluating condition "1 == == 2": Bad condition +make: "varmod-ifelse.mk" line 73: Malformed conditional (${1 == == 2:?yes:no} != "") CondParser_Eval: "${1 == == 2:?yes:no}" != "" CondParser_Eval: 1 == == 2 Comparing 1.000000 == 0.000000 -make: Bad conditional expression '1 == == 2' before '?yes:no' +make: "varmod-ifelse.mk" line 97: while evaluating condition "1 == == 2": Bad condition Comparing "" != "" -make: "varmod-ifelse.mk" line 96: warning: Oops, the parse error should have been propagated. +make: "varmod-ifelse.mk" line 101: warning: Oops, the parse error should have been propagated. CondParser_Eval: ${ ${:U\$}{VAR} == value:?ok:bad} != "ok" CondParser_Eval: ${VAR} == value Comparing "value" == "value" Comparing "ok" != "ok" -make: "varmod-ifelse.mk" line 158: no. -make: "varmod-ifelse.mk" line 162: while evaluating variable "string == "literal" || no >= 10": Comparison with '>=' requires both operands 'no' and '10' to be numeric -make: Bad conditional expression 'string == "literal" || no >= 10' before '?yes:no' -make: "varmod-ifelse.mk" line 162: . -make: Bad conditional expression 'string == "literal" && >= 10' before '?yes:no' -make: "varmod-ifelse.mk" line 169: . -make: Bad conditional expression 'string == "literal" || >= 10' before '?yes:no' -make: "varmod-ifelse.mk" line 172: . -make: "varmod-ifelse.mk" line 180: -make: "varmod-ifelse.mk" line 183: -make: Bad conditional expression ' ' before '?true:false' -make: "varmod-ifelse.mk" line 186: <> +make: "varmod-ifelse.mk" line 163: no. +make: "varmod-ifelse.mk" line 167: while evaluating condition "string == "literal" || no >= 10": Comparison with '>=' requires both operands 'no' and '10' to be numeric +make: "varmod-ifelse.mk" line 167: while evaluating condition "string == "literal" || no >= 10": Bad condition +make: "varmod-ifelse.mk" line 167: . +make: "varmod-ifelse.mk" line 174: while evaluating condition "string == "literal" && >= 10": Bad condition +make: "varmod-ifelse.mk" line 174: . +make: "varmod-ifelse.mk" line 177: while evaluating condition "string == "literal" || >= 10": Bad condition +make: "varmod-ifelse.mk" line 177: . +make: "varmod-ifelse.mk" line 185: +make: "varmod-ifelse.mk" line 188: +make: "varmod-ifelse.mk" line 192: while evaluating condition " ": Bad condition +make: "varmod-ifelse.mk" line 192: <> CondParser_Eval: 0 && ${1:?${:Uthen0:S,}},,}:${:Uelse0:S,}},,}} != "not evaluated" CondParser_Eval: 1 && ${0:?${:Uthen1:S,}},,}:${:Uelse1:S,}},,}} != "else1" CondParser_Eval: 0 @@ -36,16 +36,18 @@ CondParser_Eval: 1 Comparing "then2" != "then2" CondParser_Eval: ${DELAYED} == "one" Comparing "two" == "one" -make: "varmod-ifelse.mk" line 282: no -CondParser_Eval: ${DELAYED} == "two" -Comparing "two" == "two" -make: "varmod-ifelse.mk" line 284: yes -CondParser_Eval: ${DELAYED} == "one" -Comparing "two" == "one" -make: "varmod-ifelse.mk" line 287: no +make: "varmod-ifelse.mk" line 288: no CondParser_Eval: ${DELAYED} == "two" Comparing "two" == "two" make: "varmod-ifelse.mk" line 290: yes +CondParser_Eval: ${DELAYED} == "one" +Comparing "two" == "one" +make: "varmod-ifelse.mk" line 293: no +CondParser_Eval: ${DELAYED} == "two" +Comparing "two" == "two" +make: "varmod-ifelse.mk" line 296: yes +make: "varmod-ifelse.mk" line 318: while evaluating then-branch of condition "1": while evaluating "${:X-then}:${:X-else}}" with value "": Unknown modifier "X-then" +make: "varmod-ifelse.mk" line 318: while evaluating else-branch of condition "1": while parsing "${:X-else}}": Unknown modifier "X-else" make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-ifelse.mk b/contrib/bmake/unit-tests/varmod-ifelse.mk index 3cb2bdf8e855..292bc076366e 100644 --- a/contrib/bmake/unit-tests/varmod-ifelse.mk +++ b/contrib/bmake/unit-tests/varmod-ifelse.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-ifelse.mk,v 1.29 2024/06/02 15:31:26 rillig Exp $ +# $NetBSD: varmod-ifelse.mk,v 1.32 2024/07/05 20:01:52 rillig Exp $ # # Tests for the ${cond:?then:else} variable modifier, which evaluates either # the then-expression or the else-expression, depending on the condition. @@ -24,6 +24,7 @@ # Evaluating the variable name lazily would require additional code in # Var_Parse and ParseVarname, it would be more useful and predictable # though. +# expect+2: while evaluating condition "bare words == "literal"": Bad condition # expect+1: Malformed conditional (${${:Ubare words} == "literal":?bad:bad}) .if ${${:Ubare words} == "literal":?bad:bad} . error @@ -35,6 +36,7 @@ # Because of the early expansion, the whole condition evaluates to # ' == ""' though, which cannot be parsed because the left-hand side looks # empty. +# expect+1: while evaluating condition " == """: Bad condition COND:= ${${UNDEF} == "":?bad-assign:bad-assign} # In a condition, undefined variables generate a "Malformed conditional" @@ -42,6 +44,7 @@ COND:= ${${UNDEF} == "":?bad-assign:bad-assign} # "Undefined variable" error message is generated. # The difference to the ':=' variable assignment is the additional # "Malformed conditional" error message. +# expect+2: while evaluating condition " == """: Bad condition # expect+1: Malformed conditional (${${UNDEF} == "":?bad-cond:bad-cond}) .if ${${UNDEF} == "":?bad-cond:bad-cond} . error @@ -65,6 +68,7 @@ COND:= ${${UNDEF} == "":?bad-assign:bad-assign} # conditional therefore returns a parse error from Var_Parse, and this parse # error propagates to CondEvalExpression, where the "Malformed conditional" # comes from. +# expect+2: while evaluating condition "1 == == 2": Bad condition # expect+1: Malformed conditional (${1 == == 2:?yes:no} != "") .if ${1 == == 2:?yes:no} != "" . error @@ -89,6 +93,7 @@ COND:= ${${UNDEF} == "":?bad-assign:bad-assign} # condition should be detected as being malformed before any comparison is # done since there is no well-formed comparison in the condition at all. .MAKEFLAGS: -dc +# expect+1: while evaluating condition "1 == == 2": Bad condition .if "${1 == == 2:?yes:no}" != "" . error .else @@ -156,18 +161,18 @@ STRING= string NUMBER= no # not really a number # expect+1: no. .info ${${STRING} == "literal" && ${NUMBER} >= 10:?yes:no}. -# expect+3: while evaluating variable "string == "literal" || no >= 10": Comparison with '>=' requires both operands 'no' and '10' to be numeric -# expect: make: Bad conditional expression 'string == "literal" || no >= 10' before '?yes:no' +# expect+3: while evaluating condition "string == "literal" || no >= 10": Comparison with '>=' requires both operands 'no' and '10' to be numeric +# expect+2: while evaluating condition "string == "literal" || no >= 10": Bad condition # expect+1: . .info ${${STRING} == "literal" || ${NUMBER} >= 10:?yes:no}. # The following situation occasionally occurs with MKINET6 or similar # variables. NUMBER= # empty, not really a number either -# expect: make: Bad conditional expression 'string == "literal" && >= 10' before '?yes:no' +# expect+2: while evaluating condition "string == "literal" && >= 10": Bad condition # expect+1: . .info ${${STRING} == "literal" && ${NUMBER} >= 10:?yes:no}. -# expect: make: Bad conditional expression 'string == "literal" || >= 10' before '?yes:no' +# expect+2: while evaluating condition "string == "literal" || >= 10": Bad condition # expect+1: . .info ${${STRING} == "literal" || ${NUMBER} >= 10:?yes:no}. @@ -182,6 +187,7 @@ EMPTY= # empty # expect+1: .info <${${ASTERISK} :?true:false}> # syntax error since the condition is completely blank. +# expect+2: while evaluating condition " ": Bad condition # expect+1: <> .info <${${EMPTY} :?true:false}> @@ -305,3 +311,9 @@ BOTH= <${YES}> <${NO}> .if ${BOTH} != " " . error .endif + + +# expect+2: while evaluating then-branch of condition "1": while evaluating "${:X-then}:${:X-else}}" with value "": Unknown modifier "X-then" +# expect+1: while evaluating else-branch of condition "1": while parsing "${:X-else}}": Unknown modifier "X-else" +.if ${1:?${:X-then}:${:X-else}} +.endif diff --git a/contrib/bmake/unit-tests/varmod-indirect.exp b/contrib/bmake/unit-tests/varmod-indirect.exp index 376beb8edef9..360cec21e291 100644 --- a/contrib/bmake/unit-tests/varmod-indirect.exp +++ b/contrib/bmake/unit-tests/varmod-indirect.exp @@ -1,5 +1,5 @@ -make: "varmod-indirect.mk" line 19: while evaluating variable "value": Unknown modifier "${" -make: "varmod-indirect.mk" line 52: while evaluating variable "value": Unknown modifier "${" +make: "varmod-indirect.mk" line 19: while evaluating variable "value" with value "value": Unknown modifier "${" +make: "varmod-indirect.mk" line 52: while evaluating variable "value" with value "value": Unknown modifier "${" make: "varmod-indirect.mk" line 54: warning: FIXME: this expression should have resulted in a parse error rather than returning the unparsed portion of the expression. make: "varmod-indirect.mk" line 143: before make: "varmod-indirect.mk" line 143: after @@ -7,7 +7,7 @@ make: "varmod-indirect.mk" line 151: before make: "varmod-indirect.mk" line 151: after make: "varmod-indirect.mk" line 159: before make: "varmod-indirect.mk" line 159: after -make: "varmod-indirect.mk" line 164: while evaluating variable "UNDEF": Unknown modifier "Z" +make: "varmod-indirect.mk" line 164: while evaluating variable "UNDEF" with value "": Unknown modifier "Z" make: "varmod-indirect.mk" line 167: before make: "varmod-indirect.mk" line 167: after Parsing line 176: _:= before ${UNDEF} after @@ -31,7 +31,7 @@ Parsing line 195: _:= before ${UNDEF:${:UZ}} after Var_Parse: ${UNDEF:${:UZ}} after (eval-keep-dollar-and-undefined) Indirect modifier "Z" from "${:UZ}" Evaluating modifier ${UNDEF:Z} on value "" (eval-keep-dollar-and-undefined, undefined) -make: "varmod-indirect.mk" line 195: while evaluating variable "UNDEF": Unknown modifier "Z" +make: "varmod-indirect.mk" line 195: while evaluating variable "UNDEF" with value "": Unknown modifier "Z" Result of ${UNDEF:Z} is error (eval-keep-dollar-and-undefined, undefined) Global: _ = before ${UNDEF:Z} after Parsing line 197: .MAKEFLAGS: -d0 diff --git a/contrib/bmake/unit-tests/varmod-indirect.mk b/contrib/bmake/unit-tests/varmod-indirect.mk index 869231d47ebc..a58cb870aac8 100644 --- a/contrib/bmake/unit-tests/varmod-indirect.mk +++ b/contrib/bmake/unit-tests/varmod-indirect.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-indirect.mk,v 1.19 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: varmod-indirect.mk,v 1.20 2024/07/04 17:47:54 rillig Exp $ # # Tests for indirect variable modifiers, such as in ${VAR:${M_modifiers}}. # These can be used for very basic purposes like converting a string to either @@ -15,7 +15,7 @@ # The following expression generates a parse error since its indirect # modifier contains more than a sole expression. # -# expect+1: while evaluating variable "value": Unknown modifier "${" +# expect+1: while evaluating variable "value" with value "value": Unknown modifier "${" .if ${value:L:${:US}${:U,value,replacement,}} != "S,value,replacement,}" . warning unexpected .endif @@ -47,7 +47,7 @@ # error. Because of this parse error, this feature cannot be used reasonably # in practice. # -# expect+2: while evaluating variable "value": Unknown modifier "${" +# expect+2: while evaluating variable "value" with value "value": Unknown modifier "${" #.MAKEFLAGS: -dvc .if ${value:L:${:UM*}S,value,replaced,} == "M*S,value,replaced,}" # expect+1: warning: FIXME: this expression should have resulted in a parse error rather than returning the unparsed portion of the expression. @@ -160,7 +160,7 @@ M_NoPrimes= ${PRIMES:${M_ListToSkip}} .endfor # An error in an indirect modifier. -# expect+1: while evaluating variable "UNDEF": Unknown modifier "Z" +# expect+1: while evaluating variable "UNDEF" with value "": Unknown modifier "Z" .for var in before ${UNDEF:${:UZ}} after # expect+2: before # expect+1: after @@ -191,7 +191,7 @@ _:= before ${UNDEF:${:U}} after # XXX: This expands to ${UNDEF:Z}, which will behave differently if the # variable '_' is used in a context where the expression ${_} is # parsed but not evaluated. -# expect+1: while evaluating variable "UNDEF": Unknown modifier "Z" +# expect+1: while evaluating variable "UNDEF" with value "": Unknown modifier "Z" _:= before ${UNDEF:${:UZ}} after .MAKEFLAGS: -d0 diff --git a/contrib/bmake/unit-tests/varmod-localtime.exp b/contrib/bmake/unit-tests/varmod-localtime.exp index 1bb547289edd..0183ae6dcc2f 100644 --- a/contrib/bmake/unit-tests/varmod-localtime.exp +++ b/contrib/bmake/unit-tests/varmod-localtime.exp @@ -1,13 +1,13 @@ -make: "varmod-localtime.mk" line 61: while evaluating "${:L:localtime=-1} != """: Invalid time value "-1" +make: "varmod-localtime.mk" line 61: while evaluating "${:L:localtime=-1} != """ with value "": Invalid time value "-1" make: "varmod-localtime.mk" line 61: Malformed conditional (${:L:localtime=-1} != "") -make: "varmod-localtime.mk" line 72: while evaluating "${:L:localtime= 1} != """: Invalid time value " 1" +make: "varmod-localtime.mk" line 72: while evaluating "${:L:localtime= 1} != """ with value "": Invalid time value " 1" make: "varmod-localtime.mk" line 72: Malformed conditional (${:L:localtime= 1} != "") -make: "varmod-localtime.mk" line 120: while evaluating "${:L:localtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000" +make: "varmod-localtime.mk" line 120: while evaluating "${:L:localtime=10000000000000000000000000000000} != """ with value "": Invalid time value "10000000000000000000000000000000" make: "varmod-localtime.mk" line 120: Malformed conditional (${:L:localtime=10000000000000000000000000000000} != "") -make: "varmod-localtime.mk" line 133: while evaluating "${:L:localtime=error} != """: Invalid time value "error" +make: "varmod-localtime.mk" line 133: while evaluating "${:L:localtime=error} != """ with value "": Invalid time value "error" make: "varmod-localtime.mk" line 133: Malformed conditional (${:L:localtime=error} != "") -make: "varmod-localtime.mk" line 144: while evaluating variable "%Y": Invalid time value "100000S,1970,bad," +make: "varmod-localtime.mk" line 144: while evaluating variable "%Y" with value "%Y": Invalid time value "100000S,1970,bad," make: "varmod-localtime.mk" line 144: Malformed conditional (${%Y:L:localtime=100000S,1970,bad,} != "bad") make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-localtime.mk b/contrib/bmake/unit-tests/varmod-localtime.mk index 233e556e0c77..b6295965ddb8 100644 --- a/contrib/bmake/unit-tests/varmod-localtime.mk +++ b/contrib/bmake/unit-tests/varmod-localtime.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-localtime.mk,v 1.15 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: varmod-localtime.mk,v 1.17 2024/07/05 19:47:22 rillig Exp $ # # Tests for the :localtime variable modifier, which formats a timestamp # using strftime(3) in local time. @@ -56,7 +56,7 @@ # 1970. Going back 50 years in the past is not a practical use case for # make. Therefore, since var.c 1.631, negative time stamps produce a # parse error. -# expect+2: while evaluating "${:L:localtime=-1} != """: Invalid time value "-1" +# expect+2: while evaluating "${:L:localtime=-1} != """ with value "": Invalid time value "-1" # expect+1: Malformed conditional (${:L:localtime=-1} != "") .if ${:L:localtime=-1} != "" . error @@ -67,7 +67,7 @@ # Spaces were allowed before var.c 1.631 from 2020-10-31 21:40:20, not # because it would make sense but just as a side-effect from using strtoul. -# expect+2: while evaluating "${:L:localtime= 1} != """: Invalid time value " 1" +# expect+2: while evaluating "${:L:localtime= 1} != """ with value "": Invalid time value " 1" # expect+1: Malformed conditional (${:L:localtime= 1} != "") .if ${:L:localtime= 1} != "" . error @@ -115,7 +115,7 @@ # # Since var.c 1.631 from 2020-10-31, the overflow is detected and produces a # parse error. -# expect+2: while evaluating "${:L:localtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000" +# expect+2: while evaluating "${:L:localtime=10000000000000000000000000000000} != """ with value "": Invalid time value "10000000000000000000000000000000" # expect+1: Malformed conditional (${:L:localtime=10000000000000000000000000000000} != "") .if ${:L:localtime=10000000000000000000000000000000} != "" . error @@ -128,7 +128,7 @@ # stopped after the '=', and the remaining string was parsed for more variable # modifiers. Because of the unknown modifier 'e' from the 'error', the whole # variable value was discarded and thus not printed. -# expect+2: while evaluating "${:L:localtime=error} != """: Invalid time value "error" +# expect+2: while evaluating "${:L:localtime=error} != """ with value "": Invalid time value "error" # expect+1: Malformed conditional (${:L:localtime=error} != "") .if ${:L:localtime=error} != "" . error @@ -139,7 +139,7 @@ # Before var.c 1.1050 from 2023-05-09, the timestamp could be directly # followed by the next modifier, without a ':' separator. This was the same # bug as for the ':L' and ':P' modifiers. -# expect+2: while evaluating variable "%Y": Invalid time value "100000S,1970,bad," +# expect+2: while evaluating variable "%Y" with value "%Y": Invalid time value "100000S,1970,bad," # expect+1: Malformed conditional (${%Y:L:localtime=100000S,1970,bad,} != "bad") .if ${%Y:L:localtime=100000S,1970,bad,} != "bad" . error diff --git a/contrib/bmake/unit-tests/varmod-loop-delete.exp b/contrib/bmake/unit-tests/varmod-loop-delete.exp index 5c508a7a6420..eb3124a9adfd 100644 --- a/contrib/bmake/unit-tests/varmod-loop-delete.exp +++ b/contrib/bmake/unit-tests/varmod-loop-delete.exp @@ -1,4 +1,4 @@ -make: "varmod-loop-delete.mk" line 20: while evaluating variable "VAR": while evaluating "${:U:@VAR@@} rest of the value": Cannot delete variable "VAR" while it is used +make: "varmod-loop-delete.mk" line 20: while evaluating variable "VAR" with value "${:U:@VAR@@} rest of the value": while evaluating "${:U:@VAR@@} rest of the value" with value "": Cannot delete variable "VAR" while it is used make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-loop-delete.mk b/contrib/bmake/unit-tests/varmod-loop-delete.mk index cf0611991194..5a4b273afcaf 100644 --- a/contrib/bmake/unit-tests/varmod-loop-delete.mk +++ b/contrib/bmake/unit-tests/varmod-loop-delete.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-loop-delete.mk,v 1.4 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: varmod-loop-delete.mk,v 1.6 2024/07/05 19:47:22 rillig Exp $ # # Tests for the variable modifier ':@', which as a side effect allows to # delete an arbitrary variable. @@ -16,7 +16,7 @@ VAR= ${:U:@VAR@@} rest of the value # In an assignment, the scope is 'Global'. Since the variable 'VAR' is # defined in the global scope, it deletes itself. -# expect+1: while evaluating variable "VAR": while evaluating "${:U:@VAR@@} rest of the value": Cannot delete variable "VAR" while it is used +# expect+1: while evaluating variable "VAR" with value "${:U:@VAR@@} rest of the value": while evaluating "${:U:@VAR@@} rest of the value" with value "": Cannot delete variable "VAR" while it is used EVAL:= ${VAR} .if ${EVAL} != " rest of the value" . error diff --git a/contrib/bmake/unit-tests/varmod-loop-varname.exp b/contrib/bmake/unit-tests/varmod-loop-varname.exp index cefd82093e29..8ad1842c4d09 100644 --- a/contrib/bmake/unit-tests/varmod-loop-varname.exp +++ b/contrib/bmake/unit-tests/varmod-loop-varname.exp @@ -1,11 +1,11 @@ -make: "varmod-loop-varname.mk" line 18: while evaluating "${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar +make: "varmod-loop-varname.mk" line 18: while evaluating "${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"" with value "one two three": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar make: "varmod-loop-varname.mk" line 18: Malformed conditional (${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+") -make: "varmod-loop-varname.mk" line 89: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$" must not contain a dollar +make: "varmod-loop-varname.mk" line 89: while evaluating variable "1 2 3" with value "1 2 3": In the :@ modifier, the variable name "v$" must not contain a dollar make: "varmod-loop-varname.mk" line 89: Malformed conditional (${1 2 3:L:@v$@($v)@} != "(1) (2) (3)") -make: "varmod-loop-varname.mk" line 96: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$$" must not contain a dollar +make: "varmod-loop-varname.mk" line 96: while evaluating variable "1 2 3" with value "1 2 3": In the :@ modifier, the variable name "v$$" must not contain a dollar make: "varmod-loop-varname.mk" line 96: Malformed conditional (${1 2 3:L:@v$$@($v)@} != "() () ()") -make: "varmod-loop-varname.mk" line 103: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$$$" must not contain a dollar +make: "varmod-loop-varname.mk" line 103: while evaluating variable "1 2 3" with value "1 2 3": In the :@ modifier, the variable name "v$$$" must not contain a dollar make: "varmod-loop-varname.mk" line 103: Malformed conditional (${1 2 3:L:@v$$$@($v)@} != "() () ()") make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-loop-varname.mk b/contrib/bmake/unit-tests/varmod-loop-varname.mk index 7abf8610911a..a41d1d30d019 100644 --- a/contrib/bmake/unit-tests/varmod-loop-varname.mk +++ b/contrib/bmake/unit-tests/varmod-loop-varname.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-loop-varname.mk,v 1.7 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: varmod-loop-varname.mk,v 1.9 2024/07/05 19:47:22 rillig Exp $ # # Tests for the first part of the variable modifier ':@var@...@', which # contains the variable name to use during the loop. @@ -13,7 +13,7 @@ # dynamically. There was no practical use-case for this. # Since var.c 1.907 from 2021-04-04, a '$' is no longer allowed in the # variable name. -# expect+2: while evaluating "${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar +# expect+2: while evaluating "${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"" with value "one two three": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar # expect+1: Malformed conditional (${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+") .if ${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+" . error @@ -84,21 +84,21 @@ RES3= 3 # There's no point in allowing a dollar sign in that position. # Since var.c 1.907 from 2021-04-04, a '$' is no longer allowed in the # variable name. -# expect+2: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$" must not contain a dollar +# expect+2: while evaluating variable "1 2 3" with value "1 2 3": In the :@ modifier, the variable name "v$" must not contain a dollar # expect+1: Malformed conditional (${1 2 3:L:@v$@($v)@} != "(1) (2) (3)") .if ${1 2 3:L:@v$@($v)@} != "(1) (2) (3)" . error .else . error .endif -# expect+2: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$$" must not contain a dollar +# expect+2: while evaluating variable "1 2 3" with value "1 2 3": In the :@ modifier, the variable name "v$$" must not contain a dollar # expect+1: Malformed conditional (${1 2 3:L:@v$$@($v)@} != "() () ()") .if ${1 2 3:L:@v$$@($v)@} != "() () ()" . error .else . error .endif -# expect+2: while evaluating variable "1 2 3": In the :@ modifier, the variable name "v$$$" must not contain a dollar +# expect+2: while evaluating variable "1 2 3" with value "1 2 3": In the :@ modifier, the variable name "v$$$" must not contain a dollar # expect+1: Malformed conditional (${1 2 3:L:@v$$$@($v)@} != "() () ()") .if ${1 2 3:L:@v$$$@($v)@} != "() () ()" . error diff --git a/contrib/bmake/unit-tests/varmod-match-escape.exp b/contrib/bmake/unit-tests/varmod-match-escape.exp index cf5aeab5b39d..e15445de356b 100755 --- a/contrib/bmake/unit-tests/varmod-match-escape.exp +++ b/contrib/bmake/unit-tests/varmod-match-escape.exp @@ -33,9 +33,11 @@ Comparing ":" != "::" make: "varmod-match-escape.mk" line 43: warning: XXX: Oops Global: .MAKEFLAGS = -r -k -d cv -d Global: .MAKEFLAGS = -r -k -d cv -d 0 -make: "varmod-match-escape.mk" line 69: while evaluating "${:U\$:M\$} != """: Dollar followed by nothing -make: "varmod-match-escape.mk" line 110: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[A-]' of modifier ':M' -make: "varmod-match-escape.mk" line 110: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[^A-]' of modifier ':M' +make: "varmod-match-escape.mk" line 69: while evaluating "${:U\$:M\$} != """ with value "$": Dollar followed by nothing +make: "varmod-match-escape.mk" line 110: while evaluating variable "WORDS" with value "A A] A]] B B] B]] ] ]] ]]] a a] a]]": Unfinished character list in pattern '[A-]' of modifier ':M' + in .for loop from varmod-match-escape.mk:107 with pattern = [A-] +make: "varmod-match-escape.mk" line 110: while evaluating variable "WORDS" with value "A A] A]] B B] B]] ] ]] ]]] a a] a]]": Unfinished character list in pattern '[^A-]' of modifier ':M' + in .for loop from varmod-match-escape.mk:107 with pattern = [^A-] make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-match-escape.mk b/contrib/bmake/unit-tests/varmod-match-escape.mk index fba42ef03054..eb5730d3e5a1 100755 --- a/contrib/bmake/unit-tests/varmod-match-escape.mk +++ b/contrib/bmake/unit-tests/varmod-match-escape.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-match-escape.mk,v 1.14 2024/06/15 19:43:56 rillig Exp $ +# $NetBSD: varmod-match-escape.mk,v 1.17 2024/07/09 17:07:23 rillig Exp $ # # As of 2020-08-01, the :M and :N modifiers interpret backslashes differently, # depending on whether there was an expression somewhere before the @@ -65,7 +65,7 @@ VALUES= : :: :\: # In lint mode, the case of a lonely '$' is covered with an error message. .MAKEFLAGS: -dL -# expect+1: while evaluating "${:U\$:M\$} != """: Dollar followed by nothing +# expect+1: while evaluating "${:U\$:M\$} != """ with value "$": Dollar followed by nothing .if ${:U\$:M\$} != "" . error .endif @@ -105,8 +105,8 @@ EXP.[^A-]]= a EXP.[^A-]]]= a] .for pattern in [A-] [A-]] [A-]]] [^A-] [^A-]] [^A-]]] -# expect+2: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[A-]' of modifier ':M' -# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[^A-]' of modifier ':M' +# expect+2: while evaluating variable "WORDS" with value "A A] A]] B B] B]] ] ]] ]]] a a] a]]": Unfinished character list in pattern '[A-]' of modifier ':M' +# expect+1: while evaluating variable "WORDS" with value "A A] A]] B B] B]] ] ]] ]]] a a] a]]": Unfinished character list in pattern '[^A-]' of modifier ':M' . if ${WORDS:M${pattern}} != ${EXP.${pattern}} . warning ${pattern}: ${WORDS:M${pattern}} != ${EXP.${pattern}} . endif diff --git a/contrib/bmake/unit-tests/varmod-match.exp b/contrib/bmake/unit-tests/varmod-match.exp index ddf02c561e65..377a43082fed 100644 --- a/contrib/bmake/unit-tests/varmod-match.exp +++ b/contrib/bmake/unit-tests/varmod-match.exp @@ -1,13 +1,13 @@ -make: "varmod-match.mk" line 289: warning: while evaluating variable "WORDS": Unfinished character list in pattern 'a[' of modifier ':M' -make: "varmod-match.mk" line 297: warning: while evaluating variable "WORDS": Unfinished character list in pattern 'a[^' of modifier ':M' -make: "varmod-match.mk" line 305: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[-x1-3' of modifier ':M' -make: "varmod-match.mk" line 313: warning: while evaluating variable "WORDS": Unfinished character list in pattern '*[-x1-3' of modifier ':M' -make: "varmod-match.mk" line 322: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[^-x1-3' of modifier ':M' -make: "varmod-match.mk" line 336: warning: while evaluating variable "WORDS": Unfinished character list in pattern '?[\' of modifier ':M' -make: "varmod-match.mk" line 344: warning: while evaluating variable "WORDS": Unfinished character range in pattern '[x-' of modifier ':M' -make: "varmod-match.mk" line 356: warning: while evaluating variable "WORDS": Unfinished character range in pattern '[^x-' of modifier ':M' -make: "varmod-match.mk" line 364: warning: while evaluating variable " : :: ": Unfinished character list in pattern '[' of modifier ':M' -make: "varmod-match.mk" line 364: while evaluating variable " : :: ": Unknown modifier "]" +make: "varmod-match.mk" line 289: while evaluating variable "WORDS" with value "a a[": Unfinished character list in pattern 'a[' of modifier ':M' +make: "varmod-match.mk" line 297: while evaluating variable "WORDS" with value "a a[ aX": Unfinished character list in pattern 'a[^' of modifier ':M' +make: "varmod-match.mk" line 305: while evaluating variable "WORDS" with value "- + x xx 0 1 2 3 4 [x1-3": Unfinished character list in pattern '[-x1-3' of modifier ':M' +make: "varmod-match.mk" line 313: while evaluating variable "WORDS" with value "- + x xx 0 1 2 3 4 00 01 10 11 000 001 010 011 100 101 110 111 [x1-3": Unfinished character list in pattern '*[-x1-3' of modifier ':M' +make: "varmod-match.mk" line 322: while evaluating variable "WORDS" with value "- + x xx 0 1 2 3 4 [x1-3": Unfinished character list in pattern '[^-x1-3' of modifier ':M' +make: "varmod-match.mk" line 336: while evaluating variable "WORDS" with value "\\ \a x\": Unfinished character list in pattern '?[\' of modifier ':M' +make: "varmod-match.mk" line 344: while evaluating variable "WORDS" with value "[x- x x- y": Unfinished character range in pattern '[x-' of modifier ':M' +make: "varmod-match.mk" line 356: while evaluating variable "WORDS" with value "[x- x x- y yyyyy": Unfinished character range in pattern '[^x-' of modifier ':M' +make: "varmod-match.mk" line 364: while evaluating variable " : :: " with value " : :: ": Unfinished character list in pattern '[' of modifier ':M' +make: "varmod-match.mk" line 364: while evaluating variable " : :: " with value "": Unknown modifier "]" make: "varmod-match.mk" line 364: Malformed conditional (${ ${:U\:} ${:U\:\:} :L:M[:]} != ":") make: Fatal errors encountered -- cannot continue make: stopped in unit-tests diff --git a/contrib/bmake/unit-tests/varmod-match.mk b/contrib/bmake/unit-tests/varmod-match.mk index 2cdd38f04d03..ce2bbab7eb53 100644 --- a/contrib/bmake/unit-tests/varmod-match.mk +++ b/contrib/bmake/unit-tests/varmod-match.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-match.mk,v 1.24 2024/06/15 19:43:56 rillig Exp $ +# $NetBSD: varmod-match.mk,v 1.26 2024/07/09 17:07:23 rillig Exp $ # # Tests for the ':M' modifier, which keeps only those words that match the # given pattern. @@ -285,7 +285,7 @@ ${:U*}= asterisk # [ Incomplete empty character list, never matches. WORDS= a a[ -# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern 'a[' of modifier ':M' +# expect+1: while evaluating variable "WORDS" with value "a a[": Unfinished character list in pattern 'a[' of modifier ':M' .if ${WORDS:Ma[} != "" . error .endif @@ -293,7 +293,7 @@ WORDS= a a[ # [^ Incomplete negated empty character list, matches any single # character. WORDS= a a[ aX -# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern 'a[^' of modifier ':M' +# expect+1: while evaluating variable "WORDS" with value "a a[ aX": Unfinished character list in pattern 'a[^' of modifier ':M' .if ${WORDS:Ma[^} != "a[ aX" . error .endif @@ -301,7 +301,7 @@ WORDS= a a[ aX # [-x1-3 Incomplete character list, matches those elements that can be # parsed without lookahead. WORDS= - + x xx 0 1 2 3 4 [x1-3 -# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[-x1-3' of modifier ':M' +# expect+1: while evaluating variable "WORDS" with value "- + x xx 0 1 2 3 4 [x1-3": Unfinished character list in pattern '[-x1-3' of modifier ':M' .if ${WORDS:M[-x1-3} != "- x 1 2 3" . error .endif @@ -309,7 +309,7 @@ WORDS= - + x xx 0 1 2 3 4 [x1-3 # *[-x1-3 Incomplete character list after a wildcard, matches those # words that end with one of the characters from the list. WORDS= - + x xx 0 1 2 3 4 00 01 10 11 000 001 010 011 100 101 110 111 [x1-3 -# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern '*[-x1-3' of modifier ':M' +# expect+1: while evaluating variable "WORDS" with value "- + x xx 0 1 2 3 4 00 01 10 11 000 001 010 011 100 101 110 111 [x1-3": Unfinished character list in pattern '*[-x1-3' of modifier ':M' .if ${WORDS:M*[-x1-3} != "- x xx 1 2 3 01 11 001 011 101 111 [x1-3" . warning ${WORDS:M*[-x1-3} .endif @@ -318,7 +318,7 @@ WORDS= - + x xx 0 1 2 3 4 00 01 10 11 000 001 010 011 100 101 110 111 [x1-3 # Incomplete negated character list, matches any character # except those elements that can be parsed without lookahead. WORDS= - + x xx 0 1 2 3 4 [x1-3 -# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[^-x1-3' of modifier ':M' +# expect+1: while evaluating variable "WORDS" with value "- + x xx 0 1 2 3 4 [x1-3": Unfinished character list in pattern '[^-x1-3' of modifier ':M' .if ${WORDS:M[^-x1-3} != "+ 0 4" . error .endif @@ -332,7 +332,7 @@ WORDS= - + x xx 0 1 2 3 4 [x1-3 # '\', as there is no following space that could be escaped. WORDS= \\ \a ${:Ux\\} PATTERN= ${:U?[\\} -# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern '?[\' of modifier ':M' +# expect+1: while evaluating variable "WORDS" with value "\\ \a x\": Unfinished character list in pattern '?[\' of modifier ':M' .if ${WORDS:M${PATTERN}} != "\\\\ x\\" . error .endif @@ -340,7 +340,7 @@ PATTERN= ${:U?[\\} # [x- Incomplete character list containing an incomplete character # range, matches only the 'x'. WORDS= [x- x x- y -# expect+1: warning: while evaluating variable "WORDS": Unfinished character range in pattern '[x-' of modifier ':M' +# expect+1: while evaluating variable "WORDS" with value "[x- x x- y": Unfinished character range in pattern '[x-' of modifier ':M' .if ${WORDS:M[x-} != "x" . error .endif @@ -352,14 +352,14 @@ WORDS= [x- x x- y # XXX: Even matches strings that are longer than a single # character. WORDS= [x- x x- y yyyyy -# expect+1: warning: while evaluating variable "WORDS": Unfinished character range in pattern '[^x-' of modifier ':M' +# expect+1: while evaluating variable "WORDS" with value "[x- x x- y yyyyy": Unfinished character range in pattern '[^x-' of modifier ':M' .if ${WORDS:M[^x-} != "[x- y yyyyy" . error .endif # [:] matches never since the ':' starts the next modifier -# expect+3: warning: while evaluating variable " : :: ": Unfinished character list in pattern '[' of modifier ':M' -# expect+2: while evaluating variable " : :: ": Unknown modifier "]" +# expect+3: while evaluating variable " : :: " with value " : :: ": Unfinished character list in pattern '[' of modifier ':M' +# expect+2: while evaluating variable " : :: " with value "": Unknown modifier "]" # expect+1: Malformed conditional (${ ${:U\:} ${:U\:\:} :L:M[:]} != ":") .if ${ ${:U\:} ${:U\:\:} :L:M[:]} != ":" . error diff --git a/contrib/bmake/unit-tests/varmod-mtime.exp b/contrib/bmake/unit-tests/varmod-mtime.exp index 87f405573437..153b7ff79f08 100644 --- a/contrib/bmake/unit-tests/varmod-mtime.exp +++ b/contrib/bmake/unit-tests/varmod-mtime.exp @@ -1,13 +1,13 @@ -make: "varmod-mtime.mk" line 47: while evaluating variable "no/such/file": Invalid argument '123x' for modifier ':mtime' +make: "varmod-mtime.mk" line 47: while evaluating variable "no/such/file" with value "no/such/file": Invalid argument '123x' for modifier ':mtime' make: "varmod-mtime.mk" line 47: Malformed conditional (${no/such/file:L:mtime=123x}) -make: "varmod-mtime.mk" line 70: while evaluating variable "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file1': -make: "varmod-mtime.mk" line 70: while evaluating variable "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file2': +make: "varmod-mtime.mk" line 70: while evaluating variable "no/such/file1 no/such/file2" with value "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file1': +make: "varmod-mtime.mk" line 70: while evaluating variable "no/such/file1 no/such/file2" with value "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file2': make: "varmod-mtime.mk" line 70: Malformed conditional (${no/such/file1 no/such/file2:L:mtime=error}) -make: "varmod-mtime.mk" line 81: while evaluating variable "MAKEFILE": Invalid argument 'errorhandler-no' for modifier ':mtime' +make: "varmod-mtime.mk" line 81: while evaluating variable "MAKEFILE" with value "varmod-mtime.mk": Invalid argument 'errorhandler-no' for modifier ':mtime' make: "varmod-mtime.mk" line 81: Malformed conditional (${MAKEFILE:mtime=errorhandler-no} > 0) -make: "varmod-mtime.mk" line 90: while evaluating variable "MAKEFILE": Invalid argument 'warn' for modifier ':mtime' +make: "varmod-mtime.mk" line 90: while evaluating variable "MAKEFILE" with value "varmod-mtime.mk": Invalid argument 'warn' for modifier ':mtime' make: "varmod-mtime.mk" line 90: Malformed conditional (${MAKEFILE:mtime=warn} > 0) -make: "varmod-mtime.mk" line 115: while evaluating variable "anything": Unknown modifier "mtim" +make: "varmod-mtime.mk" line 115: while evaluating variable "anything" with value "anything": Unknown modifier "mtim" make: "varmod-mtime.mk" line 115: Malformed conditional (${anything:L:mtim}) make: Fatal errors encountered -- cannot continue make: stopped in unit-tests diff --git a/contrib/bmake/unit-tests/varmod-mtime.mk b/contrib/bmake/unit-tests/varmod-mtime.mk index 189bb8cadc9a..be627fcfe040 100644 --- a/contrib/bmake/unit-tests/varmod-mtime.mk +++ b/contrib/bmake/unit-tests/varmod-mtime.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-mtime.mk,v 1.10 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: varmod-mtime.mk,v 1.11 2024/07/04 17:47:54 rillig Exp $ # # Tests for the ':mtime' variable modifier, which maps each word of the # expression to that file's modification time. @@ -42,7 +42,7 @@ not_found_mtime:= ${no/such/file:L:mtime} # The fallback timestamp must only be an integer, without trailing characters. -# expect+2: while evaluating variable "no/such/file": Invalid argument '123x' for modifier ':mtime' +# expect+2: while evaluating variable "no/such/file" with value "no/such/file": Invalid argument '123x' for modifier ':mtime' # expect+1: Malformed conditional (${no/such/file:L:mtime=123x}) .if ${no/such/file:L:mtime=123x} . error @@ -64,8 +64,8 @@ _!= rm -f ${COOKIE} # If the optional argument of the ':mtime' modifier is the word 'error', the # modifier fails with an error message, once for each affected file. # -# expect+3: while evaluating variable "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file1': -# expect+2: while evaluating variable "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file2': +# expect+3: while evaluating variable "no/such/file1 no/such/file2" with value "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file1': +# expect+2: while evaluating variable "no/such/file1 no/such/file2" with value "no/such/file1 no/such/file2": Cannot determine mtime for 'no/such/file2': # expect+1: Malformed conditional (${no/such/file1 no/such/file2:L:mtime=error}) .if ${no/such/file1 no/such/file2:L:mtime=error} . error @@ -76,7 +76,7 @@ _!= rm -f ${COOKIE} # Only the word 'error' is a special argument to the ':mtime' modifier, all # other words result in a parse error. -# expect+2: while evaluating variable "MAKEFILE": Invalid argument 'errorhandler-no' for modifier ':mtime' +# expect+2: while evaluating variable "MAKEFILE" with value "varmod-mtime.mk": Invalid argument 'errorhandler-no' for modifier ':mtime' # expect+1: Malformed conditional (${MAKEFILE:mtime=errorhandler-no} > 0) .if ${MAKEFILE:mtime=errorhandler-no} > 0 .else @@ -85,7 +85,7 @@ _!= rm -f ${COOKIE} # Only the word 'error' can be used as a fallback argument to the modifier. -# expect+2: while evaluating variable "MAKEFILE": Invalid argument 'warn' for modifier ':mtime' +# expect+2: while evaluating variable "MAKEFILE" with value "varmod-mtime.mk": Invalid argument 'warn' for modifier ':mtime' # expect+1: Malformed conditional (${MAKEFILE:mtime=warn} > 0) .if ${MAKEFILE:mtime=warn} > 0 . error @@ -110,7 +110,7 @@ end:= ${%s:L:gmtime} # If there is a typo in the modifier name, it does not match. -# expect+2: while evaluating variable "anything": Unknown modifier "mtim" +# expect+2: while evaluating variable "anything" with value "anything": Unknown modifier "mtim" # expect+1: Malformed conditional (${anything:L:mtim}) .if ${anything:L:mtim} . error diff --git a/contrib/bmake/unit-tests/varmod-order.exp b/contrib/bmake/unit-tests/varmod-order.exp index 12d0bff75157..591e1f160f61 100644 --- a/contrib/bmake/unit-tests/varmod-order.exp +++ b/contrib/bmake/unit-tests/varmod-order.exp @@ -1,26 +1,26 @@ -make: Bad modifier ":OX" for variable "WORDS" -make: "varmod-order.mk" line 16: Undefined variable "${WORDS:OX" -make: Bad modifier ":OxXX" for variable "WORDS" -make: "varmod-order.mk" line 21: Undefined variable "${WORDS:Ox" -make: Unclosed expression, expecting '}' for modifier "O" of variable "WORDS" with value "eight five four nine one seven six ten three two" -make: Unclosed expression, expecting '}' for modifier "On" of variable "NUMBERS" with value "1 2 3 4 5 6 7 8 9 10" -make: Unclosed expression, expecting '}' for modifier "Onr" of variable "NUMBERS" with value "10 9 8 7 6 5 4 3 2 1" -make: Bad modifier ":Oxn" for variable "NUMBERS" -make: "varmod-order.mk" line 33: Malformed conditional (${NUMBERS:Oxn}) -make: Bad modifier ":On_typo" for variable "NUMBERS" -make: "varmod-order.mk" line 44: Malformed conditional (${NUMBERS:On_typo}) -make: Bad modifier ":Onr_typo" for variable "NUMBERS" -make: "varmod-order.mk" line 54: Malformed conditional (${NUMBERS:Onr_typo}) -make: Bad modifier ":Orn_typo" for variable "NUMBERS" -make: "varmod-order.mk" line 64: Malformed conditional (${NUMBERS:Orn_typo}) -make: Bad modifier ":Onn" for variable "NUMBERS" -make: "varmod-order.mk" line 76: Malformed conditional (${NUMBERS:Onn}) -make: Bad modifier ":Onrr" for variable "NUMBERS" -make: "varmod-order.mk" line 86: Malformed conditional (${NUMBERS:Onrr}) -make: Bad modifier ":Orrn" for variable "NUMBERS" -make: "varmod-order.mk" line 96: Malformed conditional (${NUMBERS:Orrn}) -make: Bad modifier ":On=Off" for variable "SWITCH" -make: "varmod-order.mk" line 111: Malformed conditional (${SWITCH:On=Off} != "Off") +make: "varmod-order.mk" line 17: while evaluating variable "WORDS" with value "one two three four five six seven eight nine ten": Bad modifier ":OX" +make: "varmod-order.mk" line 17: Undefined variable "${WORDS:OX" +make: "varmod-order.mk" line 23: while evaluating variable "WORDS" with value "one two three four five six seven eight nine ten": Bad modifier ":OxXX" +make: "varmod-order.mk" line 23: Undefined variable "${WORDS:Ox" +make: "varmod-order.mk" line 27: while evaluating variable "WORDS" with value "eight five four nine one seven six ten three two": Unclosed expression, expecting '}' for modifier "O" +make: "varmod-order.mk" line 29: while evaluating variable "NUMBERS" with value "1 2 3 4 5 6 7 8 9 10": Unclosed expression, expecting '}' for modifier "On" +make: "varmod-order.mk" line 31: while evaluating variable "NUMBERS" with value "10 9 8 7 6 5 4 3 2 1": Unclosed expression, expecting '}' for modifier "Onr" +make: "varmod-order.mk" line 38: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Oxn" +make: "varmod-order.mk" line 38: Malformed conditional (${NUMBERS:Oxn}) +make: "varmod-order.mk" line 48: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":On_typo" +make: "varmod-order.mk" line 48: Malformed conditional (${NUMBERS:On_typo}) +make: "varmod-order.mk" line 58: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Onr_typo" +make: "varmod-order.mk" line 58: Malformed conditional (${NUMBERS:Onr_typo}) +make: "varmod-order.mk" line 68: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Orn_typo" +make: "varmod-order.mk" line 68: Malformed conditional (${NUMBERS:Orn_typo}) +make: "varmod-order.mk" line 80: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Onn" +make: "varmod-order.mk" line 80: Malformed conditional (${NUMBERS:Onn}) +make: "varmod-order.mk" line 90: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Onrr" +make: "varmod-order.mk" line 90: Malformed conditional (${NUMBERS:Onrr}) +make: "varmod-order.mk" line 100: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Orrn" +make: "varmod-order.mk" line 100: Malformed conditional (${NUMBERS:Orrn}) +make: "varmod-order.mk" line 115: while evaluating variable "SWITCH" with value "On": Bad modifier ":On=Off" +make: "varmod-order.mk" line 115: Malformed conditional (${SWITCH:On=Off} != "Off") make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-order.mk b/contrib/bmake/unit-tests/varmod-order.mk index 67919543a93e..b8a631857e6f 100644 --- a/contrib/bmake/unit-tests/varmod-order.mk +++ b/contrib/bmake/unit-tests/varmod-order.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-order.mk,v 1.11 2023/06/01 20:56:35 rillig Exp $ +# $NetBSD: varmod-order.mk,v 1.14 2024/07/05 18:59:33 rillig Exp $ # # Tests for the :O variable modifier and its variants, which either sort the # words of the value or shuffle them. @@ -11,24 +11,29 @@ NUMBERS= 8 5 4 9 1 7 6 10 3 2 # in English alphabetical order .endif # Unknown modifier "OX" -# FIXME: The error message is wrong. -# expect+1: Undefined variable "${WORDS:OX" +# FIXME: The error message "Undefined variable" is wrong. +# expect+2: Undefined variable "${WORDS:OX" +# expect+1: while evaluating variable "WORDS" with value "one two three four five six seven eight nine ten": Bad modifier ":OX" _:= ${WORDS:OX} # Unknown modifier "OxXX" -# FIXME: The error message is wrong. -# expect+1: Undefined variable "${WORDS:Ox" +# FIXME: The error message "Undefined variable" is wrong. +# expect+2: Undefined variable "${WORDS:Ox" +# expect+1: while evaluating variable "WORDS" with value "one two three four five six seven eight nine ten": Bad modifier ":OxXX" _:= ${WORDS:OxXX} # Missing closing brace, to cover the error handling code. +# expect+1: while evaluating variable "WORDS" with value "eight five four nine one seven six ten three two": Unclosed expression, expecting '}' for modifier "O" _:= ${WORDS:O +# expect+1: while evaluating variable "NUMBERS" with value "1 2 3 4 5 6 7 8 9 10": Unclosed expression, expecting '}' for modifier "On" _:= ${NUMBERS:On +# expect+1: while evaluating variable "NUMBERS" with value "10 9 8 7 6 5 4 3 2 1": Unclosed expression, expecting '}' for modifier "Onr" _:= ${NUMBERS:Onr # Shuffling numerically doesn't make sense, so don't allow 'x' and 'n' to be # combined. # -# expect: make: Bad modifier ":Oxn" for variable "NUMBERS" +# expect+2: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Oxn" # expect+1: Malformed conditional (${NUMBERS:Oxn}) .if ${NUMBERS:Oxn} . error @@ -37,9 +42,8 @@ _:= ${NUMBERS:Onr .endif # Extra characters after ':On' are detected and diagnosed. -# TODO: Add line number information to the "Bad modifier" diagnostic. # -# expect: make: Bad modifier ":On_typo" for variable "NUMBERS" +# expect+2: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":On_typo" # expect+1: Malformed conditional (${NUMBERS:On_typo}) .if ${NUMBERS:On_typo} . error @@ -49,7 +53,7 @@ _:= ${NUMBERS:Onr # Extra characters after ':Onr' are detected and diagnosed. # -# expect: make: Bad modifier ":Onr_typo" for variable "NUMBERS" +# expect+2: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Onr_typo" # expect+1: Malformed conditional (${NUMBERS:Onr_typo}) .if ${NUMBERS:Onr_typo} . error @@ -59,7 +63,7 @@ _:= ${NUMBERS:Onr # Extra characters after ':Orn' are detected and diagnosed. # -# expect: make: Bad modifier ":Orn_typo" for variable "NUMBERS" +# expect+2: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Orn_typo" # expect+1: Malformed conditional (${NUMBERS:Orn_typo}) .if ${NUMBERS:Orn_typo} . error @@ -71,7 +75,7 @@ _:= ${NUMBERS:Onr # criteria are fixed, not computed, therefore allowing this redundancy does # not make sense. # -# expect: make: Bad modifier ":Onn" for variable "NUMBERS" +# expect+2: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Onn" # expect+1: Malformed conditional (${NUMBERS:Onn}) .if ${NUMBERS:Onn} . error @@ -81,7 +85,7 @@ _:= ${NUMBERS:Onr # Repeating the 'r' is not supported as well, for the same reasons as above. # -# expect: make: Bad modifier ":Onrr" for variable "NUMBERS" +# expect+2: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Onrr" # expect+1: Malformed conditional (${NUMBERS:Onrr}) .if ${NUMBERS:Onrr} . error @@ -91,7 +95,7 @@ _:= ${NUMBERS:Onr # Repeating the 'r' is not supported as well, for the same reasons as above. # -# expect: make: Bad modifier ":Orrn" for variable "NUMBERS" +# expect+2: while evaluating variable "NUMBERS" with value "8 5 4 9 1 7 6 10 3 2": Bad modifier ":Orrn" # expect+1: Malformed conditional (${NUMBERS:Orrn}) .if ${NUMBERS:Orrn} . error @@ -106,7 +110,7 @@ _:= ${NUMBERS:Onr # ':H' modifier but instead replaces a trailing 'H' with 'new' in each word. # There is no such fallback for the ':O' modifiers. SWITCH= On -# expect: make: Bad modifier ":On=Off" for variable "SWITCH" +# expect+2: while evaluating variable "SWITCH" with value "On": Bad modifier ":On=Off" # expect+1: Malformed conditional (${SWITCH:On=Off} != "Off") .if ${SWITCH:On=Off} != "Off" . error diff --git a/contrib/bmake/unit-tests/varmod-range.exp b/contrib/bmake/unit-tests/varmod-range.exp index d9848c2ef4f6..2848193e0db1 100644 --- a/contrib/bmake/unit-tests/varmod-range.exp +++ b/contrib/bmake/unit-tests/varmod-range.exp @@ -1,14 +1,14 @@ make: "varmod-range.mk" line 43: Malformed conditional (${:range=5} != "") -make: "varmod-range.mk" line 67: while evaluating "${:U:range=x}Rest" != "Rest"": Invalid number "x}Rest" != "Rest"" for ':range' modifier +make: "varmod-range.mk" line 67: while evaluating "${:U:range=x}Rest" != "Rest"" with value "": Invalid number "x}Rest" != "Rest"" for ':range' modifier make: "varmod-range.mk" line 67: Malformed conditional ("${:U:range=x}Rest" != "Rest") -make: "varmod-range.mk" line 78: while evaluating "${:U:range=0x0}Rest" != "Rest"": Unknown modifier "x0" +make: "varmod-range.mk" line 78: while evaluating "${:U:range=0x0}Rest" != "Rest"" with value "1": Unknown modifier "x0" make: "varmod-range.mk" line 78: Malformed conditional ("${:U:range=0x0}Rest" != "Rest") -make: "varmod-range.mk" line 96: while evaluating variable "a b c": Unknown modifier "rang" +make: "varmod-range.mk" line 96: while evaluating variable "a b c" with value "a b c": Unknown modifier "rang" make: "varmod-range.mk" line 96: Malformed conditional ("${a b c:L:rang}Rest" != "Rest") -make: "varmod-range.mk" line 105: while evaluating variable "a b c": Unknown modifier "rango" +make: "varmod-range.mk" line 105: while evaluating variable "a b c" with value "a b c": Unknown modifier "rango" make: "varmod-range.mk" line 105: Malformed conditional ("${a b c:L:rango}Rest" != "Rest") -make: "varmod-range.mk" line 114: while evaluating variable "a b c": Unknown modifier "ranger" +make: "varmod-range.mk" line 114: while evaluating variable "a b c" with value "a b c": Unknown modifier "ranger" make: "varmod-range.mk" line 114: Malformed conditional ("${a b c:L:ranger}Rest" != "Rest") make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-range.mk b/contrib/bmake/unit-tests/varmod-range.mk index 2915100bfb79..4b07b659489c 100644 --- a/contrib/bmake/unit-tests/varmod-range.mk +++ b/contrib/bmake/unit-tests/varmod-range.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-range.mk,v 1.11 2024/04/20 10:18:55 rillig Exp $ +# $NetBSD: varmod-range.mk,v 1.13 2024/07/05 19:47:22 rillig Exp $ # # Tests for the :range variable modifier, which generates sequences # of integers from the given range. @@ -62,7 +62,7 @@ # # Since 2020-11-01, the parser issues a more precise "Invalid number" error # instead. -# expect+2: while evaluating "${:U:range=x}Rest" != "Rest"": Invalid number "x}Rest" != "Rest"" for ':range' modifier +# expect+2: while evaluating "${:U:range=x}Rest" != "Rest"" with value "": Invalid number "x}Rest" != "Rest"" for ':range' modifier # expect+1: Malformed conditional ("${:U:range=x}Rest" != "Rest") .if "${:U:range=x}Rest" != "Rest" . error @@ -73,7 +73,7 @@ # The upper limit of the range must always be given in decimal. # This parse error stops at the 'x', trying to parse it as a variable # modifier. -# expect+2: while evaluating "${:U:range=0x0}Rest" != "Rest"": Unknown modifier "x0" +# expect+2: while evaluating "${:U:range=0x0}Rest" != "Rest"" with value "1": Unknown modifier "x0" # expect+1: Malformed conditional ("${:U:range=0x0}Rest" != "Rest") .if "${:U:range=0x0}Rest" != "Rest" . error @@ -91,7 +91,7 @@ #.endif # modifier name too short -# expect+2: while evaluating variable "a b c": Unknown modifier "rang" +# expect+2: while evaluating variable "a b c" with value "a b c": Unknown modifier "rang" # expect+1: Malformed conditional ("${a b c:L:rang}Rest" != "Rest") .if "${a b c:L:rang}Rest" != "Rest" . error @@ -100,7 +100,7 @@ .endif # misspelled modifier name -# expect+2: while evaluating variable "a b c": Unknown modifier "rango" +# expect+2: while evaluating variable "a b c" with value "a b c": Unknown modifier "rango" # expect+1: Malformed conditional ("${a b c:L:rango}Rest" != "Rest") .if "${a b c:L:rango}Rest" != "Rest" . error @@ -109,7 +109,7 @@ .endif # modifier name too long -# expect+2: while evaluating variable "a b c": Unknown modifier "ranger" +# expect+2: while evaluating variable "a b c" with value "a b c": Unknown modifier "ranger" # expect+1: Malformed conditional ("${a b c:L:ranger}Rest" != "Rest") .if "${a b c:L:ranger}Rest" != "Rest" . error diff --git a/contrib/bmake/unit-tests/varmod-select-words.exp b/contrib/bmake/unit-tests/varmod-select-words.exp index 02e9974c02d6..c503e57b384b 100644 --- a/contrib/bmake/unit-tests/varmod-select-words.exp +++ b/contrib/bmake/unit-tests/varmod-select-words.exp @@ -1,4 +1,4 @@ -make: Bad modifier ":[]" for variable "LIST" +make: in target "mod-squarebrackets-0-star-at": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[]" LIST:[]="" is an error LIST:[0]="one two three four five six" LIST:[0x0]="one two three four five six" @@ -37,17 +37,17 @@ REALLYSPACE=" " REALLYSPACE:[1]="" == "" ? REALLYSPACE:[*]:[1]=" " == " " ? LIST:[1]="one" -make: Bad modifier ":[1.]" for variable "LIST" +make: in target "mod-squarebrackets-n": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[1.]" LIST:[1.]="" is an error -make: Bad modifier ":[1]." for variable "LIST" +make: in target "mod-squarebrackets-n": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[1]." LIST:[1].="}" is an error LIST:[2]="two" LIST:[6]="six" LIST:[7]="" LIST:[999]="" -make: Bad modifier ":[-]" for variable "LIST" +make: in target "mod-squarebrackets-n": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[-]" LIST:[-]="" is an error -make: Bad modifier ":[--]" for variable "LIST" +make: in target "mod-squarebrackets-n": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[--]" LIST:[--]="" is an error LIST:[-1]="six" LIST:[-2]="five" @@ -67,22 +67,22 @@ LIST:[*]:C/ /,/:[2]="" LIST:[*]:C/ /,/:[*]:[2]="" LIST:[*]:C/ /,/:[@]:[2]="three" LONGLIST:[012..0x12]="10 11 12 13 14 15 16 17 18" -make: Bad modifier ":[1.]" for variable "LIST" +make: in target "mod-squarebrackets-start-end": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[1.]" LIST:[1.]="" is an error -make: Bad modifier ":[1..]" for variable "LIST" +make: in target "mod-squarebrackets-start-end": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[1..]" LIST:[1..]="" is an error -make: Bad modifier ":[1.. ]" for variable "LIST" +make: in target "mod-squarebrackets-start-end": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[1.. ]" LIST:[1.. ]="" is an error LIST:[1..1]="one" -make: Bad modifier ":[1..1.]" for variable "LIST" +make: in target "mod-squarebrackets-start-end": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[1..1.]" LIST:[1..1.]="" is an error LIST:[1..2]="one two" LIST:[2..1]="two one" LIST:[3..-2]="three four five" LIST:[-4..4]="three four" -make: Bad modifier ":[0..1]" for variable "LIST" +make: in target "mod-squarebrackets-start-end": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[0..1]" LIST:[0..1]="" is an error -make: Bad modifier ":[-1..0]" for variable "LIST" +make: in target "mod-squarebrackets-start-end": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[-1..0]" LIST:[-1..0]="" is an error LIST:[-1..1]="six five four three two one" LIST:[0..0]="one two three four five six" @@ -97,7 +97,7 @@ LIST:[${ONE}]="one" LIST:[${MINUSONE}]="six" LIST:[${STAR}]="one two three four five six" LIST:[${AT}]="one two three four five six" -make: Bad modifier ":[${EMPTY" for variable "LIST" +make: in target "mod-squarebrackets-nested": while evaluating variable "LIST" with value "one two three four five six": Bad modifier ":[${EMPTY" LIST:[${EMPTY}]="" is an error LIST:[${LONGLIST:[21]:S/2//}]="one" LIST:[${LIST:[#]}]="six" @@ -123,4 +123,4 @@ LIST:tw:C/ /,/g="one two three four five six" LIST:tw:C/ /,/1g="one two three four five six" LIST:tw:tW:C/ /,/="one,two three four five six" LIST:tW:tw:C/ /,/="one two three four five six" -exit status 0 +exit status 2 diff --git a/contrib/bmake/unit-tests/varmod-shell.exp b/contrib/bmake/unit-tests/varmod-shell.exp index 208ef953728b..6ada8f74d75e 100644 --- a/contrib/bmake/unit-tests/varmod-shell.exp +++ b/contrib/bmake/unit-tests/varmod-shell.exp @@ -1,12 +1,12 @@ -make: "echo word; false" returned non-zero status -make: "echo word; false" returned non-zero status +make: "varmod-shell.mk" line 25: warning: while evaluating "${:!echo word; (exit 13)!} != "word"" with value "word": Command "echo word; (exit 13)" exited with status 13 +make: "varmod-shell.mk" line 29: warning: while evaluating "${:Uprevious value:!echo word; (exit 13)!} != "word"" with value "word": Command "echo word; (exit 13)" exited with status 13 Global: _ = # (empty) -Var_Parse: ${:!echo word; ${:Ufalse}!} (eval-keep-dollar-and-undefined) +Var_Parse: ${:!echo word; ${:U(exit 13)}!} (eval-keep-dollar-and-undefined) Evaluating modifier ${:!...} on value "" (eval-keep-dollar-and-undefined, undefined) -Modifier part: "echo word; false" -Capturing the output of command "echo word; false" -make: "echo word; false" returned non-zero status -Result of ${:!echo word; ${:Ufalse}!} is "word" (eval-keep-dollar-and-undefined, defined) +Modifier part: "echo word; (exit 13)" +Capturing the output of command "echo word; (exit 13)" +make: "varmod-shell.mk" line 36: warning: while evaluating "${:!echo word; ${:U(exit 13)}!}" with value "word": Command "echo word; (exit 13)" exited with status 13 +Result of ${:!echo word; ${:U(exit 13)}!} is "word" (eval-keep-dollar-and-undefined, defined) Global: _ = word Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 diff --git a/contrib/bmake/unit-tests/varmod-shell.mk b/contrib/bmake/unit-tests/varmod-shell.mk index d449709cee0f..87918c5bbbf6 100644 --- a/contrib/bmake/unit-tests/varmod-shell.mk +++ b/contrib/bmake/unit-tests/varmod-shell.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-shell.mk,v 1.7 2022/01/10 20:32:29 rillig Exp $ +# $NetBSD: varmod-shell.mk,v 1.10 2024/07/05 19:47:22 rillig Exp $ # # Tests for the ':!cmd!' variable modifier, which runs the shell command # given by the variable modifier and returns its output. @@ -21,16 +21,20 @@ # Between 2000-04-29 and 2020-11-17, the error message mentioned the previous # value of the expression (which is usually an empty string) instead of the # command that was executed. -.if ${:!echo word; false!} != "word" +# expect+1: warning: while evaluating "${:!echo word; (exit 13)!} != "word"" with value "word": Command "echo word; (exit 13)" exited with status 13 +.if ${:!echo word; (exit 13)!} != "word" . error .endif -.if ${:Uprevious value:!echo word; false!} != "word" +# expect+1: warning: while evaluating "${:Uprevious value:!echo word; (exit 13)!} != "word"" with value "word": Command "echo word; (exit 13)" exited with status 13 +.if ${:Uprevious value:!echo word; (exit 13)!} != "word" . error .endif -.MAKEFLAGS: -dv # to see the actual command -_:= ${:!echo word; ${:Ufalse}!} +.MAKEFLAGS: -dv # to see the "Capturing" debug output +# expect+1: warning: while evaluating "${:!echo word; ${:U(exit 13)}!}" with value "word": Command "echo word; (exit 13)" exited with status 13 +_:= ${:!echo word; ${:U(exit 13)}!} .MAKEFLAGS: -d0 + all: diff --git a/contrib/bmake/unit-tests/varmod-subst-regex.exp b/contrib/bmake/unit-tests/varmod-subst-regex.exp index 25626ba18508..722abdff5813 100644 --- a/contrib/bmake/unit-tests/varmod-subst-regex.exp +++ b/contrib/bmake/unit-tests/varmod-subst-regex.exp @@ -1,26 +1,26 @@ -make: Regex compilation error: (details omitted) +make: in target "mod-regex-compile-error": while evaluating "${:Uword1 word2:C,****,____,g:C,word,____,:Q}." with value "word1 word2": Regex compilation error: (details omitted) mod-regex-compile-error: C,word,____,:Q}. -make: No subexpression \1 -make: No subexpression \1 -make: No subexpression \1 -make: No subexpression \1 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}" with value "1 23 456": No subexpression \1 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}" with value "1 23 456": No subexpression \1 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}" with value "1 23 456": No subexpression \1 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}" with value "1 23 456": No subexpression \1 mod-regex-limits:11-missing:1 6 mod-regex-limits:11-ok:1 22 446 -make: No subexpression \2 -make: No subexpression \2 -make: No subexpression \2 -make: No subexpression \2 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}" with value "1 23 456": No subexpression \2 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}" with value "1 23 456": No subexpression \2 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}" with value "1 23 456": No subexpression \2 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}" with value "1 23 456": No subexpression \2 mod-regex-limits:22-missing:1 6 -make: No subexpression \2 -make: No subexpression \2 -make: No subexpression \2 -make: No subexpression \2 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}" with value "1 23 456": No subexpression \2 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}" with value "1 23 456": No subexpression \2 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}" with value "1 23 456": No subexpression \2 +make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}" with value "1 23 456": No subexpression \2 mod-regex-limits:22-missing:1 6 mod-regex-limits:22-ok:1 33 556 mod-regex-limits:capture:ihgfedcbaabcdefghijABCDEFGHIJa0a1a2rest -make: Regex compilation error: (details omitted) +make: in target "mod-regex-errors": while evaluating variable "UNDEF" with value "value": Regex compilation error: (details omitted) mod-regex-errors: -make: in target "mod-regex-errors": while evaluating variable "word": while evaluating "${:U:Z}y,W}": Unknown modifier "Z" +make: in target "mod-regex-errors": while evaluating variable "word" with value "word": while evaluating "${:U:Z}y,W}" with value "": Unknown modifier "Z" mod-regex-errors: xy unmatched-subexpression.ok: one one 2 3 5 8 one3 2one 34 make: No match for subexpression \2 diff --git a/contrib/bmake/unit-tests/varmod-subst.exp b/contrib/bmake/unit-tests/varmod-subst.exp index 9d88b3d6fa6f..9b91c0e50857 100644 --- a/contrib/bmake/unit-tests/varmod-subst.exp +++ b/contrib/bmake/unit-tests/varmod-subst.exp @@ -45,7 +45,7 @@ mod-subst-delimiter: 1 two 3 tilde mod-subst-chain: A B c. -make: in target "mod-subst-chain": while evaluating "${:Uvalue:S,a,x,i}.": Unknown modifier "i" +make: in target "mod-subst-chain": while evaluating "${:Uvalue:S,a,x,i}." with value "vxlue": Unknown modifier "i" . mod-subst-dollar:$1: mod-subst-dollar:$2: @@ -59,4 +59,4 @@ mod-subst-dollar:$40: mod-subst-dollar:U8: mod-subst-dollar:$$$$: mod-subst-dollar:$$$good3 -exit status 0 +exit status 2 diff --git a/contrib/bmake/unit-tests/varmod-sun-shell.exp b/contrib/bmake/unit-tests/varmod-sun-shell.exp index 7f661ff6e79e..80dec0935f28 100644 --- a/contrib/bmake/unit-tests/varmod-sun-shell.exp +++ b/contrib/bmake/unit-tests/varmod-sun-shell.exp @@ -1,12 +1,12 @@ -make: "echo word; false" returned non-zero status +make: "varmod-sun-shell.mk" line 17: warning: while evaluating variable "echo word; (exit 13)" with value "echo word; (exit 13)": Command "echo word; (exit 13)" exited with status 13 Global: _ = # (empty) -Var_Parse: ${echo word; ${:Ufalse}:L:sh} (eval-keep-dollar-and-undefined) -Evaluating modifier ${echo word; false:L} on value "" (eval-keep-dollar-and-undefined, undefined) -Result of ${echo word; false:L} is "echo word; false" (eval-keep-dollar-and-undefined, defined) -Evaluating modifier ${echo word; false:s...} on value "echo word; false" (eval-keep-dollar-and-undefined, defined) -Capturing the output of command "echo word; false" -make: "echo word; false" returned non-zero status -Result of ${echo word; false:sh} is "word" (eval-keep-dollar-and-undefined, defined) +Var_Parse: ${echo word; ${:U(exit 13)}:L:sh} (eval-keep-dollar-and-undefined) +Evaluating modifier ${echo word; (exit 13):L} on value "" (eval-keep-dollar-and-undefined, undefined) +Result of ${echo word; (exit 13):L} is "echo word; (exit 13)" (eval-keep-dollar-and-undefined, defined) +Evaluating modifier ${echo word; (exit 13):s...} on value "echo word; (exit 13)" (eval-keep-dollar-and-undefined, defined) +Capturing the output of command "echo word; (exit 13)" +make: "varmod-sun-shell.mk" line 24: warning: while evaluating variable "echo word; (exit 13)" with value "echo word; (exit 13)": Command "echo word; (exit 13)" exited with status 13 +Result of ${echo word; (exit 13):sh} is "word" (eval-keep-dollar-and-undefined, defined) Global: _ = word Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 diff --git a/contrib/bmake/unit-tests/varmod-sun-shell.mk b/contrib/bmake/unit-tests/varmod-sun-shell.mk index 97acc5bd8c0f..4a37a271eced 100644 --- a/contrib/bmake/unit-tests/varmod-sun-shell.mk +++ b/contrib/bmake/unit-tests/varmod-sun-shell.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-sun-shell.mk,v 1.2 2022/01/10 20:32:29 rillig Exp $ +# $NetBSD: varmod-sun-shell.mk,v 1.5 2024/07/04 17:47:54 rillig Exp $ # # Tests for the :sh variable modifier, which runs the shell command # given by the variable value and returns its output. @@ -12,15 +12,17 @@ . error .endif -# If the command exits with non-zero, an error message is printed. -# XXX: Processing continues as usual though. -.if ${echo word; false:L:sh} != "word" +# If the command exits with non-zero, a warning is printed. +# expect+1: warning: while evaluating variable "echo word; (exit 13)" with value "echo word; (exit 13)": Command "echo word; (exit 13)" exited with status 13 +.if ${echo word; (exit 13):L:sh} != "word" . error .endif -.MAKEFLAGS: -dv # to see the actual command -_:= ${echo word; ${:Ufalse}:L:sh} +.MAKEFLAGS: -dv # to see the "Capturing" debug output +# expect+1: warning: while evaluating variable "echo word; (exit 13)" with value "echo word; (exit 13)": Command "echo word; (exit 13)" exited with status 13 +_:= ${echo word; ${:U(exit 13)}:L:sh} .MAKEFLAGS: -d0 + all: diff --git a/contrib/bmake/unit-tests/varmod-sysv.exp b/contrib/bmake/unit-tests/varmod-sysv.exp index fe88ebd0a306..be87193b4066 100644 --- a/contrib/bmake/unit-tests/varmod-sysv.exp +++ b/contrib/bmake/unit-tests/varmod-sysv.exp @@ -1,5 +1,5 @@ -make: Unfinished modifier for "word214" ('=' missing) -make: "varmod-sysv.mk" line 215: Malformed conditional (${word214:L:from${:D=}to}) +make: "varmod-sysv.mk" line 216: while evaluating variable "word216" with value "word216": Unfinished modifier ('=' missing) +make: "varmod-sysv.mk" line 216: Malformed conditional (${word216:L:from${:D=}to}) word modifier result '' = "" suffix = "suffix" @@ -145,8 +145,8 @@ pre-middle-suffix pre%ffix=NPre% "NPre-middle-su" suffix pre%ffix=NPre%NS "suffix" prefix pre%ffix=NPre%NS "prefix" pre-middle-suffix pre%ffix=NPre%NS "NPre-middle-suNS" -make: Unfinished modifier for "error" ('}' missing) -make: "varmod-sysv.mk" line 259: Malformed conditional (${error:L:from=$(})) +make: "varmod-sysv.mk" line 261: while evaluating variable "error" with value "error": Unfinished modifier ('}' missing) +make: "varmod-sysv.mk" line 261: Malformed conditional (${error:L:from=$(})) make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-sysv.mk b/contrib/bmake/unit-tests/varmod-sysv.mk index d37c33e47229..8db41d7fb364 100644 --- a/contrib/bmake/unit-tests/varmod-sysv.mk +++ b/contrib/bmake/unit-tests/varmod-sysv.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-sysv.mk,v 1.17 2024/06/01 18:44:05 rillig Exp $ +# $NetBSD: varmod-sysv.mk,v 1.19 2024/07/04 17:47:54 rillig Exp $ # # Tests for the variable modifier ':from=to', which replaces the suffix # "from" with "to". It can also use '%' as a wildcard. @@ -208,11 +208,12 @@ # This is not a SysV modifier since the nested expression expands # to an empty string. The '=' in it should be irrelevant during parsing. -# XXX: As of 2020-12-05, this expression generates an "Unfinished modifier" +# XXX: As of 2024-06-30, this expression generates an "Unfinished modifier" # error, while the correct error message would be "Unknown modifier" since # there is no modifier named "fromto". -# expect+1: Malformed conditional (${word214:L:from${:D=}to}) -.if ${word214:L:from${:D=}to} +# expect+2: while evaluating variable "word216" with value "word216": Unfinished modifier ('=' missing) +# expect+1: Malformed conditional (${word216:L:from${:D=}to}) +.if ${word216:L:from${:D=}to} . error .endif @@ -255,6 +256,7 @@ INDIRECT= 1:${VALUE} 2:$${VALUE} 4:$$$${VALUE} # The error case of an unfinished ':from=to' modifier after the '=' requires # an expression that is missing the closing '}'. +# expect+2: while evaluating variable "error" with value "error": Unfinished modifier ('}' missing) # expect+1: Malformed conditional (${error:L:from=$(})) .if ${error:L:from=$(}) .endif diff --git a/contrib/bmake/unit-tests/varmod-to-separator.exp b/contrib/bmake/unit-tests/varmod-to-separator.exp index 586b19f123b5..fe61ada505df 100644 --- a/contrib/bmake/unit-tests/varmod-to-separator.exp +++ b/contrib/bmake/unit-tests/varmod-to-separator.exp @@ -1,29 +1,29 @@ -make: "varmod-to-separator.mk" line 155: while evaluating variable "WORDS": Invalid character number at "400:tu}" +make: "varmod-to-separator.mk" line 155: while evaluating variable "WORDS" with value "one two three": Invalid character number at "400:tu}" make: "varmod-to-separator.mk" line 155: Malformed conditional (${WORDS:[1..3]:ts\400:tu}) -make: "varmod-to-separator.mk" line 171: while evaluating variable "WORDS": Invalid character number at "100:tu}" +make: "varmod-to-separator.mk" line 171: while evaluating variable "WORDS" with value "one two three": Invalid character number at "100:tu}" make: "varmod-to-separator.mk" line 171: Malformed conditional (${WORDS:[1..3]:ts\x100:tu}) -make: "varmod-to-separator.mk" line 180: while evaluating variable "word": Invalid character number at ",}" +make: "varmod-to-separator.mk" line 180: while evaluating variable "word" with value "word": Invalid character number at ",}" make: "varmod-to-separator.mk" line 180: Malformed conditional (${word:L:ts\x,}) -make: "varmod-to-separator.mk" line 187: while evaluating variable "word": Invalid character number at "112233445566778899}" +make: "varmod-to-separator.mk" line 187: while evaluating variable "word" with value "word": Invalid character number at "112233445566778899}" make: "varmod-to-separator.mk" line 187: Malformed conditional (${word:L:ts\x112233445566778899}) -make: Bad modifier ":ts\-300" for variable "WORDS" -make: "varmod-to-separator.mk" line 192: Malformed conditional (${WORDS:[1..3]:ts\-300:tu}) -make: Bad modifier ":ts\8" for variable "1 2 3" -make: "varmod-to-separator.mk" line 201: Malformed conditional (${1 2 3:L:ts\8:tu}) -make: Bad modifier ":ts\100L" for variable "1 2 3" -make: "varmod-to-separator.mk" line 209: Malformed conditional (${1 2 3:L:ts\100L}) -make: Bad modifier ":ts\x40g" for variable "1 2 3" -make: "varmod-to-separator.mk" line 217: Malformed conditional (${1 2 3:L:ts\x40g}) -make: Bad modifier ":tx" for variable "WORDS" -make: "varmod-to-separator.mk" line 227: Malformed conditional (${WORDS:tx}) -make: Bad modifier ":ts\X" for variable "WORDS" -make: "varmod-to-separator.mk" line 236: Malformed conditional (${WORDS:ts\X}) -make: Bad modifier ":t\X" for variable "WORDS" -make: "varmod-to-separator.mk" line 245: Malformed conditional (${WORDS:t\X} != "anything") -make: Bad modifier ":ts\69" for variable "" -make: "varmod-to-separator.mk" line 262: Malformed conditional (${:Ua b:ts\69}) -make: "varmod-to-separator.mk" line 271: while evaluating "${:Ua b:ts\x1F60E}": Invalid character number at "1F60E}" -make: "varmod-to-separator.mk" line 271: Malformed conditional (${:Ua b:ts\x1F60E}) +make: "varmod-to-separator.mk" line 193: while evaluating variable "WORDS" with value "one two three": Bad modifier ":ts\-300" +make: "varmod-to-separator.mk" line 193: Malformed conditional (${WORDS:[1..3]:ts\-300:tu}) +make: "varmod-to-separator.mk" line 203: while evaluating variable "1 2 3" with value "1 2 3": Bad modifier ":ts\8" +make: "varmod-to-separator.mk" line 203: Malformed conditional (${1 2 3:L:ts\8:tu}) +make: "varmod-to-separator.mk" line 212: while evaluating variable "1 2 3" with value "1 2 3": Bad modifier ":ts\100L" +make: "varmod-to-separator.mk" line 212: Malformed conditional (${1 2 3:L:ts\100L}) +make: "varmod-to-separator.mk" line 221: while evaluating variable "1 2 3" with value "1 2 3": Bad modifier ":ts\x40g" +make: "varmod-to-separator.mk" line 221: Malformed conditional (${1 2 3:L:ts\x40g}) +make: "varmod-to-separator.mk" line 231: while evaluating variable "WORDS" with value "one two three four five six": Bad modifier ":tx" +make: "varmod-to-separator.mk" line 231: Malformed conditional (${WORDS:tx}) +make: "varmod-to-separator.mk" line 240: while evaluating variable "WORDS" with value "one two three four five six": Bad modifier ":ts\X" +make: "varmod-to-separator.mk" line 240: Malformed conditional (${WORDS:ts\X}) +make: "varmod-to-separator.mk" line 250: while evaluating variable "WORDS" with value "one two three four five six": Bad modifier ":t\X" +make: "varmod-to-separator.mk" line 250: Malformed conditional (${WORDS:t\X} != "anything") +make: "varmod-to-separator.mk" line 267: while evaluating "${:Ua b:ts\69}" with value "a b": Bad modifier ":ts\69" +make: "varmod-to-separator.mk" line 267: Malformed conditional (${:Ua b:ts\69}) +make: "varmod-to-separator.mk" line 276: while evaluating "${:Ua b:ts\x1F60E}" with value "a b": Invalid character number at "1F60E}" +make: "varmod-to-separator.mk" line 276: Malformed conditional (${:Ua b:ts\x1F60E}) make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod-to-separator.mk b/contrib/bmake/unit-tests/varmod-to-separator.mk index ec48dacbb60c..b4c6839a0a2b 100644 --- a/contrib/bmake/unit-tests/varmod-to-separator.mk +++ b/contrib/bmake/unit-tests/varmod-to-separator.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod-to-separator.mk,v 1.15 2024/06/01 18:44:05 rillig Exp $ +# $NetBSD: varmod-to-separator.mk,v 1.18 2024/07/05 19:47:22 rillig Exp $ # # Tests for the :ts variable modifier, which joins the words of the variable # using an arbitrary character as word separator. @@ -150,7 +150,7 @@ WORDS= one two three four five six # for an unsigned character though. # # Since 2020-11-01, these out-of-bounds values are rejected. -# expect+2: while evaluating variable "WORDS": Invalid character number at "400:tu}" +# expect+2: while evaluating variable "WORDS" with value "one two three": Invalid character number at "400:tu}" # expect+1: Malformed conditional (${WORDS:[1..3]:ts\400:tu}) .if ${WORDS:[1..3]:ts\400:tu} . warning The separator \400 is accepted even though it is out of bounds. @@ -166,7 +166,7 @@ WORDS= one two three four five six # The hexadecimal number must be in the range of an unsigned char. # # Since 2020-11-01, these out-of-bounds values are rejected. -# expect+2: while evaluating variable "WORDS": Invalid character number at "100:tu}" +# expect+2: while evaluating variable "WORDS" with value "one two three": Invalid character number at "100:tu}" # expect+1: Malformed conditional (${WORDS:[1..3]:ts\x100:tu}) .if ${WORDS:[1..3]:ts\x100:tu} . warning The separator \x100 is accepted even though it is out of bounds. @@ -175,19 +175,20 @@ WORDS= one two three four five six .endif # The number after ':ts\x' must be hexadecimal. -# expect+2: while evaluating variable "word": Invalid character number at ",}" +# expect+2: while evaluating variable "word" with value "word": Invalid character number at ",}" # expect+1: Malformed conditional (${word:L:ts\x,}) .if ${word:L:ts\x,} .endif # The hexadecimal number must be in the range of 'unsigned long' on all # supported platforms. -# expect+2: while evaluating variable "word": Invalid character number at "112233445566778899}" +# expect+2: while evaluating variable "word" with value "word": Invalid character number at "112233445566778899}" # expect+1: Malformed conditional (${word:L:ts\x112233445566778899}) .if ${word:L:ts\x112233445566778899} .endif # Negative numbers are not allowed for the separator character. +# expect+2: while evaluating variable "WORDS" with value "one two three": Bad modifier ":ts\-300" # expect+1: Malformed conditional (${WORDS:[1..3]:ts\-300:tu}) .if ${WORDS:[1..3]:ts\-300:tu} . warning The separator \-300 is accepted even though it is negative. @@ -197,6 +198,7 @@ WORDS= one two three four five six # The character number is interpreted as octal number by default. # The digit '8' is not an octal digit though. +# expect+2: while evaluating variable "1 2 3" with value "1 2 3": Bad modifier ":ts\8" # expect+1: Malformed conditional (${1 2 3:L:ts\8:tu}) .if ${1 2 3:L:ts\8:tu} . warning The separator \8 is accepted even though it is not octal. @@ -205,6 +207,7 @@ WORDS= one two three four five six .endif # Trailing characters after the octal character number are rejected. +# expect+2: while evaluating variable "1 2 3" with value "1 2 3": Bad modifier ":ts\100L" # expect+1: Malformed conditional (${1 2 3:L:ts\100L}) .if ${1 2 3:L:ts\100L} . warning The separator \100L is accepted even though it contains an 'L'. @@ -213,6 +216,7 @@ WORDS= one two three four five six .endif # Trailing characters after the hexadecimal character number are rejected. +# expect+2: while evaluating variable "1 2 3" with value "1 2 3": Bad modifier ":ts\x40g" # expect+1: Malformed conditional (${1 2 3:L:ts\x40g}) .if ${1 2 3:L:ts\x40g} . warning The separator \x40g is accepted even though it contains a 'g'. @@ -222,7 +226,7 @@ WORDS= one two three four five six # In the :t modifier, the :t must be followed by any of A, l, s, u. -# expect: make: Bad modifier ":tx" for variable "WORDS" +# expect+2: while evaluating variable "WORDS" with value "one two three four five six": Bad modifier ":tx" # expect+1: Malformed conditional (${WORDS:tx}) .if ${WORDS:tx} . error @@ -231,7 +235,7 @@ WORDS= one two three four five six .endif # The word separator can only be a single character. -# expect: make: Bad modifier ":ts\X" for variable "WORDS" +# expect+2: while evaluating variable "WORDS" with value "one two three four five six": Bad modifier ":ts\X" # expect+1: Malformed conditional (${WORDS:ts\X}) .if ${WORDS:ts\X} . error @@ -241,6 +245,7 @@ WORDS= one two three four five six # After the backslash, only n, t, an octal number, or x and a hexadecimal # number are allowed. +# expect+2: while evaluating variable "WORDS" with value "one two three four five six": Bad modifier ":t\X" # expect+1: Malformed conditional (${WORDS:t\X} != "anything") .if ${WORDS:t\X} != "anything" . info This line is not reached. @@ -257,7 +262,7 @@ WORDS= one two three four five six # happens for non-octal digits. From 2003.07.23.18.06.46 to # 2016.02.27.16.20.06, the result was '1E2', since 2016.03.07.20.20.35 make no # longer accepts this escape and complains. -# expect: make: Bad modifier ":ts\69" for variable "" +# expect+2: while evaluating "${:Ua b:ts\69}" with value "a b": Bad modifier ":ts\69" # expect+1: Malformed conditional (${:Ua b:ts\69}) .if ${:Ua b:ts\69} . error @@ -266,7 +271,7 @@ WORDS= one two three four five six .endif # Try whether bmake is Unicode-ready. -# expect+2: while evaluating "${:Ua b:ts\x1F60E}": Invalid character number at "1F60E}" +# expect+2: while evaluating "${:Ua b:ts\x1F60E}" with value "a b": Invalid character number at "1F60E}" # expect+1: Malformed conditional (${:Ua b:ts\x1F60E}) .if ${:Ua b:ts\x1F60E} # U+1F60E "smiling face with sunglasses" . error diff --git a/contrib/bmake/unit-tests/varmod-to-title.exp b/contrib/bmake/unit-tests/varmod-to-title.exp new file mode 100644 index 000000000000..39a9383953dd --- /dev/null +++ b/contrib/bmake/unit-tests/varmod-to-title.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/contrib/bmake/unit-tests/varmod-to-title.mk b/contrib/bmake/unit-tests/varmod-to-title.mk new file mode 100644 index 000000000000..f99e5441a8fb --- /dev/null +++ b/contrib/bmake/unit-tests/varmod-to-title.mk @@ -0,0 +1,31 @@ +# $NetBSD: varmod-to-title.mk,v 1.1 2024/07/01 21:02:26 sjg Exp $ +# +# Tests for the :tc variable modifier, which converts the expression value +# to lowercase. +# +# TODO: What about non-ASCII characters? ISO-8859-1, UTF-8? + +.if ${:UUPPER:tt} != "Upper" +. error +.endif + +.if ${:Ulower:tt} != "Lower" +. error +.endif + +.if ${:UMixeD case.:tt} != "Mixed Case." +. error +.endif + +# The ':tt' modifier works on the whole string, without splitting it into +# words. +.if ${:Umultiple spaces:tt} != "Multiple Spaces" +. error +.endif + +# Note words only count if separated by spaces +.if ${:Uthis&that or os/2:tt} != "This&that Or Os/2" +. error +.endif + +all: .PHONY diff --git a/contrib/bmake/unit-tests/varmod.exp b/contrib/bmake/unit-tests/varmod.exp index e619555d56cb..0948b585a477 100644 --- a/contrib/bmake/unit-tests/varmod.exp +++ b/contrib/bmake/unit-tests/varmod.exp @@ -1,33 +1,33 @@ make: "varmod.mk" line 101: To escape a dollar, use \$, not $$, at "$$:L} != """ make: "varmod.mk" line 101: Invalid variable name ':', at "$:L} != """ -make: "varmod.mk" line 107: while evaluating "${:Uword:@word@${word}$@} != "word"": Dollar followed by nothing -make: "varmod.mk" line 117: while evaluating variable "VAR": Missing delimiter ':' after modifier "P" +make: "varmod.mk" line 107: while evaluating "${:Uword:@word@${word}$@} != "word"" with value "word": Dollar followed by nothing +make: "varmod.mk" line 117: while evaluating variable "VAR" with value "VAR": Missing delimiter ':' after modifier "P" make: "varmod.mk" line 119: Missing argument for ".error" -make: Bad modifier ":[99333000222000111000]" for variable "word" -make: "varmod.mk" line 125: Malformed conditional (${word:L:[99333000222000111000]}) -make: Bad modifier ":[2147483648]" for variable "word" -make: "varmod.mk" line 128: Malformed conditional (${word:L:[2147483648]}) -make: "varmod.mk" line 135: while evaluating variable "word": Invalid number "99333000222000111000}" for ':range' modifier -make: "varmod.mk" line 135: Malformed conditional (${word:L:range=99333000222000111000}) -make: "varmod.mk" line 143: while evaluating "${:${:Ugmtime=\\}}": Invalid time value "\" -make: "varmod.mk" line 143: Malformed conditional (${:${:Ugmtime=\\}}) -make: "varmod.mk" line 158: while evaluating variable "VAR": Dollar followed by nothing -make: "varmod.mk" line 164: while evaluating variable "VAR": Dollar followed by nothing -make: "varmod.mk" line 164: while evaluating variable "VAR": Dollar followed by nothing -make: "varmod.mk" line 174: while evaluating variable "word": Dollar followed by nothing -make: Bad modifier ":[$]" for variable "word" -make: "varmod.mk" line 179: Malformed conditional (${word:[$]}) -make: "varmod.mk" line 196: while evaluating variable "VAR": Dollar followed by nothing -make: "varmod.mk" line 196: while evaluating variable "VAR": Invalid variable name '}', at "$} != "set"" -make: "varmod.mk" line 200: while evaluating "${:Ufallback$} != "fallback"": Invalid variable name '}', at "$} != "fallback"" -make: "varmod.mk" line 205: while evaluating variable "%y": Invalid time value "1000$" -make: "varmod.mk" line 205: Malformed conditional (${%y:L:gmtime=1000$}) -make: "varmod.mk" line 212: while evaluating variable "%y": Invalid time value "1000$" -make: "varmod.mk" line 212: Malformed conditional (${%y:L:localtime=1000$}) -make: "varmod.mk" line 218: while evaluating variable "word": Dollar followed by nothing -make: "varmod.mk" line 222: while evaluating variable "word": Dollar followed by nothing -make: "varmod.mk" line 227: while evaluating variable ".": Invalid argument 'fallback$' for modifier ':mtime' -make: "varmod.mk" line 227: Malformed conditional (${.:L:mtime=fallback$}) +make: "varmod.mk" line 126: while evaluating variable "word" with value "word": Bad modifier ":[99333000222000111000]" +make: "varmod.mk" line 126: Malformed conditional (${word:L:[99333000222000111000]}) +make: "varmod.mk" line 130: while evaluating variable "word" with value "word": Bad modifier ":[2147483648]" +make: "varmod.mk" line 130: Malformed conditional (${word:L:[2147483648]}) +make: "varmod.mk" line 137: while evaluating variable "word" with value "word": Invalid number "99333000222000111000}" for ':range' modifier +make: "varmod.mk" line 137: Malformed conditional (${word:L:range=99333000222000111000}) +make: "varmod.mk" line 145: while evaluating "${:${:Ugmtime=\\}}" with value "": Invalid time value "\" +make: "varmod.mk" line 145: Malformed conditional (${:${:Ugmtime=\\}}) +make: "varmod.mk" line 160: while evaluating variable "VAR" with value "value$": Dollar followed by nothing +make: "varmod.mk" line 166: while evaluating variable "VAR" with value "value$": Dollar followed by nothing +make: "varmod.mk" line 166: while evaluating variable "VAR" with value "value$ appended$": Dollar followed by nothing +make: "varmod.mk" line 176: while evaluating variable "word" with value "word": Dollar followed by nothing +make: "varmod.mk" line 181: while evaluating variable "word" with value "": Bad modifier ":[$]" +make: "varmod.mk" line 181: Malformed conditional (${word:[$]}) +make: "varmod.mk" line 198: while evaluating variable "VAR" with value "value$ appended$": Dollar followed by nothing +make: "varmod.mk" line 198: while evaluating variable "VAR" with value "valueappended": Invalid variable name '}', at "$} != "set"" +make: "varmod.mk" line 202: while evaluating "${:Ufallback$} != "fallback"" with value "": Invalid variable name '}', at "$} != "fallback"" +make: "varmod.mk" line 207: while evaluating variable "%y" with value "%y": Invalid time value "1000$" +make: "varmod.mk" line 207: Malformed conditional (${%y:L:gmtime=1000$}) +make: "varmod.mk" line 214: while evaluating variable "%y" with value "%y": Invalid time value "1000$" +make: "varmod.mk" line 214: Malformed conditional (${%y:L:localtime=1000$}) +make: "varmod.mk" line 220: while evaluating variable "word" with value "word": Dollar followed by nothing +make: "varmod.mk" line 224: while evaluating variable "word" with value "word": Dollar followed by nothing +make: "varmod.mk" line 229: while evaluating variable "." with value ".": Invalid argument 'fallback$' for modifier ':mtime' +make: "varmod.mk" line 229: Malformed conditional (${.:L:mtime=fallback$}) make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varmod.mk b/contrib/bmake/unit-tests/varmod.mk index 783f2e329b4a..fbb60d80680f 100644 --- a/contrib/bmake/unit-tests/varmod.mk +++ b/contrib/bmake/unit-tests/varmod.mk @@ -1,4 +1,4 @@ -# $NetBSD: varmod.mk,v 1.15 2024/06/06 20:41:50 rillig Exp $ +# $NetBSD: varmod.mk,v 1.18 2024/07/05 19:47:22 rillig Exp $ # # Tests for variable modifiers, such as :Q, :S,from,to or :Ufallback. # @@ -103,7 +103,7 @@ DOLLAR2= ${:U\$} .endif # A '$' followed by nothing is an error as well. -# expect+1: while evaluating "${:Uword:@word@${word}$@} != "word"": Dollar followed by nothing +# expect+1: while evaluating "${:Uword:@word@${word}$@} != "word"" with value "word": Dollar followed by nothing .if ${:Uword:@word@${word}$@} != "word" . error .endif @@ -113,7 +113,7 @@ DOLLAR2= ${:U\$} # XXX: The .error should not be reached since the expression is # malformed, and this error should be propagated up to Cond_EvalLine. VAR= STOP -# expect+1: while evaluating variable "VAR": Missing delimiter ':' after modifier "P" +# expect+1: while evaluating variable "VAR" with value "VAR": Missing delimiter ':' after modifier "P" .if ${VAR:P=RE} != "STORE" # expect+1: Missing argument for ".error" . error @@ -121,9 +121,11 @@ VAR= STOP # Test the word selection modifier ':[n]' with a very large number that is # larger than ULONG_MAX for any supported platform. +# expect+2: while evaluating variable "word" with value "word": Bad modifier ":[99333000222000111000]" # expect+1: Malformed conditional (${word:L:[99333000222000111000]}) .if ${word:L:[99333000222000111000]} .endif +# expect+2: while evaluating variable "word" with value "word": Bad modifier ":[2147483648]" # expect+1: Malformed conditional (${word:L:[2147483648]}) .if ${word:L:[2147483648]} .endif @@ -131,14 +133,14 @@ VAR= STOP # Test the range generation modifier ':range=n' with a very large number that # is larger than SIZE_MAX for any supported platform. # expect+2: Malformed conditional (${word:L:range=99333000222000111000}) -# expect+1: while evaluating variable "word": Invalid number "99333000222000111000}" for ':range' modifier +# expect+1: while evaluating variable "word" with value "word": Invalid number "99333000222000111000}" for ':range' modifier .if ${word:L:range=99333000222000111000} .endif # In an indirect modifier, the delimiter is '\0', which at the same time marks # the end of the string. The sequence '\\' '\0' is not an escaped delimiter, # as it would be wrong to skip past the end of the string. -# expect+2: while evaluating "${:${:Ugmtime=\\}}": Invalid time value "\" +# expect+2: while evaluating "${:${:Ugmtime=\\}}" with value "": Invalid time value "\" # expect+1: Malformed conditional (${:${:Ugmtime=\\}}) .if ${:${:Ugmtime=\\}} . error @@ -154,13 +156,13 @@ VAR= STOP .if ${:U:!printf '%s\n' $!} != "\$" . error .endif -# expect+1: while evaluating variable "VAR": Dollar followed by nothing +# expect+1: while evaluating variable "VAR" with value "value$": Dollar followed by nothing .if ${VAR::=value$} != "" || ${VAR} != "value" . error .endif ${:U }= -# expect+2: while evaluating variable "VAR": Dollar followed by nothing -# expect+1: while evaluating variable "VAR": Dollar followed by nothing +# expect+2: while evaluating variable "VAR" with value "value$": Dollar followed by nothing +# expect+1: while evaluating variable "VAR" with value "value$ appended$": Dollar followed by nothing .if ${VAR::+=appended$} != "" || ${VAR} != "valueappended" . error .endif @@ -170,11 +172,11 @@ ${:U }= .if ${0:?then$:else$} != "else\$" . error .endif -# expect+1: while evaluating variable "word": Dollar followed by nothing +# expect+1: while evaluating variable "word" with value "word": Dollar followed by nothing .if ${word:L:@w@$w$@} != "word" . error .endif -# expect: make: Bad modifier ":[$]" for variable "word" +# expect+2: while evaluating variable "word" with value "": Bad modifier ":[$]" # expect+1: Malformed conditional (${word:[$]}) .if ${word:[$]} . error @@ -191,38 +193,38 @@ VAR_DOLLAR= VAR$$ .if ${word:L:C,d,$,} != "wor\$" . error .endif -# expect+2: while evaluating variable "VAR": Invalid variable name '}', at "$} != "set"" -# expect+1: while evaluating variable "VAR": Dollar followed by nothing +# expect+2: while evaluating variable "VAR" with value "value$ appended$": Dollar followed by nothing +# expect+1: while evaluating variable "VAR" with value "valueappended": Invalid variable name '}', at "$} != "set"" .if ${VAR:Dset$} != "set" . error .endif -# expect+1: while evaluating "${:Ufallback$} != "fallback"": Invalid variable name '}', at "$} != "fallback"" +# expect+1: while evaluating "${:Ufallback$} != "fallback"" with value "": Invalid variable name '}', at "$} != "fallback"" .if ${:Ufallback$} != "fallback" . error .endif # expect+2: Malformed conditional (${%y:L:gmtime=1000$}) -# expect+1: while evaluating variable "%y": Invalid time value "1000$" +# expect+1: while evaluating variable "%y" with value "%y": Invalid time value "1000$" .if ${%y:L:gmtime=1000$} . error .else . error .endif # expect+2: Malformed conditional (${%y:L:localtime=1000$}) -# expect+1: while evaluating variable "%y": Invalid time value "1000$" +# expect+1: while evaluating variable "%y" with value "%y": Invalid time value "1000$" .if ${%y:L:localtime=1000$} . error .else . error .endif -# expect+1: while evaluating variable "word": Dollar followed by nothing +# expect+1: while evaluating variable "word" with value "word": Dollar followed by nothing .if ${word:L:Mw*$} != "word" . error .endif -# expect+1: while evaluating variable "word": Dollar followed by nothing +# expect+1: while evaluating variable "word" with value "word": Dollar followed by nothing .if ${word:L:NX*$} != "word" . error .endif -# expect+2: while evaluating variable ".": Invalid argument 'fallback$' for modifier ':mtime' +# expect+2: while evaluating variable "." with value ".": Invalid argument 'fallback$' for modifier ':mtime' # expect+1: Malformed conditional (${.:L:mtime=fallback$}) .if ${.:L:mtime=fallback$} . error diff --git a/contrib/bmake/unit-tests/varname-dot-newline.exp b/contrib/bmake/unit-tests/varname-dot-newline.exp index 74b69a5f250b..6817b2a26339 100644 --- a/contrib/bmake/unit-tests/varname-dot-newline.exp +++ b/contrib/bmake/unit-tests/varname-dot-newline.exp @@ -1,8 +1,11 @@ make: "varname-dot-newline.mk" line 28: Cannot overwrite ".newline" as it is read-only + in directory make: "varname-dot-newline.mk" line 30: Cannot append to ".newline" as it is read-only + in directory make: "varname-dot-newline.mk" line 32: Cannot delete ".newline" as it is read-only + in directory make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "try-to-modify" in unit-tests first second backslash newline: <\ diff --git a/contrib/bmake/unit-tests/varname-make_print_var_on_error-jobs.exp b/contrib/bmake/unit-tests/varname-make_print_var_on_error-jobs.exp index 81bea0e99ae9..abb8448be90e 100644 --- a/contrib/bmake/unit-tests/varname-make_print_var_on_error-jobs.exp +++ b/contrib/bmake/unit-tests/varname-make_print_var_on_error-jobs.exp @@ -2,7 +2,7 @@ echo fail all; false 'all' '${.TARGET}' '$${.TARGET}' fail all *** [all] Error code 1 -make: stopped in unit-tests +make: stopped making "all" in unit-tests .ERROR_TARGET='all' .ERROR_CMD='@: before '${.TARGET}' '${.TARGET}' '$${.TARGET}' echo fail ${.TARGET}; false '${.TARGET}' '${.TARGET}' '$${.TARGET}' @: after '${.TARGET}' '${.TARGET}' '$${.TARGET}'' exit status 1 diff --git a/contrib/bmake/unit-tests/varname-make_print_var_on_error.exp b/contrib/bmake/unit-tests/varname-make_print_var_on_error.exp index f23deb3568d6..5ced518b3e3f 100644 --- a/contrib/bmake/unit-tests/varname-make_print_var_on_error.exp +++ b/contrib/bmake/unit-tests/varname-make_print_var_on_error.exp @@ -3,7 +3,7 @@ fail all *** Error code 1 (continuing) Stop. -make: stopped in unit-tests +make: stopped making "all" in unit-tests .ERROR_TARGET='all' .ERROR_CMD='' exit status 1 diff --git a/contrib/bmake/unit-tests/varname.exp b/contrib/bmake/unit-tests/varname.exp index 640f228f8a51..9351b0761e98 100644 --- a/contrib/bmake/unit-tests/varname.exp +++ b/contrib/bmake/unit-tests/varname.exp @@ -17,5 +17,5 @@ Global: VAR((( = try3 Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests +make: stopped making "all" in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varparse-errors.exp b/contrib/bmake/unit-tests/varparse-errors.exp index 20fee23bddae..9ca443c6fd67 100644 --- a/contrib/bmake/unit-tests/varparse-errors.exp +++ b/contrib/bmake/unit-tests/varparse-errors.exp @@ -1,25 +1,25 @@ -make: "varparse-errors.mk" line 38: while evaluating "${:U:Z}": Unknown modifier "Z" -make: "varparse-errors.mk" line 47: while evaluating "${:U:Z}post": Unknown modifier "Z" -make: Bad modifier ":OX" for variable "" -make: "varparse-errors.mk" line 71: Undefined variable "${:U:OX" -make: Bad modifier ":OX" for variable "" -make: Bad modifier ":OX" for variable "" -make: "varparse-errors.mk" line 71: Undefined variable "${:U:OX" -make: Bad modifier ":OX" for variable "" -make: Unclosed expression, expecting '}' for modifier "Q" of variable "" with value "" -make: Unclosed expression, expecting '}' for modifier "sh" of variable "" with value "" -make: Unclosed expression, expecting '}' for modifier "tA" of variable "" with value "" -make: Unclosed expression, expecting '}' for modifier "tsX" of variable "" with value "" -make: Unclosed expression, expecting '}' for modifier "ts" of variable "" with value "" -make: Unclosed expression, expecting '}' for modifier "ts\040" of variable "" with value "" -make: Unclosed expression, expecting '}' for modifier "u" of variable "" with value "" -make: Unclosed expression, expecting '}' for modifier "H" of variable "" with value "." -make: Unclosed expression, expecting '}' for modifier "[1]" of variable "" with value "" -make: Unclosed expression, expecting '}' for modifier "hash" of variable "" with value "b2af338b" -make: Unclosed expression, expecting '}' for modifier "range" of variable "" with value "1" -make: Unclosed expression, expecting '}' for modifier "_" of variable "" with value "" -make: Unclosed expression, expecting '}' for modifier "gmtime" of variable "" with value "" -make: Unclosed expression, expecting '}' for modifier "localtime" of variable "" with value "" +make: "varparse-errors.mk" line 38: while evaluating "${:U:Z}" with value "": Unknown modifier "Z" +make: "varparse-errors.mk" line 47: while evaluating "${:U:Z}post" with value "": Unknown modifier "Z" +make: "varparse-errors.mk" line 75: while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}" with value "": Bad modifier ":OX" +make: "varparse-errors.mk" line 75: Undefined variable "${:U:OX" +make: "varparse-errors.mk" line 75: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX" +make: "varparse-errors.mk" line 75: while evaluating "${:U:OX:U${IND}}" with value "": Bad modifier ":OX" +make: "varparse-errors.mk" line 75: Undefined variable "${:U:OX" +make: "varparse-errors.mk" line 75: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX" +make: "varparse-errors.mk" line 83: while evaluating "${:U:Q" with value "": Unclosed expression, expecting '}' for modifier "Q" +make: "varparse-errors.mk" line 85: while evaluating "${:U:sh" with value "": Unclosed expression, expecting '}' for modifier "sh" +make: "varparse-errors.mk" line 87: while evaluating "${:U:tA" with value "": Unclosed expression, expecting '}' for modifier "tA" +make: "varparse-errors.mk" line 89: while evaluating "${:U:tsX" with value "": Unclosed expression, expecting '}' for modifier "tsX" +make: "varparse-errors.mk" line 91: while evaluating "${:U:ts" with value "": Unclosed expression, expecting '}' for modifier "ts" +make: "varparse-errors.mk" line 93: while evaluating "${:U:ts\040" with value "": Unclosed expression, expecting '}' for modifier "ts\040" +make: "varparse-errors.mk" line 95: while evaluating "${:U:u" with value "": Unclosed expression, expecting '}' for modifier "u" +make: "varparse-errors.mk" line 97: while evaluating "${:U:H" with value ".": Unclosed expression, expecting '}' for modifier "H" +make: "varparse-errors.mk" line 99: while evaluating "${:U:[1]" with value "": Unclosed expression, expecting '}' for modifier "[1]" +make: "varparse-errors.mk" line 101: while evaluating "${:U:hash" with value "b2af338b": Unclosed expression, expecting '}' for modifier "hash" +make: "varparse-errors.mk" line 103: while evaluating "${:U:range" with value "1": Unclosed expression, expecting '}' for modifier "range" +make: "varparse-errors.mk" line 105: while evaluating "${:U:_" with value "": Unclosed expression, expecting '}' for modifier "_" +make: "varparse-errors.mk" line 107: while evaluating "${:U:gmtime" with value "": Unclosed expression, expecting '}' for modifier "gmtime" +make: "varparse-errors.mk" line 109: while evaluating "${:U:localtime" with value "": Unclosed expression, expecting '}' for modifier "localtime" make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 diff --git a/contrib/bmake/unit-tests/varparse-errors.mk b/contrib/bmake/unit-tests/varparse-errors.mk index f40e7206b0c3..d10160b816e5 100644 --- a/contrib/bmake/unit-tests/varparse-errors.mk +++ b/contrib/bmake/unit-tests/varparse-errors.mk @@ -1,4 +1,4 @@ -# $NetBSD: varparse-errors.mk,v 1.13 2024/06/02 15:31:26 rillig Exp $ +# $NetBSD: varparse-errors.mk,v 1.17 2024/07/05 19:47:22 rillig Exp $ # Tests for parsing and evaluating all kinds of expressions. # @@ -34,7 +34,7 @@ ERR_EVAL= An evaluation error ${:Uvalue:C,.,\3,}. # As of 2020-12-01, errors in the variable name are silently ignored. # Since var.c 1.754 from 2020-12-20, unknown modifiers at parse time result # in an error message and a non-zero exit status. -# expect+1: while evaluating "${:U:Z}": Unknown modifier "Z" +# expect+1: while evaluating "${:U:Z}" with value "": Unknown modifier "Z" VAR.${:U:Z}= unknown modifier in the variable name .if ${VAR.} != "unknown modifier in the variable name" . error @@ -43,7 +43,7 @@ VAR.${:U:Z}= unknown modifier in the variable name # As of 2020-12-01, errors in the variable name are silently ignored. # Since var.c 1.754 from 2020-12-20, unknown modifiers at parse time result # in an error message and a non-zero exit status. -# expect+1: while evaluating "${:U:Z}post": Unknown modifier "Z" +# expect+1: while evaluating "${:U:Z}post" with value "": Unknown modifier "Z" VAR.${:U:Z}post= unknown modifier with text in the variable name .if ${VAR.post} != "unknown modifier with text in the variable name" . error @@ -66,8 +66,12 @@ VAR.${:U:Z}post= unknown modifier with text in the variable name # #.MAKEFLAGS: -dv IND= ${:OX} +# expect+6: while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}" with value "": Bad modifier ":OX" +# expect+5: while evaluating "${:U:OX:U${IND}}" with value "": Bad modifier ":OX" +# expect+4: Undefined variable "${:U:OX" +# expect+3: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX" # expect+2: Undefined variable "${:U:OX" -# expect+1: Undefined variable "${:U:OX" +# expect+1: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX" _:= ${:U:OX:U${IND}} ${:U:OX:U${IND}} #.MAKEFLAGS: -d0 @@ -75,17 +79,31 @@ _:= ${:U:OX:U${IND}} ${:U:OX:U${IND}} # Before var.c 1.032 from 2022-08-24, make complained about 'Unknown modifier' # or 'Bad modifier' when in fact the modifier was entirely correct, it was # just not delimited by either ':' or '}' but instead by '\0'. +# expect+1: while evaluating "${:U:Q" with value "": Unclosed expression, expecting '}' for modifier "Q" UNCLOSED:= ${:U:Q +# expect+1: while evaluating "${:U:sh" with value "": Unclosed expression, expecting '}' for modifier "sh" UNCLOSED:= ${:U:sh +# expect+1: while evaluating "${:U:tA" with value "": Unclosed expression, expecting '}' for modifier "tA" UNCLOSED:= ${:U:tA +# expect+1: while evaluating "${:U:tsX" with value "": Unclosed expression, expecting '}' for modifier "tsX" UNCLOSED:= ${:U:tsX +# expect+1: while evaluating "${:U:ts" with value "": Unclosed expression, expecting '}' for modifier "ts" UNCLOSED:= ${:U:ts +# expect+1: while evaluating "${:U:ts\040" with value "": Unclosed expression, expecting '}' for modifier "ts\040" UNCLOSED:= ${:U:ts\040 +# expect+1: while evaluating "${:U:u" with value "": Unclosed expression, expecting '}' for modifier "u" UNCLOSED:= ${:U:u +# expect+1: while evaluating "${:U:H" with value ".": Unclosed expression, expecting '}' for modifier "H" UNCLOSED:= ${:U:H +# expect+1: while evaluating "${:U:[1]" with value "": Unclosed expression, expecting '}' for modifier "[1]" UNCLOSED:= ${:U:[1] +# expect+1: while evaluating "${:U:hash" with value "b2af338b": Unclosed expression, expecting '}' for modifier "hash" UNCLOSED:= ${:U:hash +# expect+1: while evaluating "${:U:range" with value "1": Unclosed expression, expecting '}' for modifier "range" UNCLOSED:= ${:U:range +# expect+1: while evaluating "${:U:_" with value "": Unclosed expression, expecting '}' for modifier "_" UNCLOSED:= ${:U:_ +# expect+1: while evaluating "${:U:gmtime" with value "": Unclosed expression, expecting '}' for modifier "gmtime" UNCLOSED:= ${:U:gmtime +# expect+1: while evaluating "${:U:localtime" with value "": Unclosed expression, expecting '}' for modifier "localtime" UNCLOSED:= ${:U:localtime diff --git a/contrib/bmake/util.c b/contrib/bmake/util.c index f660c21a228a..49052a240d03 100644 --- a/contrib/bmake/util.c +++ b/contrib/bmake/util.c @@ -3,7 +3,7 @@ /* * Missing stuff from OS's * - * $Id: util.c,v 1.52 2024/01/04 00:27:30 sjg Exp $ + * $Id: util.c,v 1.53 2024/07/12 18:37:25 sjg Exp $ */ #include @@ -343,6 +343,10 @@ getcwd(path, sz) #include "sigact.h" #endif +#ifndef SA_RESTART +# define SA_RESTART 0 +#endif + /* force posix signals */ SignalProc bmake_signal(int s, SignalProc a) diff --git a/contrib/bmake/var.c b/contrib/bmake/var.c index 2cd0d8d9c168..3d611bdd9b5d 100644 --- a/contrib/bmake/var.c +++ b/contrib/bmake/var.c @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.1121 2024/06/15 22:06:30 rillig Exp $ */ +/* $NetBSD: var.c,v 1.1135 2024/07/09 17:07:23 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -76,10 +76,6 @@ * expressions like ${VAR}, ${VAR:Modifiers}, ${${VARNAME}} or ${VAR:${MODS}}. * * Interface: - * Var_Init Initialize this module. - * - * Var_End Clean up the module. - * * Var_Set * Var_SetExpand Set the value of the variable, creating it if * necessary. @@ -142,8 +138,12 @@ #include "job.h" #include "metachar.h" +#ifndef SIZE_MAX +#define SIZE_MAX 0xffffffffUL +#endif + /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.1121 2024/06/15 22:06:30 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.1135 2024/07/09 17:07:23 rillig Exp $"); /* * Variables are defined using one of the VAR=value assignments. Their @@ -273,12 +273,17 @@ typedef struct SepBuf { typedef enum { VSK_TARGET, VSK_VARNAME, - VSK_EXPR + VSK_COND, + VSK_COND_THEN, + VSK_COND_ELSE, + VSK_EXPR, + VSK_EXPR_PARSE } EvalStackElementKind; typedef struct { EvalStackElementKind kind; const char *str; + const FStr *value; } EvalStackElement; typedef struct { @@ -358,7 +363,7 @@ static EvalStack evalStack; static void -EvalStack_Push(EvalStackElementKind kind, const char *str) +EvalStack_Push(EvalStackElementKind kind, const char *str, const FStr *value) { if (evalStack.len >= evalStack.cap) { evalStack.cap = 16 + 2 * evalStack.cap; @@ -367,6 +372,7 @@ EvalStack_Push(EvalStackElementKind kind, const char *str) } evalStack.elems[evalStack.len].kind = kind; evalStack.elems[evalStack.len].str = str; + evalStack.elems[evalStack.len].value = value; evalStack.len++; } @@ -386,12 +392,25 @@ EvalStack_Details(void) buf->len = 0; for (i = 0; i < evalStack.len; i++) { + static const char descr[][42] = { + "in target", + "while evaluating variable", + "while evaluating condition", + "while evaluating then-branch of condition", + "while evaluating else-branch of condition", + "while evaluating", + "while parsing", + }; EvalStackElement *elem = evalStack.elems + i; - Buf_AddStr(buf, - elem->kind == VSK_TARGET ? "in target \"" : - elem->kind == VSK_EXPR ? "while evaluating \"" : - "while evaluating variable \""); + EvalStackElementKind kind = elem->kind; + Buf_AddStr(buf, descr[kind]); + Buf_AddStr(buf, " \""); Buf_AddStr(buf, elem->str); + if (elem->value != NULL + && (kind == VSK_VARNAME || kind == VSK_EXPR)) { + Buf_AddStr(buf, "\" with value \""); + Buf_AddStr(buf, elem->value->str); + } Buf_AddStr(buf, "\": "); } return buf->len > 0 ? buf->data : ""; @@ -1412,21 +1431,18 @@ SepBuf_DoneData(SepBuf *buf) typedef void (*ModifyWordProc)(Substring word, SepBuf *buf, void *data); -/*ARGSUSED*/ static void ModifyWord_Head(Substring word, SepBuf *buf, void *dummy MAKE_ATTR_UNUSED) { SepBuf_AddSubstring(buf, Substring_Dirname(word)); } -/*ARGSUSED*/ static void ModifyWord_Tail(Substring word, SepBuf *buf, void *dummy MAKE_ATTR_UNUSED) { SepBuf_AddSubstring(buf, Substring_Basename(word)); } -/*ARGSUSED*/ static void ModifyWord_Suffix(Substring word, SepBuf *buf, void *dummy MAKE_ATTR_UNUSED) { @@ -1435,7 +1451,6 @@ ModifyWord_Suffix(Substring word, SepBuf *buf, void *dummy MAKE_ATTR_UNUSED) SepBuf_AddRange(buf, lastDot + 1, word.end); } -/*ARGSUSED*/ static void ModifyWord_Root(Substring word, SepBuf *buf, void *dummy MAKE_ATTR_UNUSED) { @@ -1570,7 +1585,7 @@ RegexError(int reerr, const regex_t *pat, const char *str) size_t errlen = regerror(reerr, pat, NULL, 0); char *errbuf = bmake_malloc(errlen); regerror(reerr, pat, errbuf, errlen); - Error("%s: %s", str, errbuf); + Parse_Error(PARSE_FATAL, "%s: %s", str, errbuf); free(errbuf); } @@ -1582,7 +1597,7 @@ RegexReplaceBackref(char ref, SepBuf *buf, const char *wp, unsigned int n = (unsigned)ref - '0'; if (n >= nsub) - Error("No subexpression \\%u", n); + Parse_Error(PARSE_FATAL, "No subexpression \\%u", n); else if (m[n].rm_so == -1) { if (opts.strict) Error("No match for subexpression \\%u", n); @@ -1758,7 +1773,6 @@ VarSelectWords(const char *str, int first, int last, } -/*ARGSUSED*/ static void ModifyWord_Realpath(Substring word, SepBuf *buf, void *data MAKE_ATTR_UNUSED) { @@ -1962,11 +1976,9 @@ FormatTime(const char *fmt, time_t t, bool gmt) * and stores the result back in ch->expr->value via Expr_SetValueOwn or * Expr_SetValueRefer. * - * If evaluating fails, the fallback error message "Bad modifier" is printed - * using Error. This function has no side effects, it really just prints the - * error message, continuing as if nothing had happened. TODO: This should be - * fixed by adding proper error handling to Var_Subst, Var_Parse, - * ApplyModifiers and ModifyWords. + * If evaluating fails, the fallback error message "Bad modifier" is printed. + * TODO: Add proper error handling to Var_Subst, Var_Parse, ApplyModifiers and + * ModifyWords. * * Some modifiers such as :D and :U turn undefined expressions into defined * expressions using Expr_Define. @@ -2233,8 +2245,8 @@ ParseModifierPart( *pp = p; if (*p != end1 && *p != end2) { - Error("Unfinished modifier for \"%s\" ('%c' missing)", - ch->expr->name, end2); + Parse_Error(PARSE_FATAL, + "Unfinished modifier ('%c' missing)", end2); LazyBuf_Done(part); return false; } @@ -2644,8 +2656,7 @@ ApplyModifier_ShellCommand(const char **pp, ModChain *ch) output = Cmd_Exec(cmd.str, &error); Expr_SetValueOwn(expr, output); if (error != NULL) { - /* XXX: why still return AMR_OK? */ - Error("%s", error); + Parse_Error(PARSE_WARNING, "%s", error); free(error); } } else @@ -2806,7 +2817,7 @@ ModifyWord_Match(Substring word, SepBuf *buf, void *data) res = Str_Match(word.start, args->pattern); if (res.error != NULL && !args->error_reported) { args->error_reported = true; - Parse_Error(PARSE_WARNING, + Parse_Error(PARSE_FATAL, "%s in pattern '%s' of modifier '%s'", res.error, args->pattern, args->neg ? ":N" : ":M"); } @@ -2937,7 +2948,8 @@ ApplyModifier_Subst(const char **pp, ModChain *ch) char delim = (*pp)[1]; if (delim == '\0') { - Error("Missing delimiter for modifier ':S'"); + Parse_Error(PARSE_FATAL, + "Missing delimiter for modifier ':S'"); (*pp)++; return AMR_CLEANUP; } @@ -2988,7 +3000,8 @@ ApplyModifier_Regex(const char **pp, ModChain *ch) char delim = (*pp)[1]; if (delim == '\0') { - Error("Missing delimiter for :C modifier"); + Parse_Error(PARSE_FATAL, + "Missing delimiter for modifier ':C'"); (*pp)++; return AMR_CLEANUP; } @@ -3062,7 +3075,6 @@ ApplyModifier_Quote(const char **pp, ModChain *ch) return AMR_OK; } -/*ARGSUSED*/ static void ModifyWord_Copy(Substring word, SepBuf *buf, void *data MAKE_ATTR_UNUSED) { @@ -3147,6 +3159,21 @@ ok: return AMR_OK; } +static char * +str_totitle(const char *str) +{ + size_t i, n = strlen(str) + 1; + char *res = bmake_malloc(n); + for (i = 0; i < n; i++) { + if (i == 0 || ch_isspace(res[i - 1])) + res[i] = ch_toupper(str[i]); + else + res[i] = ch_tolower(str[i]); + } + return res; +} + + static char * str_toupper(const char *str) { @@ -3194,6 +3221,13 @@ ApplyModifier_To(const char **pp, ModChain *ch) return AMR_OK; } + if (mod[1] == 't') { /* :tt */ + *pp = mod + 2; + if (Expr_ShouldEval(expr)) + Expr_SetValueOwn(expr, str_totitle(Expr_Str(expr))); + return AMR_OK; + } + if (mod[1] == 'u') { /* :tu */ *pp = mod + 2; if (Expr_ShouldEval(expr)) @@ -3306,7 +3340,7 @@ bad_modifier: return AMR_BAD; } -#if __STDC__ >= 199901L || defined(HAVE_LONG_LONG_INT) +#if __STDC_VERSION__ >= 199901L || defined(HAVE_LONG_LONG_INT) # define NUM_TYPE long long # define PARSE_NUM_TYPE strtoll #else @@ -3460,6 +3494,7 @@ ApplyModifier_IfElse(const char **pp, ModChain *ch) CondResult cond_rc = CR_TRUE; /* just not CR_ERROR */ if (Expr_ShouldEval(expr)) { + evalStack.elems[evalStack.len - 1].kind = VSK_COND; cond_rc = Cond_EvalCondition(expr->name); if (cond_rc == CR_TRUE) then_emode = expr->emode; @@ -3467,11 +3502,13 @@ ApplyModifier_IfElse(const char **pp, ModChain *ch) else_emode = expr->emode; } + evalStack.elems[evalStack.len - 1].kind = VSK_COND_THEN; (*pp)++; /* skip past the '?' */ if (!ParseModifierPart(pp, ':', ':', then_emode, ch, &thenBuf, NULL, NULL)) return AMR_CLEANUP; + evalStack.elems[evalStack.len - 1].kind = VSK_COND_ELSE; if (!ParseModifierPart(pp, ch->endc, ch->endc, else_emode, ch, &elseBuf, NULL, NULL)) { LazyBuf_Done(&thenBuf); @@ -3481,12 +3518,8 @@ ApplyModifier_IfElse(const char **pp, ModChain *ch) (*pp)--; /* Go back to the ch->endc. */ if (cond_rc == CR_ERROR) { - Substring thenExpr = LazyBuf_Get(&thenBuf); - Substring elseExpr = LazyBuf_Get(&elseBuf); - Error("Bad conditional expression '%s' before '?%.*s:%.*s'", - expr->name, - (int)Substring_Length(thenExpr), thenExpr.start, - (int)Substring_Length(elseExpr), elseExpr.start); + evalStack.elems[evalStack.len - 1].kind = VSK_COND; + Parse_Error(PARSE_FATAL, "Bad condition"); LazyBuf_Done(&thenBuf); LazyBuf_Done(&elseBuf); return AMR_CLEANUP; @@ -3574,7 +3607,7 @@ found_op: char *output, *error; output = Cmd_Exec(val.str, &error); if (error != NULL) { - Error("%s", error); + Parse_Error(PARSE_WARNING, "%s", error); free(error); } else Var_Set(scope, expr->name, output); @@ -3762,7 +3795,7 @@ ApplyModifier_SunShell(const char **pp, ModChain *ch) char *output, *error; output = Cmd_Exec(Expr_Str(expr), &error); if (error != NULL) { - Error("%s", error); + Parse_Error(PARSE_WARNING, "%s", error); free(error); } Expr_SetValueOwn(expr, output); @@ -3953,9 +3986,10 @@ ApplyModifiersIndirect(ModChain *ch, const char **pp) if (*p == ':') p++; else if (*p == '\0' && ch->endc != '\0') { - Error("Unclosed expression after indirect modifier, " - "expecting '%c' for variable \"%s\"", - ch->endc, expr->name); + Parse_Error(PARSE_FATAL, + "Unclosed expression after indirect modifier, " + "expecting '%c'", + ch->endc); *pp = p; return AMIR_OUT; } @@ -4003,12 +4037,10 @@ ApplySingleModifier(const char **pp, ModChain *ch) LogAfterApply(ch, p, mod); if (*p == '\0' && ch->endc != '\0') { - Error( + Parse_Error(PARSE_FATAL, "Unclosed expression, expecting '%c' for " - "modifier \"%.*s\" of variable \"%s\" with value \"%s\"", - ch->endc, - (int)(p - mod), mod, - ch->expr->name, Expr_Str(ch->expr)); + "modifier \"%.*s\"", + ch->endc, (int)(p - mod), mod); } else if (*p == ':') { p++; } else if (opts.strict && *p != '\0' && *p != ch->endc) { @@ -4061,9 +4093,8 @@ ApplyModifiers( p = *pp; if (*p == '\0' && endc != '\0') { - Error( - "Unclosed expression, expecting '%c' for \"%s\"", - ch.endc, expr->name); + Parse_Error(PARSE_FATAL, + "Unclosed expression, expecting '%c'", ch.endc); goto cleanup; } @@ -4099,8 +4130,8 @@ ApplyModifiers( bad_modifier: /* Take a guess at where the modifier ends. */ - Error("Bad modifier \":%.*s\" for variable \"%s\"", - (int)strcspn(mod, ":)}"), mod, expr->name); + Parse_Error(PARSE_FATAL, "Bad modifier \":%.*s\"", + (int)strcspn(mod, ":)}"), mod); cleanup: /* @@ -4590,10 +4621,12 @@ Var_Parse(const char **pp, GNode *scope, VarEvalMode emode) */ expr.value = FStr_InitRefer(v->val.data); - if (expr.name[0] != '\0') - EvalStack_Push(VSK_VARNAME, expr.name); + if (!VarEvalMode_ShouldEval(emode)) + EvalStack_Push(VSK_EXPR_PARSE, start, NULL); + else if (expr.name[0] != '\0') + EvalStack_Push(VSK_VARNAME, expr.name, &expr.value); else - EvalStack_Push(VSK_EXPR, start); + EvalStack_Push(VSK_EXPR, start, &expr.value); /* * Before applying any modifiers, expand any nested expressions from @@ -4775,7 +4808,7 @@ char * Var_SubstInTarget(const char *str, GNode *scope) { char *res; - EvalStack_Push(VSK_TARGET, scope->name); + EvalStack_Push(VSK_TARGET, scope->name, NULL); res = Var_Subst(str, scope, VARE_EVAL); EvalStack_Pop(); return res; @@ -4794,22 +4827,6 @@ Var_Expand(FStr *str, GNode *scope, VarEvalMode emode) *str = FStr_InitOwn(expanded); } -/* Initialize the variables module. */ -void -Var_Init(void) -{ - SCOPE_INTERNAL = GNode_New("Internal"); - SCOPE_GLOBAL = GNode_New("Global"); - SCOPE_CMDLINE = GNode_New("Command"); -} - -/* Clean up the variables module. */ -void -Var_End(void) -{ - Var_Stats(); -} - void Var_Stats(void) { diff --git a/usr.bin/bmake/Makefile.config b/usr.bin/bmake/Makefile.config index 1d9a6a2880ea..75ceb4a50e15 100644 --- a/usr.bin/bmake/Makefile.config +++ b/usr.bin/bmake/Makefile.config @@ -6,7 +6,7 @@ SRCTOP?= ${.CURDIR:H:H} # things set by configure -_MAKE_VERSION?=20240625 +_MAKE_VERSION?=20240711 prefix?= /usr srcdir= ${SRCTOP}/contrib/bmake diff --git a/usr.bin/bmake/config.h b/usr.bin/bmake/config.h index 3ca313216962..33aed8f160c8 100644 --- a/usr.bin/bmake/config.h +++ b/usr.bin/bmake/config.h @@ -16,24 +16,24 @@ /* Define to 1 if you have the header file. */ #define HAVE_AR_H 1 -/* 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. */ #define HAVE_DECL_SYS_SIGLIST 1 -/* Define to 1 if you have the header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dirname' function. */ +/* Define to 1 if you have the 'dirname' function. */ #define HAVE_DIRNAME 1 -/* 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. */ #define HAVE_ERR 1 -/* Define to 1 if you have the `errx' function. */ +/* Define to 1 if you have the 'errx' function. */ #define HAVE_ERRX 1 /* Define to 1 if you have the header file. */ @@ -42,25 +42,25 @@ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 -/* Define to 1 if you have the `fork' function. */ +/* Define to 1 if you have the 'fork' function. */ #define HAVE_FORK 1 -/* Define to 1 if you have the `getcwd' function. */ +/* Define to 1 if you have the 'getcwd' function. */ #define HAVE_GETCWD 1 -/* Define to 1 if you have the `getenv' function. */ +/* Define to 1 if you have the 'getenv' function. */ #define HAVE_GETENV 1 -/* Define to 1 if you have the `getopt' function. */ +/* Define to 1 if you have the 'getopt' function. */ #define HAVE_GETOPT 1 -/* Define to 1 if you have the `getwd' function. */ +/* Define to 1 if you have the 'getwd' function. */ #define HAVE_GETWD 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 -/* Define to 1 if you have the `killpg' function. */ +/* Define to 1 if you have the 'killpg' function. */ #define HAVE_KILLPG 1 /* Define to 1 if you have the header file. */ @@ -69,16 +69,13 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 -/* Define to 1 if the system has the type `long long int'. */ +/* Define to 1 if the system has the type 'long long int'. */ #define HAVE_LONG_LONG_INT 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_MINIX_CONFIG_H */ -/* Define to 1 if you have the `mmap' function. */ -#define HAVE_MMAP 1 - -/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* Define to 1 if you have the header file, and it defines 'DIR'. */ /* #undef HAVE_NDIR_H */ /* Define to 1 if you have the header file. */ @@ -87,58 +84,58 @@ /* Define to 1 if you have the header file. */ #define HAVE_POLL_H 1 -/* Define to 1 if you have the `putenv' function. */ +/* Define to 1 if you have the 'putenv' function. */ #define HAVE_PUTENV 1 /* Define to 1 if you have the header file. */ #define HAVE_RANLIB_H 1 -/* Define to 1 if you have the `realpath' function. */ +/* Define to 1 if you have the 'realpath' function. */ #define HAVE_REALPATH 1 /* Define to 1 if you have the header file. */ #define HAVE_REGEX_H 1 -/* Define to 1 if you have the `select' function. */ +/* Define to 1 if you have the 'select' function. */ #define HAVE_SELECT 1 -/* Define to 1 if you have the `setenv' function. */ +/* Define to 1 if you have the 'setenv' function. */ #define HAVE_SETENV 1 -/* Define to 1 if you have the `setpgid' function. */ +/* Define to 1 if you have the 'setpgid' function. */ #define HAVE_SETPGID 1 -/* Define to 1 if you have the `setrlimit' function. */ +/* Define to 1 if you have the 'setrlimit' function. */ #define HAVE_SETRLIMIT 1 -/* Define to 1 if you have the `setsid' function. */ +/* Define to 1 if you have the 'setsid' function. */ #define HAVE_SETSID 1 -/* Define to 1 if you have the `sigaction' function. */ +/* Define to 1 if you have the 'sigaction' function. */ #define HAVE_SIGACTION 1 -/* Define to 1 if you have the `sigaddset' function. */ +/* Define to 1 if you have the 'sigaddset' function. */ #define HAVE_SIGADDSET 1 -/* Define to 1 if you have the `sigpending' function. */ +/* Define to 1 if you have the 'sigpending' function. */ #define HAVE_SIGPENDING 1 -/* Define to 1 if you have the `sigprocmask' function. */ +/* Define to 1 if you have the 'sigprocmask' function. */ #define HAVE_SIGPROCMASK 1 -/* Define to 1 if you have the `sigsetmask' function. */ +/* Define to 1 if you have the 'sigsetmask' function. */ #define HAVE_SIGSETMASK 1 -/* Define to 1 if you have the `sigsuspend' function. */ +/* Define to 1 if you have the 'sigsuspend' function. */ #define HAVE_SIGSUSPEND 1 -/* Define to 1 if you have the `sigvec' function. */ +/* Define to 1 if you have the 'sigvec' function. */ #define HAVE_SIGVEC 1 -/* Define to 1 if the system has the type `sig_atomic_t'. */ +/* Define to 1 if the system has the type 'sig_atomic_t'. */ #define HAVE_SIG_ATOMIC_T 1 -/* Define to 1 if you have the `snprintf' function. */ +/* Define to 1 if you have the 'snprintf' function. */ #define HAVE_SNPRINTF 1 /* Define to 1 if you have the header file. */ @@ -150,13 +147,13 @@ /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 -/* Define to 1 if you have the `strerror' function. */ +/* Define to 1 if you have the 'strerror' function. */ #define HAVE_STRERROR 1 -/* 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. */ #define HAVE_STRFTIME 1 /* Define to 1 if you have the header file. */ @@ -165,35 +162,35 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 -/* Define to 1 if you have the `strlcpy' function. */ +/* Define to 1 if you have the 'strlcpy' function. */ #define HAVE_STRLCPY 1 -/* Define to 1 if you have the `strsep' function. */ +/* Define to 1 if you have the 'strsep' function. */ #define HAVE_STRSEP 1 -/* Define to 1 if you have the `strtod' function. */ +/* Define to 1 if you have the 'strtod' function. */ #define HAVE_STRTOD 1 -/* Define to 1 if you have the `strtol' function. */ +/* Define to 1 if you have the 'strtol' function. */ #define HAVE_STRTOL 1 -/* Define to 1 if you have the `strtoll' function. */ +/* Define to 1 if you have the 'strtoll' function. */ #define HAVE_STRTOLL 1 -/* Define to 1 if you have the `strtoul' function. */ +/* Define to 1 if you have the 'strtoul' function. */ #define HAVE_STRTOUL 1 -/* Define to 1 if you have the `sysctl' function. */ +/* Define to 1 if you have the 'sysctl' function. */ #define HAVE_SYSCTL 1 -/* Define to 1 if you have the header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ /* #undef HAVE_SYS_DIR_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_MMAN_H 1 -/* Define to 1 if you have the header file, and it defines `DIR'. +/* Define to 1 if you have the header file, and it defines 'DIR'. */ /* #undef HAVE_SYS_NDIR_H */ @@ -227,49 +224,49 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 -/* Define to 1 if you have the `unsetenv' function. */ +/* Define to 1 if you have the 'unsetenv' function. */ #define HAVE_UNSETENV 1 -/* 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'. */ #define HAVE_UNSIGNED_LONG_LONG_INT 1 /* Define to 1 if you have the header file. */ #define HAVE_UTIME_H 1 -/* Define to 1 if you have the `vfork' function. */ +/* Define to 1 if you have the 'vfork' function. */ #define HAVE_VFORK 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_VFORK_H */ -/* Define to 1 if you have the `vprintf' function. */ +/* Define to 1 if you have the 'vprintf' function. */ #define HAVE_VPRINTF 1 -/* Define to 1 if you have the `vsnprintf' function. */ +/* Define to 1 if you have the 'vsnprintf' function. */ #define HAVE_VSNPRINTF 1 -/* Define to 1 if you have the `wait3' function. */ +/* Define to 1 if you have the 'wait3' function. */ #define HAVE_WAIT3 1 -/* Define to 1 if you have the `wait4' function. */ +/* Define to 1 if you have the 'wait4' function. */ #define HAVE_WAIT4 1 -/* Define to 1 if you have the `waitpid' function. */ +/* Define to 1 if you have the 'waitpid' function. */ #define HAVE_WAITPID 1 -/* Define to 1 if you have the `warn' function. */ +/* Define to 1 if you have the 'warn' function. */ #define HAVE_WARN 1 -/* Define to 1 if you have the `warnx' function. */ +/* Define to 1 if you have the 'warnx' function. */ #define HAVE_WARNX 1 /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if `fork' works. */ +/* Define to 1 if 'fork' works. */ #define HAVE_WORKING_FORK 1 -/* Define to 1 if `vfork' works. */ +/* Define to 1 if 'vfork' works. */ #define HAVE_WORKING_VFORK 1 /* define if your compiler has __attribute__ */ @@ -282,7 +279,7 @@ #define PACKAGE_NAME "bmake" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "bmake 20240314" +#define PACKAGE_STRING "bmake 20240711" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "bmake" @@ -291,20 +288,20 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "20240314" +#define PACKAGE_VERSION "20240711" -/* Define to 1 if the `S_IS*' macros in do not work properly. */ +/* Define to 1 if the 'S_IS*' macros in 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. */ #define STDC_HEADERS 1 -/* Define to 1 if your declares `struct tm'. */ +/* Define to 1 if your declares 'struct tm'. */ /* #undef TM_IN_SYS_TIME */ -/* Enable extensions on AIX 3, Interix. */ +/* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 #endif @@ -365,11 +362,15 @@ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # define __STDC_WANT_IEC_60559_DFP_EXT__ 1 #endif +/* Enable extensions specified by C23 Annex F. */ +#ifndef __STDC_WANT_IEC_60559_EXT__ +# define __STDC_WANT_IEC_60559_EXT__ 1 +#endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1 #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__ # define __STDC_WANT_IEC_60559_TYPES_EXT__ 1 #endif @@ -412,10 +413,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 */ @@ -425,10 +426,10 @@ such a type exists and the standard includes do not define it. */ /* #undef int64_t */ -/* Define to `int' if does not define. */ +/* Define to 'int' if does not define. */ /* #undef mode_t */ -/* Define to `long int' if does not define. */ +/* Define to 'long int' if does not define. */ /* #undef off_t */ /* Define as a signed integer type capable of holding a process identifier. */ @@ -437,12 +438,12 @@ /* type that signal handlers can safely frob */ /* #undef sig_atomic_t */ -/* Define to `unsigned int' if does not define. */ +/* Define as 'unsigned int' if doesn't define. */ /* #undef size_t */ /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ /* #undef uint32_t */ -/* Define as `fork' if `vfork' does not work. */ +/* Define as 'fork' if 'vfork' does not work. */ /* #undef vfork */ diff --git a/usr.bin/bmake/unit-tests/Makefile b/usr.bin/bmake/unit-tests/Makefile index 20e1b1cf94ee..d70c0f87e459 100644 --- a/usr.bin/bmake/unit-tests/Makefile +++ b/usr.bin/bmake/unit-tests/Makefile @@ -1,9 +1,9 @@ # This is a generated file, do NOT edit! # See contrib/bmake/bsd.after-import.mk # -# $Id: Makefile,v 1.219 2024/06/01 16:14:47 sjg Exp $ +# $Id: Makefile,v 1.224 2024/07/13 05:27:35 sjg Exp $ # -# $NetBSD: Makefile,v 1.347 2024/06/01 15:54:40 sjg Exp $ +# $NetBSD: Makefile,v 1.350 2024/07/07 09:37:00 rillig Exp $ # # Unit tests for make(1) # @@ -401,6 +401,7 @@ TESTS+= varmod-to-lower TESTS+= varmod-to-many-words TESTS+= varmod-to-one-word TESTS+= varmod-to-separator +TESTS+= varmod-to-title TESTS+= varmod-to-upper TESTS+= varmod-undefined TESTS+= varmod-unique @@ -468,8 +469,23 @@ _shell := ${.SHELL:tA:T} .if ${_shell} == "dash" # dash fails -x output BROKEN_TESTS+= opt-debug-x-trace -.elif ${_shell} == "ksh" -BROKEN_TESTS+= sh-flags +.elif ${_shell:N*ksh*} == "" +BROKEN_TESTS+= \ + deptgt-silent-jobs \ + job-flags \ + job-output-long-lines \ + opt-debug-x-trace \ + sh-flags \ + var-op-shell \ + +.if ${_shell:Nmksh} == "" +# more broken that pdksh +BROKEN_TESTS+= \ + opt-jobs-no-action \ + sh-errctl \ + sh-leading-hyphen \ + +.endif .endif .if ${UTC_1:Uno} == "" @@ -594,7 +610,7 @@ SED_CMDS.meta-ignore= -e 's,\(\.meta:\) [1-9][0-9]*:,\1 :,' SED_CMDS.opt-debug-graph1= ${STD_SED_CMDS.dg1} SED_CMDS.opt-debug-graph2= ${STD_SED_CMDS.dg2} SED_CMDS.opt-debug-graph3= ${STD_SED_CMDS.dg3} -SED_CMDS.opt-debug-hash= -e 's,\(numEntries\)=[1-9][0-9],\1=,' +SED_CMDS.opt-debug-hash= -e 's,\(entries\)=[1-9][0-9],\1=,' SED_CMDS.opt-debug-jobs= -e 's,([0-9][0-9]*),(),' SED_CMDS.opt-debug-jobs+= -e 's,pid [0-9][0-9]*,pid ,' SED_CMDS.opt-debug-jobs+= -e 's,Process [0-9][0-9]*,Process ,' @@ -810,7 +826,7 @@ LIMIT_RESOURCES?= : # Postprocess the test output to make the output platform-independent. # # Replace anything after 'stopped in' with unit-tests -_SED_CMDS+= -e '/stopped/s, /.*, unit-tests,' +_SED_CMDS+= -e '/stopped/s, in /.*, in unit-tests,' # Allow the test files to be placed anywhere. _SED_CMDS+= -e 's,\(\.PARSEDIR}\) = `'"/[^']*'"',\1 = ,' _SED_CMDS+= -e 's,\(\.INCLUDEDFROMDIR}\) = `'"/[^']*'"',\1 = ,' @@ -836,8 +852,10 @@ _SED_CMDS+= -e '/EGREP=/d' .if ${.MAKE.OS:N*BSD} != "" _SED_CMDS+= -e 's,\(Error code\) 255,\1 1,' .endif -.if ${.SHELL:T} == "ksh" +.if ${_shell:N*ksh*} == "" _SED_CMDS+= -e '/^set [+-]v/d' +SED_CMDS.opt-debug-jobs+= -e 's,Command: ksh -v,Command: ,' +SED_CMDS.opt-debug-jobs+= -e 's,Command: -v,Command: ,' .endif .rawout.out: