]> git.ipfire.org Git - thirdparty/make.git/log
thirdparty/make.git
2 years ago* src/expand.c (swap_variable_buffer): Swap two variable buffers
Paul Smith [Sat, 25 Mar 2023 20:25:32 +0000 (16:25 -0400)] 
* src/expand.c (swap_variable_buffer): Swap two variable buffers

Return the current buffer instead of freeing it.
(variable_append): Use install/swap to handle variable buffers.
(allocated_variable_expand_for_file): Ditto.
* src/variable.c (shell_result): Ditto.
* src/variable.h: Declare the new function.

2 years agoEnsure variable_buffer is always nul-terminated
Paul Smith [Sun, 26 Mar 2023 13:24:06 +0000 (09:24 -0400)] 
Ensure variable_buffer is always nul-terminated

* src/expand.c (variable_buffer_output): Allocate an extra byte and
set it to nul.  For safety, add assert() on PTR.
(variable_expand_string): Don't call variable_buffer_output just to
add a nul byte.
(allocated_variable_append): Ditto.

2 years ago[SV 63867] Don't use --sort to generate error report tar files
Paul Smith [Sun, 5 Mar 2023 14:09:46 +0000 (09:09 -0500)] 
[SV 63867] Don't use --sort to generate error report tar files

Older versions of GNU tar parse the TAR_OPTIONS variable, but do not
accept the --sort option: remove it before creating the error report
tar files.  Note we still require a modern GNU tar to create release
tar files.  Reported by Dmitry Goncharov <dgoncharov@users.sf.net>

* Makefile.am (check-regression): Remove --sort from TAR_OPTIONS

2 years agoDirectly handle $\ line endings
Paul Smith [Sun, 26 Feb 2023 22:30:15 +0000 (17:30 -0500)] 
Directly handle $\ line endings

Previously we used the fact that this line ending expanded to "$ "
which would then expand to the empty string.  This has problems if
you enable warnings for undefined variables, so directly implement
this special (but documented) trick in the GNU Make parser.

As a side-effect this also removes all previous whitespace when
in GNU Make mode (not in POSIX mode) just as it would without "$".

* src/misc.c (collapse_continuations): Check for "$\" and remove it.
* tests/scripts/variables/flavors: Add regression tests including
with previous whitespace, and escaped/unescaped "$"

2 years ago* src/main.c (define_makefiles): Simplify by using variable_buffer
Paul Smith [Sun, 26 Feb 2023 22:15:56 +0000 (17:15 -0500)] 
* src/main.c (define_makefiles): Simplify by using variable_buffer

Toss the previous implementation which first computed a locally
allocated list of options, then used alloca() to create a buffer
of the right size and populate it.  Instead, use variable_buffer
to append to the string directly.  First add all single-letter
options without arguments, then add options with arguments.

2 years agoClean up some preprocessor operations
Paul Smith [Mon, 16 Jan 2023 18:01:09 +0000 (13:01 -0500)] 
Clean up some preprocessor operations

2 years agoUse MK_OS_OS2 macro instead of __EMX__
Paul Smith [Mon, 16 Jan 2023 05:24:13 +0000 (00:24 -0500)] 
Use MK_OS_OS2 macro instead of __EMX__

* src/makeint.h: Set MK_OS_OS2 to 1 if __EMX__ is set.
* src/*: Convert #if refs to __EMX__, to use MK_OS_OS2.

2 years agoUse MK_OS_DOS macro instead of __MSDOS__
Paul Smith [Mon, 16 Jan 2023 05:03:13 +0000 (00:03 -0500)] 
Use MK_OS_DOS macro instead of __MSDOS__

* src/configh.dos: Set MK_OS_DOS to 1
* src/*: Convert #if refs to __MSDOS__, to use MK_OS_DOS.
* gl/lib/*: Ditto.

2 years agoRename WINDOWS32 macro to MK_OS_W32
Paul Smith [Sun, 15 Jan 2023 23:27:13 +0000 (18:27 -0500)] 
Rename WINDOWS32 macro to MK_OS_W32

* configure.ac: Set MK_OS_W32 to 1 if we're on Windows32.
* src/config.h.W32: Ditto.
* mk/Windows32.mk: Ditto.
* src/makeint.h: Convert #if refs to WINDOWS32, to use MK_OS_W32.
* src/*: Ditto.
* src/w32/*: Ditto.
* gl/lib/*: Ditto.

2 years agoRename VMS macro to MK_OS_VMS
Paul Smith [Sun, 15 Jan 2023 23:04:36 +0000 (18:04 -0500)] 
Rename VMS macro to MK_OS_VMS

* src/makeint.h: Set MK_OS_VMS to 1 if we're on VMS.
* src/*: Convert all #if references to VMS, to use MK_OS_VMS.
* gl/lib/*: Ditto.

2 years agoRemove support for AmigaOS
Paul Smith [Sun, 15 Jan 2023 22:32:15 +0000 (17:32 -0500)] 
Remove support for AmigaOS

There is a lot of specialized code for supporting AmigaOS and it has
not been maintained for a number of years.  It's highly unlikely that
the latest versions even compile properly on AmigaOS anymore.  After
requesting that someone step forward to own the maintenance of the
port in the GNU Make 4.4 release and getting no takers, I removed it.

* NEWS: Announce the removal.
* README.in: Remove README.Amiga reference.
* README.Amiga: Remove unused file.
* SCOPTIONS: Ditto.
* src/amiga.c: Ditto.
* src/amiga.h: Ditto.
* src/config.ami: Ditto.
* mk/Amiga.mk: Ditto.
* Makefile.am: Remove references to deleted files.
* Basic.mk.template: Ditto.
* maintMakefile: Ditto.
* src/commands.c: Remove ifdef'd Amiga code.
* src/default.c: Ditto.
* src/dir.c: Ditto.
* src/file.c: Ditto.
* src/function.c: Ditto.
* src/job.c: Ditto.
* src/job.h: Ditto.
* src/main.c: Ditto.
* src/os.h: Ditto.
* src/read.c: Ditto.
* src/remake.c: Ditto.

2 years ago* README.git: Clarify some release steps
Paul Smith [Sun, 26 Feb 2023 20:52:25 +0000 (15:52 -0500)] 
* README.git: Clarify some release steps

* README.in: Update some info and remove some obsolete notes.

2 years ago* NEWS: Update for the next release
Paul Smith [Sun, 26 Feb 2023 20:40:18 +0000 (15:40 -0500)] 
* NEWS: Update for the next release

* configure.ac: Set the version for the next release.

2 years agoGNU Make release 4.4.1 4.4.1
Paul Smith [Sun, 26 Feb 2023 16:01:43 +0000 (11:01 -0500)] 
GNU Make release 4.4.1

* NEWS: Set the release number and date.
* configure.ac: Update the version.
* README.git: Remind to update doc/make.1.
* doc/make.1: Update the date.  Fix some "GNU Make" references.
* doc/make.texi: Update the edition.

2 years ago* tests/scripts/options/dash-l: Simplify the test via the helper
Paul Smith [Sun, 26 Feb 2023 17:43:27 +0000 (12:43 -0500)] 
* tests/scripts/options/dash-l: Simplify the test via the helper

* tests/thelp.pl: Add "exist" and "noexist" operators.

2 years ago* README.W32: Add Windows 11
Paul Smith [Wed, 22 Feb 2023 01:53:11 +0000 (20:53 -0500)] 
* README.W32: Add Windows 11

* build_w32.bat: Ditto.

2 years agoUse a recursive environment if any command needs it
Paul Smith [Wed, 22 Feb 2023 01:32:12 +0000 (20:32 -0500)] 
Use a recursive environment if any command needs it

We only create one target environment for all commands in a recipe.
Ensure it's set for recursive make if ANY command is recursive, not
just the first one.

* src/job.c (start_job_command): Check for any recursive command.
* tests/scripts/features/jobserver: Test recursion on second line.

2 years ago* src/main.c (main): Install suffix rules near pattern updates
Dmitry Goncharov [Tue, 21 Feb 2023 05:04:13 +0000 (00:04 -0500)] 
* src/main.c (main): Install suffix rules near pattern updates

2 years ago* Makefile.am: Add mkconfig.h to the test error file
Paul Smith [Tue, 21 Feb 2023 04:29:26 +0000 (23:29 -0500)] 
* Makefile.am: Add mkconfig.h to the test error file

2 years ago[SV 63821] Don't set up default suffix rules if makefile sets -r
Dmitry Goncharov [Mon, 20 Feb 2023 20:17:24 +0000 (15:17 -0500)] 
[SV 63821] Don't set up default suffix rules if makefile sets -r

When built-in rules are disabled by adding -r to MAKEFLAGS in the
makefile, don't add suffix rules at all so that if suffixes are
added back via .SUFFIXES, the rules are still not there.

* src/main.c (main): Set default suffix rules after parsing makefiles.
* src/default.c (install_default_suffix_rules): Install a default
suffix rule only if there is no user defined rule.
* tests/scripts/features/suffixrules: Add tests.

2 years ago* tests/scripts/misc/general4: Only test empty PATH on UNIX
Paul Smith [Mon, 20 Feb 2023 16:11:59 +0000 (11:11 -0500)] 
* tests/scripts/misc/general4: Only test empty PATH on UNIX

2 years ago* gl/modules/make-glob: Avoid glibc glob if bug #866 is present
Paul Smith [Sun, 19 Feb 2023 22:43:12 +0000 (17:43 -0500)] 
* gl/modules/make-glob: Avoid glibc glob if bug #866 is present

2 years ago* tests/scripts/features/include [AIX]: Set explicit timestamps
Paul Smith [Sun, 19 Feb 2023 20:35:22 +0000 (15:35 -0500)] 
* tests/scripts/features/include [AIX]: Set explicit timestamps

2 years ago* tests/scripts/features/archives: Set CC properly
Paul Smith [Sun, 19 Feb 2023 19:49:56 +0000 (14:49 -0500)] 
* tests/scripts/features/archives: Set CC properly

2 years agoPrerelease GNU Make 4.4.0.91 4.4.0.91
Paul Smith [Sun, 19 Feb 2023 14:53:26 +0000 (09:53 -0500)] 
Prerelease GNU Make 4.4.0.91

* NEWS: Update the date.
* configure.ac: Change the release.

2 years ago* src/makeint.h [CYGWIN]: Use pipe mode for the jobserver
Paul Smith [Sun, 19 Feb 2023 13:52:02 +0000 (08:52 -0500)] 
* src/makeint.h [CYGWIN]: Use pipe mode for the jobserver

2 years agoDon't block for child exit if other commands have completed
Paul Smith [Sun, 19 Feb 2023 05:40:48 +0000 (00:40 -0500)] 
Don't block for child exit if other commands have completed

Running regression tests on a single CPU system shows that if a child
exits while we're checking prerequisites we might not notice it, and
then we might block waiting for the next child to exit before we try
to do more work even though we could.

* src/remake.c (update_goal_chain): Remember the command_count before
we start checking prerequisites and if it is different when we restart
at the top of the goal chain then don't block.

2 years agoClean up depth handling in debug output
Paul Smith [Sat, 18 Feb 2023 21:08:51 +0000 (16:08 -0500)] 
Clean up depth handling in debug output

The indentation shown in debug output was misleading.  Increment the
depth when we are working on a prerequisite, not for the current
target.

* src/remake.c (check_dep): Increment depth only on recursion.
(update_file_1): Ditto.  Don't show "Finished..." if prereqs are
still running.
* src/implicit.c (pattern_search): Increment depth for the entire
search.
* tests/scripts/features/output-sync: Support debug output when run
by hand.

2 years ago* src/makeint.h (WIN32_LEAN_AND_MEAN) [Windows]: Don't redefine.
Paul Smith [Sat, 18 Feb 2023 18:48:27 +0000 (13:48 -0500)] 
* src/makeint.h (WIN32_LEAN_AND_MEAN) [Windows]: Don't redefine.

Suggested for tcc builds by Christian Jullien <eligis@orange.fr>.

2 years ago* src/misc.c (ttyname) [OS/2]: Add an implementation for OS/2 kLIBC
KO Myung-Hun [Sat, 18 Feb 2023 18:43:16 +0000 (13:43 -0500)] 
* src/misc.c (ttyname) [OS/2]: Add an implementation for OS/2 kLIBC

2 years agoAllow jobserver style to be forced to "pipe"
Paul Smith [Sat, 18 Feb 2023 18:20:00 +0000 (13:20 -0500)] 
Allow jobserver style to be forced to "pipe"

Some systems that support mkfifo() don't support the usage that GNU
make wants.  Provide a way to force using "pipe" jobserver mode even
when mkfifo() is available.

* src/makeint.h (MK_OS_HURD): Define if we're on Hurd.
(JOBSERVER_USE_FIFO): Define if we have mkfifo() and we're NOT on
Hurd.
* src/main.c (main): Test JOBSERVER_USE_FIFO not HAVE_MKFIFO.
* src/posixos.c (jobserver_setup): Ditto.
* maintMakefile: Create a config check test for forcing "pipe" mode.
* tests/run_make_tests.pl: Show discovered FEATURES in verbose mode.

2 years ago[SV 63668] Use autoconf to detect the default C++ compiler
Paul Smith [Sun, 5 Feb 2023 15:22:13 +0000 (10:22 -0500)] 
[SV 63668] Use autoconf to detect the default C++ compiler

* configure.ac: Add AC_PROG_CXX to search for a C++ compiler.
(MAKE_CXX): Add the discovered compiler to config.h.
* src/default.c (default_variables): Use MAKE_CXX as the C++ compiler.

2 years ago* doc/make.texi: Fix typo (reported by <mao492479407@163.com>)
Paul Smith [Sun, 5 Feb 2023 14:42:49 +0000 (09:42 -0500)] 
* doc/make.texi: Fix typo (reported by <mao492479407@163.com>)

2 years ago* tests/scripts/variables/MAKEFLAGS: Fix some Perl warnings
Paul Smith [Sat, 4 Feb 2023 18:12:32 +0000 (13:12 -0500)] 
* tests/scripts/variables/MAKEFLAGS: Fix some Perl warnings

2 years ago* doc/make.texi: [SV 63689] Fix typos in examples
Dmitry Goncharov [Sat, 28 Jan 2023 18:09:36 +0000 (13:09 -0500)] 
* doc/make.texi: [SV 63689] Fix typos in examples

2 years ago* src/job.c: Switch from bit operators to flags macros
Paul Smith [Sat, 28 Jan 2023 18:01:39 +0000 (13:01 -0500)] 
* src/job.c: Switch from bit operators to flags macros

* src/remake.c: Ditto.

2 years ago[SV 63667] In .POSIX, use shell flags -c when ignoring errors
Paul Smith [Sat, 28 Jan 2023 16:03:54 +0000 (11:03 -0500)] 
[SV 63667] In .POSIX, use shell flags -c when ignoring errors

* src/variable.c (lookup_variable_for_file): New function to retrieve
a variable assignment in a file context.
* src/variable.h (lookup_variable_for_file): Declare it.
* src/job.c (construct_command_argv): Look up .SHELLFLAGS.  If .POSIX
is set and we're using the default value, choose -c if we're ignoring
errors else choose -ec.
(construct_command_argv_internal): Ditto.
* tests/scripts/targets/POSIX: Add tests.

2 years ago* tests/scripts/features/archives: [SV 63688] Quote cmd line vars
Dmitry Goncharov [Sat, 28 Jan 2023 14:41:49 +0000 (09:41 -0500)] 
* tests/scripts/features/archives: [SV 63688] Quote cmd line vars

2 years ago* README.in: Mention README.z/OS
Paul Smith [Sat, 28 Jan 2023 14:28:18 +0000 (09:28 -0500)] 
* README.in: Mention README.z/OS

2 years ago* tests/test_driver.pl: Convert z/OS answers for regex output
Paul Smith [Sun, 15 Jan 2023 15:53:38 +0000 (10:53 -0500)] 
* tests/test_driver.pl: Convert z/OS answers for regex output

Allow z/OS customizations to apply to regex output matching.
* tests/scripts/features/output-sync: Use a regex for Terminated.
* tests/scripts/features/temp_stdin: Ditto.

2 years ago* tests/scripts/features/archives: Use the configured compiler for CC
Paul Smith [Sun, 15 Jan 2023 15:27:53 +0000 (10:27 -0500)] 
* tests/scripts/features/archives: Use the configured compiler for CC

2 years ago* configure.ac: Delay setting HAVE_GUILE until we're sure
Paul Smith [Sun, 15 Jan 2023 15:27:34 +0000 (10:27 -0500)] 
* configure.ac: Delay setting HAVE_GUILE until we're sure

2 years agoPrerelease GNU Make 4.4.0.90 4.4.0.90
Paul Smith [Sat, 14 Jan 2023 19:05:18 +0000 (14:05 -0500)] 
Prerelease GNU Make 4.4.0.90

* NEWS: Update the date.
* README.git: Fix a typo.
* maintMakefile (check-alt-config): Report success.
(upload-*): Use the gnulib gnupload script for uploads.

2 years ago* tests/scripts/features/reinvoke: Warn about closing STDIN.
Paul Smith [Thu, 12 Jan 2023 00:17:07 +0000 (19:17 -0500)] 
* tests/scripts/features/reinvoke: Warn about closing STDIN.

* tests/scripts/features/temp_stdin: Ditto.
* tests/scripts/options/dash-f: Ditto.

2 years ago[SV 63638] Fix processing PATH on MS-Windows
Eli Zaretskii [Wed, 11 Jan 2023 13:44:56 +0000 (15:44 +0200)] 
[SV 63638] Fix processing PATH on MS-Windows

* src/variable.c (sync_Path_environment): Pass only the value of
PATH to convert_Path_to_windows32, excluding the "PATH=" part.

2 years agoUpdate support for OS/2
Paul Smith [Sun, 8 Jan 2023 23:44:25 +0000 (18:44 -0500)] 
Update support for OS/2

Patches provided by KO Myung-Hun <komh78@gmail.com>

* NEWS: Add a note.
* AUTHORS: Add a new author.
* README.OS2: Updates to build instructions.
* src/dir.c (dir_contents_file_exists_p): Use a stack copy when
modifying a const string.
* src/job.c (construct_command_argv_internal): Ditto.
Reuse variables rather than re-defining them.
(exec_command): Cast a const string (we don't change it anyway).
* src/getopt.c (_getopt_initialize): Reference unused variables.
(_getopt_internal): Add block braces to quiet the compiler.
* src/main.c (main): Cast argument to child_execute_job().
* src/posixos.c (set_blocking): Reference unused variables.
* src/remake.c (f_mtime): Delete useless code.

2 years ago[SV 17448] Ignore whitespace around $(file ...) names
Paul Smith [Sun, 8 Jan 2023 23:06:54 +0000 (18:06 -0500)] 
[SV 17448] Ignore whitespace around $(file ...) names

The other issues related to whitespace reported in this bug are
not addressed by this change.

* src/functions.c (func_file): Strip whitespace from the start and
end of the filename provided to the $(file ...) function.
* tests/scripts/functions/file: Add tests for this.
* tests/test_driver.pl: Use 3-arg version of open().

2 years ago[SV 61218] Ensure MAKEFLAGS is expanded even with -e
Paul Smith [Sun, 8 Jan 2023 21:40:55 +0000 (16:40 -0500)] 
[SV 61218] Ensure MAKEFLAGS is expanded even with -e

If -e was given we weren't expanding MAKEFLAGS before passing it
through the environment to jobs: we don't expand variables we
receive from the environment and when -e is given we set the
origin of MAKEFLAGS to "environment override".  Check for MAKEFLAGS
specifically, which seems like a hack but I don't have a better
idea offhand.

* src/main.c (main): Drive-by: use o_default for MAKEOVERRIDES.
* src/variable.c (target_environment): Always expand MAKEFLAGS
regardless of the origin type.
* tests/scripts/options/dash-e: Create a test.

2 years ago[SV 62654] Support GNU Make on z/OS
Paul Smith [Sun, 8 Jan 2023 02:50:59 +0000 (21:50 -0500)] 
[SV 62654] Support GNU Make on z/OS

Original patches provided by Igor Todorovski <itodorov@ca.ibm.com>
Reworked by Paul Smith <psmith@gnu.org>.
Thanks to IBM for providing a test system.

* NEWS: Announce support.
* AUTHORS: Ditto.
* README.zOS: Provide details on building GNU Make on z/OS.
* build.sh (get_mk_var): z/OS sh has a strange bug which causes it to
generate extra lines of output: rework the function to print output
as we compute it instead of collecting it into a variable, which
works around this bug.
* src/makeint.h: Declare MK_OS_ZOS if we're building for z/OS.
* src/arscan.c: Don't include <ar.h> on z/OS.
* src/job.c: We can't change environ in ASCII mode on z/OS.
* src/main.c: Ditto.  Also we can't use pselect() on z/OS.
* src/posixos.c: pselect() seems to hang on z/OS: don't use it.
* tests/run_make_tests.pl: Handle different exit codes on z/OS.
* tests/test_driver.pl: Preserve some special z/OS env.vars.
Add special checks to output comparisons when on z/OS.
* tests/scripts/features/archives: Don't validate names.  Don't
try to compile empty files as IBM compilers complain.
* tests/scripts/features/shell_assignment: Fix octal value of #.
* tests/scripts/features/temp_stdin: Don't print "term".
* tests/scripts/functions/shell: Handle shell exit codes.
* tests/scripts/targets/ONESHELL: Ditto.
* tests/scripts/targets/POSIX: sh -x prints differently.
* tests/scripts/variables/SHELL: Ditto.

2 years agoCreate src/mkcustom.h which is included by config.h
Paul Smith [Sun, 8 Jan 2023 14:38:59 +0000 (09:38 -0500)] 
Create src/mkcustom.h which is included by config.h

Put declarations for missing functions which we create in src/misc.c
into a file which is included by config.h via AH_BOTTOM().  This
ensures those prototypes are available, even in files added to
lib/... from gnulib.

* src/mkcustom.h: Add a new file with function declarations.
* configure.ac: Include src/mkcustom.h in config.h with AH_BOTTOM()
* Makefile.am: Add the header to the SRCS list.
* src/makeint.h: Remove content that we added to src/mkcustom.h.
* src/config.ami: Add #include "mkcustom.h" to specialized config.h.
* src/config.h-vms: Ditto.
* src/config.h.W32: Ditto.
* src/configh.dos: Ditto.

2 years agoInclude <strings.h> globally
Paul Smith [Sun, 8 Jan 2023 02:59:16 +0000 (21:59 -0500)] 
Include <strings.h> globally

Various code uses str{,n}casecmp() so include <strings.h>, if it
exists, everywhere.

* configure.ac: Check for <strings.h> explicitly.
* src/makeint.h: Include it if HAVE_STRINGS_H, for str{,n}casecmp().
* src/job.c: Remove include of <strings.h>.
* src/main.c: Ditto.

2 years ago* gl/lib/glob.c: Don't try to support _LIBC, don't use __stat()
Paul Smith [Sun, 8 Jan 2023 03:01:19 +0000 (22:01 -0500)] 
* gl/lib/glob.c: Don't try to support _LIBC, don't use __stat()

2 years ago[SV 63609] Avoid buffer overrun in --warn-undefined-variables
Paul Smith [Tue, 3 Jan 2023 07:14:24 +0000 (02:14 -0500)] 
[SV 63609] Avoid buffer overrun in --warn-undefined-variables

Reported by Dmitry Goncharov <dgoncharov@users.sf.net>

* src/variable.c (struct defined_vars): Create a struct that holds the
name and length of each variable name.
(warn_undefined): Check the lengths before comparing the contents.
* tests/scripts/options/warn-undefined-variables: Add a test.

2 years ago[SV 14927] Allow parallel builds for archives
Paul Smith [Tue, 3 Jan 2023 06:57:35 +0000 (01:57 -0500)] 
[SV 14927] Allow parallel builds for archives

Compare the timestamp of the object file (if it exists) with the
archived object and if the object file is newer, ensure it's updated
in the archive.

* NEWS: Announce the new capability.
* doc/make.texi (Dangers When Using Archives): Explain how to enable
parallel builds with archives.
* src/remake.c (f_mtime): For archive element files check the mod
time of the object file (if it exists) against the archive object
(if it exists).
* tests/scripts/features/archives: Add tests for this capability.

2 years ago[SV 61463] Don't export inherited private variables
Paul Smith [Mon, 2 Jan 2023 16:23:09 +0000 (11:23 -0500)] 
[SV 61463] Don't export inherited private variables

If a parent target has an exported variable that is private, don't
export it in child targets.

* NEWS: Mention this change.
* src/variable.c (target_environment): Ignore private inherited
variables.
* tests/thelp.pl: Add a new "env" operation to show env.var. values.
* tests/scripts/variables/private: Verify this new behavior.

2 years agoUpdate ancient glob/fnmatch implementations
Paul Smith [Mon, 2 Jan 2023 05:52:32 +0000 (00:52 -0500)] 
Update ancient glob/fnmatch implementations

I looked again at trying to use the latest gnulib implemenentations
of GNU glob and fnmatch, and the effort required to extract them
from gnulib and make them portable to systems which don't support
configure is simply far too daunting for me.  However it's clear
that the previous implementations are growing too long on the tooth
to continue to be used without some maintenance, so perform some
upkeep on them.

- Remove support for pre-ANSI function definitions.
- Remove the obsolete "register" keyword.
- Assume standard ISO C90/C99 header file support.
- Assume standard ISO C "void" and "const" support.
- Avoid symbols prefixed with "__" as they're reserved.

* maintMakefile: Add a rule to verify lib has the latest content.
* src/dir.c: Use void* not __ptr_t which was removed.
* gl/lib/glob.c: See above.
* gl/lib/fnmatch.in.h: See above.
* gl/lib/glob.in.h: See above.
* gl/lib/fnmatch.c: See above.  Remove __strchrnul(): it is not
checked anywhere and is only used in one place anyway.

2 years ago* doc/make.texi (Special Targets): Fix minor typo
Paul Smith [Mon, 2 Jan 2023 05:13:28 +0000 (00:13 -0500)] 
* doc/make.texi (Special Targets): Fix minor typo

Reported by Andrey Melnikov <vafilor@gmail.com>.

2 years agoDon't free uninitialized hash_table
Paul Smith [Sun, 1 Jan 2023 14:44:59 +0000 (09:44 -0500)] 
Don't free uninitialized hash_table

* src/dir.c (clear_directory_contents): We use ht_vec to mark when
we have initialized the hash_table: don't free if it's NULL.
(everywhere): Use NULL instead of 0 when working with pointers.

2 years ago* maintMakefile: Add missing quote
Paul Smith [Sun, 1 Jan 2023 14:55:24 +0000 (09:55 -0500)] 
* maintMakefile: Add missing quote

2 years agoConvert references from "GNU make" to "GNU Make"
Paul Smith [Sun, 1 Jan 2023 21:25:39 +0000 (16:25 -0500)] 
Convert references from "GNU make" to "GNU Make"

2 years agoUpdate to the latest gnulib stable branch
Paul Smith [Sun, 1 Jan 2023 21:08:35 +0000 (16:08 -0500)] 
Update to the latest gnulib stable branch

* bootstrap.conf: Request the latest gnulib stable branch.
* README.git: Recommend the argument form of autogen/autopull.
* bootstrap: Import the latest version of bootstrap.
* bootstrap-funclib.sh: Ditto.
* autogen.sh: Ditto.
* autopull.sh: Ditto.

2 years agoUpdate the copyright year on all files
Paul Smith [Sun, 1 Jan 2023 15:04:37 +0000 (10:04 -0500)] 
Update the copyright year on all files

2 years agoApply spelling fixes discovered by Codespell
Paul Smith [Sat, 31 Dec 2022 18:21:09 +0000 (13:21 -0500)] 
Apply spelling fixes discovered by Codespell

* maintMakefile: Apply spelling fixes.
* src/file.c: Ditto.
* src/misc.c: Ditto.
* src/remake.c: Ditto.
* src/vmsjobs.c: Ditto.
* src/w32/pathstuff.c: Ditto.
* tests/test_driver.pl: Ditto.
* tests/run_make_tests.com: Ditto
* tests/scripts/features/implicit_search: Ditto
* tests/scripts/features/output-sync: Ditto
* tests/scripts/features/patternrules: Ditto
* tests/scripts/features/se_explicit: Ditto
* tests/scripts/features/statipattrules: Ditto
* tests/scripts/functions/foreach: Ditto
* tests/scripts/variables/MAKEFLAGS: Ditto

2 years agoAvoid using false(1) in regression tests
Paul Smith [Sat, 31 Dec 2022 15:31:24 +0000 (10:31 -0500)] 
Avoid using false(1) in regression tests

The POSIX standard only requires false(1) to return a "non-zero" exit
code; almost all systems return 1 but some (Solaris!!!) return 255 or
possibly even other values.  Use our helper "fail" instead.

* tests/thelp.pl: Have the "fail" command obey -q.
* tests/scripts/features/parallelism: Helper -q no longer prints fail.
* tests/scripts/targets/POSIX: Replace false with #HELPER# -q fail 1.
* tests/scripts/variables/MAKEFLAGS: Ditto.
* tests/scripts/variables/SHELL: Ditto.

2 years agoMake bootstrap.bat more portable
Paul Smith [Mon, 26 Dec 2022 18:10:26 +0000 (13:10 -0500)] 
Make bootstrap.bat more portable

Using backslashes in a sed command line is tricky as different programs
use them differently as escape sequences.  Eli Zaretskii points out
that Windows "echo" doesn't do any processing, so rework all our sed
invocations to use script files created by echo.

* bootstrap.bat: Use echo to create sed script files instead of -e.
* Basic.mk.template: Fix typo in the comments.
* .gitignore: Ignore any .sed scripts.

2 years ago* NEWS: Add a section for the next release
Paul Smith [Sat, 24 Dec 2022 20:48:48 +0000 (15:48 -0500)] 
* NEWS: Add a section for the next release

Add a note for the MAKEFLAGS enhancements.

2 years ago[SV 63439, SV 63452] Don't warn on undefined internal variables
Paul Smith [Sat, 24 Dec 2022 15:30:13 +0000 (10:30 -0500)] 
[SV 63439, SV 63452] Don't warn on undefined internal variables

Don't generate undefined variable warnings for variables that are
internal / special to make and where the empty string is valid.
Rather than defining them to empty, which could introduce unwanted
behavior, keep a list of variable names which we should never warn
about.

* src/variable.h (warn_undefined): Convert the macro to a function.
* src/variable.c (defined_vars): Always "defined" variable names.
(warn_undefined): Implement as a function and check against the
defined_vars before generating a warning.
* src/read.c (read_all_makefiles): No need to reset warning flag.
* src/vpath.c (build_vpath_lists): Ditto.
* tests/scripts/options/warn-undefined-variables: Expand all the
pre-defined variables to ensure warnings are not generated.

2 years ago[SV 63552] Change directories before constructing include paths
Paul Smith [Sat, 24 Dec 2022 14:26:24 +0000 (09:26 -0500)] 
[SV 63552] Change directories before constructing include paths

* src/makeint.h (reset_makeflags): New function to handle changing
MAKEFLAGS from within makefiles.  Remove decode_env_switches().
* src/variable.c (set_special_var): Call reset_makeflags() instead
of various internal methods.
* src/main.c (decode_env_switches): Only internal now so make static.
(decode_switches): Don't invoke construct_include_path() yet.
(reset_makeflags): Decode env switches and construct include paths.
(main): Construct include paths after we process -C options.
* tests/scripts/options/dash-C: Rewrite to use new test constructs.
Add a test using both -C and -I together.
Add a test for multiple -C options.

2 years agotests [WINDOWS32]: Support Strawberry Perl on Windows
Paul Smith [Mon, 19 Dec 2022 05:24:42 +0000 (00:24 -0500)] 
tests [WINDOWS32]: Support Strawberry Perl on Windows

Strawberry Perl has some different behaviors from ActiveState Perl
which impact the test suite:

- Avoid Perl's chomp() as it may not remove CRs; chomp() may remove
  only the final NL but not the CR in a CRNL line ending.
- Strawberry Perl doesn't support ActiveState's system(1, ...) form.
- Strawberry Perl (or msys?) does something weird with "/tmp" when
  provided to exec(), replacing it with the user's %TEMP%.
- Strawberry Perl uses msys paths like /c/foo instead of C:\foo.

* tests/test_driver.pl (get_osname): Strawberry Perl uses 'msys' as
its $^O so if we see that use a port of 'W32'.
(_run_with_timeout): Strawberry Perl doesn't support the special
system(1, ...) form of system() so use POSIX standard fork/exec.
(compare_answer): Paths generated by Strawberry Perl use msys path
format (e.g., /c/foo instead of C:\foo); check for those differences
and compare RE against both the unmodified and modified log.
* tests/run_make_tests.pl (set_defaults): Switch from chomp to s///
to remove CRNL and NL line endings.
* tests/scripts/features/errors: Executing directories on Strawberry
will give an error; translate it to Windows error output format.
* tests/scripts/features/output-sync: Ditto.
* tests/scripts/features/temp_stdin: Ditto.
* tests/scripts/functions/realpath: Ditto.
* tests/scripts/options/dash-I: Ditto.
* tests/scripts/variables/INCLUDE_DIRS: Ditto.
* tests/scripts/misc/close_stdout: /dev/full is reported as existing
on Strawberry Perl, but it doesn't do anything.  Skip the test.
* tests/scripts/variables/MAKEFLAGS: When an argument containing
/tmp is passed to a program via exec(), something replaces it with
the expansion of the %TEMP% variable.  Instead of using /tmp create
a local directory to use.

2 years ago* tests/test_driver.pl: Remember if something failed and report it
Paul Smith [Tue, 20 Dec 2022 07:06:03 +0000 (02:06 -0500)] 
* tests/test_driver.pl: Remember if something failed and report it

2 years ago[WINDOWS32] Remove CRNL from FormatMessage() result string
Paul Smith [Mon, 19 Dec 2022 05:20:06 +0000 (00:20 -0500)] 
[WINDOWS32] Remove CRNL from FormatMessage() result string

Sometimes the error message is expected to contain a newline, other
times it is not.  Also the result of FormatMessage() sometimes ends
in CRNL already: when printed via fprintf() the final newline is
converted to CRNL, giving an output of CRCRNL which causes tests
to fail to match.  Remove any CR/NL chars from the result string.

* src/job.c (reap_children): Add \n to the error message fprintf.
(exec_command): Ditto.
* src/w32/subproc/w32err.c (map_windows32_error_to_string): Remove
any trailing CR or NL from the string before returning.

2 years ago[SV 63537] Document and test flippable switches
Dmitry Goncharov [Sun, 18 Dec 2022 15:29:17 +0000 (10:29 -0500)] 
[SV 63537] Document and test flippable switches

* doc/make.texi (Options/Recursion): Clarify that MAKEFLAGS values
from the environment have precedence over those set in the makefile.
* tests/scripts/variables/MAKEFLAGS: Check boolean switches -k/-S,
-w/--no-print-directory and -s/--no-silent as follows:
1. A switch can be enabled or disabled on the command line.
2. A switch can be enabled or disabled in env.
3. A switch can be enabled or disabled in makefile.
4. Command line beats env and makefile.
5. Env beats makefile.
6. MAKEFLAGS contains each specified switch at parse and build time.
7. If switches are specified in multiple origins, MAKEFLAGS contains
   the winning switch at parse and build time.
8. MAKEFLAGS does not contain the losing switch.
Also test that --debug settings from different origins are combined
together into one option.

2 years ago[SV 63537] Pass enabled-by-default switches to submake
Dmitry Goncharov [Sun, 18 Dec 2022 19:43:41 +0000 (14:43 -0500)] 
[SV 63537] Pass enabled-by-default switches to submake

Certain switches, such as -S or --no-silent, turn on behavior that is
enabled by default.  When a switch is specified via the command line,
makefile, or env, ensure the switch is added to MAKEFLAGS.

* src/main.c (struct command_switch): Add bit "specified".
(switches): Initialize command_switch->specified.
(decode_switches): Set command_switch->specified.
(define_makeflags): Check command_switch->specified.

2 years ago[SV 63537] Remember the origin of command line options
Dmitry Goncharov [Sun, 18 Dec 2022 15:01:30 +0000 (10:01 -0500)] 
[SV 63537] Remember the origin of command line options

Certain options can be flipped on and off: -k/-S, -s/--no-silent, and
-w/--no-print-directory.  Ensure they behave as follows:
 1. A switch can be enabled or disabled on the command line.
 2. A switch can be enabled or disabled in env.
 3. A switch can be enabled or disabled in makefile.
 4. Command line beats env and makefile.
 5. Env beats makefile.

* src/main.c: Add variables to hold the origin of relevant options.
(struct command_switch): Add origin field.
(switches): Set a pointer to hold the origin of relevant options.
(decode_switches): For any switch that can be specified in makefile or
env, honor the switch only if cs->origin is not set or the specified
origin beats cs->origin.  Set cs->origin when relevant.

2 years ago[SV 63537] Fix setting -w in makefiles
Dmitry Goncharov [Sun, 18 Dec 2022 14:49:34 +0000 (09:49 -0500)] 
[SV 63537] Fix setting -w in makefiles

* src/makeint.h: Replace print_directory flag with should_print_dir().
* src/main.c (main): Remove print_directory flag and related code.
(should_print_dir): Create.
* src/output.c (output_dump): Use should_print_dir().
(output_start): Ditto.

2 years ago[SV 63484] Force included makefiles to be explicit
Dmitry Goncharov [Sat, 17 Dec 2022 19:12:41 +0000 (14:12 -0500)] 
[SV 63484] Force included makefiles to be explicit

Ensure included makefiles are not treated as intermediate, even if
they are created by an implicit rule.
Reported by Patrick Oppenlander <patrick.oppenlander@gmail.com>.

* src/read.c (eval_makefile): Mark makefiles as explicit.
* tests/scripts/features/include: Add a test.

2 years ago[SV 63516] [DOS] Support include files with drivespecs
Paul Smith [Sat, 17 Dec 2022 16:01:31 +0000 (11:01 -0500)] 
[SV 63516] [DOS] Support include files with drivespecs

* src/makeint.h (HAVE_DRIVESPEC): Create a macro to check.
* src/main.c (.FEATURES): Add "dospaths" as a feature.
* src/read.c (eval_makefile) [DOS]: If the included makefile name
starts with a drivespec, don't search the include directories.
* doc/make.texi (Include): Document this behavior.
* tests/scripts/features/include: Add a test.

2 years ago* src/job.c (new_job): [SV 63510] Trace phony prerequisite rebuilds
Paul Smith [Sat, 17 Dec 2022 19:01:02 +0000 (14:01 -0500)] 
* src/job.c (new_job): [SV 63510] Trace phony prerequisite rebuilds

2 years ago* configure.ac: Update for a new release
Paul Smith [Sun, 18 Dec 2022 19:40:26 +0000 (14:40 -0500)] 
* configure.ac: Update for a new release

* README.git: Add some packages needed for building from Git.
* AUTHORS: Updates.

2 years ago[SV 63417] Ensure global .NOTINTERMEDIATE disables all intermediates
Dmitry Goncharov [Sun, 27 Nov 2022 20:40:28 +0000 (15:40 -0500)] 
[SV 63417] Ensure global .NOTINTERMEDIATE disables all intermediates

Fix .NOTINTERMEDIATE without prerequisites to disable intermediate
status for all targets.

* src/makeint.h: Declare extern no_intermediates.
* src/main.c: Add global definition of no_intermediates.
* src/file.c: Remove static no_intermediates to use global variable.
(remove_intermediates): Check no_intermediates.
* src/implicit.c (pattern_search): For a file found by implicit search
set file->notintermediate if no_intermediates is set.
* src/remake.c (update_file_1): Don't set file->secondary for a
pre-existing file if no_intermediates is set.  The check for
no_intermediates here is redundant, but won't hurt: keep it in case
things change so that it matters.
* tests/scripts/targets/NOTINTERMEDIATE: Fix a test.

2 years ago* doc/make.texi: Use $(firstword) rather than $(word 1,)
Paul Smith [Sun, 27 Nov 2022 20:31:56 +0000 (15:31 -0500)] 
* doc/make.texi: Use $(firstword) rather than $(word 1,)

2 years ago[SV 63347] Always add command line variable assignments to MAKEFLAGS
Dmitry Goncharov [Sun, 27 Nov 2022 19:09:17 +0000 (14:09 -0500)] 
[SV 63347] Always add command line variable assignments to MAKEFLAGS

This commit introduces two visible changes:
1. Keep command line variable assignments in MAKEFLAGS at all times,
   even while parsing makefiles.
2. Define makeflags immediately when a makefile modifies MAKEFLAGS.

The new MAKEFLAGS and MAKEOVERRIDES initialization procedure:
1. decode_switches (argc, argv, o_command) is called to parse command
   line variable assignments.
2. Command line variable assignments go through quote_for_env.
   Initialize -*-command-variables-*- to the quoted values.
3. MAKEOVERRIDES is initialized to refer to -*-command-variables-*-
   with origin o_env to keep the definitions in the database intact.
4. define_makeflags() is called which adds MAKEOVERRIDES to MAKEFLAGS.
5. Makefiles are parsed.  If a makefile modifies MAKEFLAGS, the new
   value of MAKEFLAGS is defined right away.
6. Env switches are decoded again as o_env.  The definitions set by
   decode_switches at step 1 stay intact, as o_command beats o_env.

We must preserve the original intact definitions in order to detect
failure cases; for example:
  $ cat makefile
  all:; $(hello)
  $ make hello='$(world'
  makefile:1: *** unterminated variable reference.  Stop.

* src/makeint.h: Declare enum variable_origin, struct variable and
define_makeflags().  Add parameter origin to decode_env_switches().
* src/main.c (define_makeflags): Remove "all". If a variable is
assigned on the command line then append MAKEOVERRIDES to MAKEFLAGS.
(decode_env_switches): Replace parameter env with origin.
(decode_switches): Replace parameter env with origin.
Treat origin == o_command as env == 0.
(handle_non_switch_argument): Replace parameter env with origin.
Treat origin == o_command as env == 0.
(main): Call decode_switches() with origin==o_command before parsing
makefiles.  Call decode_switches() with origin==o_env after parsing
makefiles.
* src/variable.c (set_special_var): Define makeflags at parse time,
each time a makefile modifies MAKEFLAGS.
(do_variable_definition): Strip command line variable assignments from
MAKEFLAGS before appending extra flags.  set_special_var() adds them
back.
* tests/scripts/variables/MAKEFLAGS: Add tests.

2 years ago* src/main.c (main): [SV 63373] Don't use macros with memcmp()
Paul Smith [Wed, 16 Nov 2022 14:27:53 +0000 (09:27 -0500)] 
* src/main.c (main): [SV 63373] Don't use macros with memcmp()

Reported by djm <mccannd@uk.ibm.com>

2 years agoAdd specific hints for errors due to invalid conditionals
Paul Smith [Tue, 15 Nov 2022 15:50:34 +0000 (10:50 -0500)] 
Add specific hints for errors due to invalid conditionals

* src/read.c (eval): If "missing separator" appears to be due to
missing space after ifeq/ifneq, give a hint about the error.
* tests/scripts/misc/failure: Check for these types of failures.
* tests/scripts/variables/special: Move error checking unrelated
to special variables, to misc/failure.

2 years ago[SV 63333] Be more lenient when failing to create temporary files
Dmitry Goncharov [Sun, 13 Nov 2022 21:20:33 +0000 (16:20 -0500)] 
[SV 63333] Be more lenient when failing to create temporary files

If make cannot create a temporary lock file for output sync, continue
without output sync enabled rather than dying.

However, if make cannot store a makefile from stdin to a temporary
file that is still a fatal error.

* misc.c (get_tmppath): Keep running on failure to generate a
temporary file name.
(get_tmpfd): Keep running on failure to get a temporary file.
(get_tmpfile): Keep running on failure to open a temporary file.
Ensure memory is freed if we return an error.
* posixos.c (os_anontmp): Keep running on failure to open an
anonymous temporary file.
* output.c (setup_tmpfile): Print an error on failure to create an
output sync lock file.
* main.c (main): Die on failure to store makefile from stdin to a
temporary file.
* tests/scripts/features/output-sync: Add tests.
* tests/scripts/features/temp_stdin: Ditto.

2 years agoKeep going if we can't connect to the jobserver
Paul Smith [Mon, 7 Nov 2022 20:55:21 +0000 (15:55 -0500)] 
Keep going if we can't connect to the jobserver

* src/posixos.c (jobserver_parse_auth): Don't invoke fatal() if we
can't connect to an existing jobserver: just keep going without it.
* src/w32/w32os.c (jobserver_parse_auth): Ditto.
* tests/scripts/features/jobserver: Add a test for invalid FIFO
auth files.

2 years ago* src/dir.c (dir_contents_file_exists_p): Show dir name in error.
Paul Smith [Mon, 7 Nov 2022 18:08:11 +0000 (13:08 -0500)] 
* src/dir.c (dir_contents_file_exists_p): Show dir name in error.

If we fail to read a directory show the directory name in the error
message.  Pass struct directory instead of directory_contents to
allow that.
(dir_file_exists_p): Change dir_contents_file_exists_p caller.
(open_dirstrem): Ditto.

2 years ago* src/main.c (main): [SV 63307] Handle SIGPIPE as a fatal signal
Paul Smith [Sun, 6 Nov 2022 20:22:02 +0000 (15:22 -0500)] 
* src/main.c (main): [SV 63307] Handle SIGPIPE as a fatal signal

Always ignoring SIGPIPE is visible to child processes.

2 years ago[SV 63315] tests: Simplify TERM signaling
Paul Smith [Sun, 6 Nov 2022 19:14:28 +0000 (14:14 -0500)] 
[SV 63315] tests: Simplify TERM signaling

Tests that try to kill the make process were not behaving as expected
on OpenBSD: the signal was sent from make to its children but the
sleep didn't die.  Something odd about the way the shell treats TERM.
To reduce platform dependencies add "term" to the helper tool and run
that instead of kill / sleep.

* tests/thelp.pl: Add a new operation "term" that takes a PID.
* tests/scripts/features/output-sync: Use it.
* tests/scripts/features/temp_stdin: Ditto.

2 years ago[SV 63315] Allocate function names when defining functions
Paul Smith [Sat, 5 Nov 2022 16:56:52 +0000 (12:56 -0400)] 
[SV 63315] Allocate function names when defining functions

* src/function.c (define_new_function): Don't keep a pointer to the
user-provided name of a user-defined function: if the .so is unloaded
it will point to garbage.  Add the name to the strcache instead.

2 years agotests: Don't convert \ to / when checking regex's
Paul Smith [Sat, 5 Nov 2022 16:46:29 +0000 (12:46 -0400)] 
tests: Don't convert \ to / when checking regex's

When tests compare the output they will try converting backslashes
to slashes to see if that works.  When we compare using regex's,
we can't do that because backslashes can escape special characters.

* tests/test_driver.pl (compare_output): Clean up this function.
(compare_answer_vms) [VMS]: Comparing answers on VMS is complex;
move all of it into its own function returning 0/1.
(compare_answer): A new function to compare answers: return 0/1.
Remember the CRLF->LF conversion forever; only check \ -> / when
we compare strings, not regex's.

2 years ago* src/hash.c (jhash_string): Help the compiler optimize the hash
Justine Tunney [Sun, 6 Nov 2022 17:13:21 +0000 (12:13 -0500)] 
* src/hash.c (jhash_string): Help the compiler optimize the hash

Invoke memcpy() with a constant length, where possible.

Copyright-paperwork-exempt: yes

2 years ago* src/config.h.W32 [TCC]: Only redefine strtoll if not defined
Paul Smith [Mon, 7 Nov 2022 21:50:30 +0000 (16:50 -0500)] 
* src/config.h.W32 [TCC]: Only redefine strtoll if not defined

2 years ago* src/config.h.W32: Fix last change.
Eli Zaretskii [Wed, 9 Nov 2022 13:15:20 +0000 (15:15 +0200)] 
* src/config.h.W32: Fix last change.

2 years agoFix build with Tiny C
Eli Zaretskii [Sat, 5 Nov 2022 14:46:58 +0000 (16:46 +0200)] 
Fix build with Tiny C

* src/config.h.W32 (strtoll, strtoull) [__TINYC__]: Redirect to
_strtoi64 and _strtoui64, respectively.  Reported by Christian
Jullien <eligis@orange.fr>.

2 years agoRelease GNU Make 4.4 4.4
Paul Smith [Fri, 28 Oct 2022 21:37:09 +0000 (17:37 -0400)] 
Release GNU Make 4.4

* NEWS: Update the version and date.
* configure.ac: Update the version.
* doc/make.texi: Update the EDITION.

2 years ago* README.git: Update and clarify release operations
Paul Smith [Sun, 30 Oct 2022 13:31:35 +0000 (09:31 -0400)] 
* README.git: Update and clarify release operations

2 years agoFix issues found by ASAN and Coverity
Paul Smith [Mon, 31 Oct 2022 05:48:33 +0000 (01:48 -0400)] 
Fix issues found by ASAN and Coverity

* tests/test_driver.pl: Preserve the LSAN_OPTIONS variable.
* tests/scripts/targets/ONESHELL: Don't set a local variable.
* tests/scripts/functions/let: Test empty let variable.
* src/posixos.c (osync_parse_mutex): Free existing osync_tmpfile.
* src/misc.c (get_tmpfd): Set umask() before invoking mkstemp().
* src/ar.c (ar_parse_name): Check invalid name (shouldn't happen).
* src/function.c (define_new_function): Free previous function entry
when replacing it with a new one.
* src/job.c (child_execute_job): Initialize pid for safety.
(construct_command_argv_internal): In oneshell mode ensure that the
returned argv has the right format (0th element is a pointer to the
entire buffer).

2 years agoAvoid C99 constructs
Paul Smith [Fri, 28 Oct 2022 17:03:18 +0000 (13:03 -0400)] 
Avoid C99 constructs

Although gnulib requires C99, most of the code does compile with a
C90 compiler (perhaps with a lot of warnings).  Reinstate our C90
configuration test, and clean up a few C99 things that crept in.

* src/job.c (construct_command_argv_internal): Don't use loop-local
variables or C++ comments.
* src/read.c (eval_makefile): Don't use loop-local variables.

2 years ago* build.sh: Allow a "keep-going" mode during builds
Paul Smith [Fri, 28 Oct 2022 21:10:28 +0000 (17:10 -0400)] 
* build.sh: Allow a "keep-going" mode during builds