2022-10-31  Paul Smith  <psmith@gnu.org>

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

	* README.git: Update and clarify release operations

	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).

2022-10-29  Paul Smith  <psmith@gnu.org>

	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.

2022-10-29  Paul Smith  <psmith@gnu.org>

	* build.sh: Allow a "keep-going" mode during builds

2022-10-29  Paul Smith  <psmith@gnu.org>

	tests: Avoid the use of File::Temp->newdir()
	This was added in Perl 5.8 but some systems still only provide older
	versions such as Perl 5.6.  We don't really need it anyway.
	Paul Eggert <eggert@cs.ucla.edu> reported this issue.

	* tests/README: Update this to be a bit more modern.
	* tests/test_driver.pl: Delete the $TEMPDIR variable.
	* tests/scripts/features/temp_stdin: Use $temppath not $TEMPDIR.

2022-10-29  Paul Smith  <psmith@gnu.org>

	* src/posixos.c (os_anontmp): [SV 63287] Only fail O_TMPFILE once
	Reported by Dmitry Goncharov <dgoncharov@users.sf.net>.

2022-10-28  Paul Smith  <psmith@gnu.org>

	[SV 62174] Force locale to be "C" before retrieving error messages
	We attempt to do this with POSIX::setlocale() but apparently on some
	systems (AIX) this isn't sufficient.  So, in addition force the LC
	environment variables to use "C".
	Reported by Dmitry Goncharov <dgoncharov@users.sf.net>.

	* tests/run_make_tests.pl: Move the global setup into set_default().
	Force the %ENV locale variables to use the ones we'll use when running
	make, then reset them back again after we find error messages.

2022-10-27  Paul Smith  <psmith@gnu.org>

	* src/job.c: [SV 63185] Don't use ifdef with HAVE_DECL_* macros

2022-10-25  Paul Smith  <psmith@gnu.org>

	* tests/scripts/features/exec: Don't test with C shells
	Using C shells (csh, tcsh) with make is known to be problematic due
	to incorrect ways it handles open file descriptors, at least.  If
	the user's shell is *csh then don't try it during exec tests.

2022-10-25  Paul Smith  <psmith@gnu.org>

	Increase the test framework timeout from 5s to 60s
	It seems that some of the test environments hit the 5s timeout on
	some tests.  Since it doesn't really matter, as long as we don't
	hang forever, increase the timeout to 60s.

	* tests/test_driver.pl: Increase $test_timout to 60.  We don't need
	to handle VMS timeouts specially anymore.
	* tests/scripts/features/parallelism: We don't need to override the
	default timeout anymore.
	* tests/scripts/features/patternrules: Remove confusing comment.

2022-10-25  Paul Smith  <psmith@gnu.org>

	* Makefile.am (check-regression): Add a random suffix to results file
	Put the results into a subdirectory for easy unpacking.
	* .gitignore: Ignore it.

2022-10-24  Paul Smith  <psmith@gnu.org>

	Release GNU Make 4.3.92
	* configure.ac: Modify the release version.
	* NEWS: Update the version and date.

2022-10-24  Paul Smith  <psmith@gnu.org>

	[SV 63260] Don't recurse forever if setup_tmpfile() fails
	If we fail during setup_tmpfile() we'll try to write an error, which
	will invoke setup_tmpfile() again, etc.  Avoid infinite recursion.
	Original patch by Dmitry Goncharov <dgoncharov@users.sf.net>

	* src/output.c (setup_tmpfile): Remember we're in this function and
	return immediately if we enter it during recursion.
	(message): Remember the starting location and use that instead of
	fmtbuf.buffer.
	(error): Ditto.
	(fatal): Ditto.

2022-10-24  Paul Smith  <psmith@gnu.org>

	* src/output.c (_outputs): Don't use invalid output sync FDs
	Just write to stdout/stderr in this situation.

	* src/misc.c (get_tmpdir): Report errors if tmpdirs are invalid
	* src/main.c (main): Set up initial temporary directories.

2022-10-23  Dmitry Goncharov  <dgoncharov@users.sf.net>

	* src/posixos.c (os_anontmp): If O_TMPFILE fails try dup() method.

2022-10-23  Paul Smith  <psmith@gnu.org>

	* src/rule.c (get_rule_defn): Don't use STRING_SIZE_TUPLE in mempcpy
	If mempcpy() is a macro then STRING_SIZE_TUPLE won't compile.

2022-10-23  Paul Smith  <psmith@gnu.org>

	Provide a maintainer-only debug method
	Generating debug logs to stdout or stderr makes it impossible to
	run tests etc. so create a dumb DBG facility to log to a temp file.
	This exists only in maintainer mode and the DBG macro gives a
	compile error if it's used in non-maintainer mode.

	* src/makeint.h (DBG): Call dbg() in maintainer mode, else error.
	(dbg): Define it in maintainer mode.
	* src/misc.c (dbg): Open a log file for append, write, then close.

2022-10-22  Paul Smith  <psmith@gnu.org>

	* configure.ac: Check that we can link with Guile
	On multi-arch systems we may be able to find the header file but
	not successfully link the library.

2022-10-22  Paul Smith  <psmith@gnu.org>

	Set PATH_MAX on systems without a default value
	Some systems (HURD) use fully-dynamic pathnames, with no limit.
	We can't support this without significant effort so for now set
	PATH_MAX to a large value.

	* src/makeint.h: Set PATH_MAX to 4096 if not set and MAXPATHLEN
	is also not set.  Remove MAXPATHLEN setting: we won't use it.
	* src/misc.c (get_path_max): If we can't get the path max via
	pathconf() use the default PATH_MAX.
	* src/dir.c (find_directory) [W32]: Use MAX_PATH not MAXPATHLEN.
	(local_stat) [W32]: Ditto.
	* src/job.c (create_batch_file) [W32]: Ditto.
	* src/remake.c (name_mtime) [W32]: Ditto.
	* src/w32/w32os.c (os_anontmp) [W32]: Ditto.

2022-10-22  Paul Smith  <psmith@gnu.org>

	[SV 63098] Enhance detection of missing peer also-make targets
	The previous attempt to detect missing peer targets for implicit
	rules had some holes.  Move the detection to notice_finished_file().

	* src/remake.c (check_also_make): If we don't have the current mtime
	for the file, obtain it.
	(update_goal_chain): Don't call check_also_make() here.
	(check_dep): Ditto.
	(notice_finished_file): If we finished running an implicit rule that
	has also_make targets, invoke check_also_make().

2022-10-22  Paul Smith  <psmith@gnu.org>

	Collect failure details when the regression tests fail
	* README.in: Add a section on running regression tests.
	* Makefile.am (check-regression): Capture the test run output, and
	on failure collect configure and test results into a tar file.

2022-10-22  Paul Smith  <psmith@gnu.org>

	Enhance tests to work on different systems
	The GNU platform testers reported a number of test errors on
	different systems; try to address them.

	* tests/thelp.pl: A number of tests timed out with a 4-second
	timeout.  Increase the default timeout to 10 seconds.
	* tests/run_make_tests.pl: Executing directories on cygwin behaves
	differently in Perl than make so skip these tests there.
	* tests/scripts/options/symlinks: Check for the symlink feature
	in make, rather than whether the system supports them.
	* tests/scripts/features/implicit_search: On some systems "false"
	exits with a different exit code.  Use the helper instead.
	* tests/scripts/features/loadapi: Ditto.
	* tests/scripts/features/output-sync: Sleep before make -f bar in
	the first test as well as the second one.
	* tests/scripts/features/exec: Skip on cygwin, which seems to
	be "UNIX" but where scripts don't run normally.
	* tests/scripts/misc/fopen-fail: Skip on cygwin, where make
	eventually exits with exit code 0 and no error messages.

2022-10-22  Dmitry Goncharov  <dgoncharov@users.sf.net>

	[SV 63243] tests: Avoid SIGTERM racing with make error messages
	Original patch from Frank Heckenbach <f.heckenbach@fh-soft.de>.

	* tests/scripts/features/output-sync: Introduce a sleep to let make
	write its error message.  Some systems use different names for
	SIGTERM so match with a regex.
	* tests/scripts/features/temp_stdin: Ditto.

2022-10-22  Dmitry Goncharov  <dgoncharov@users.sf.net>

	[SV 63236] Fix getloadavg related error message on AIX
	On AIX getloadavg keeps errno intact when it fails, resulting in a
	bogus error message from make.

	* src/job.c (load_too_high): Reset errno before calling getloadavg.

2022-10-22  Dmitry Goncharov  <dgoncharov@users.sf.net>

	[SV 63248] Ignore SIGPIPE
	Don't terminate when make's output is redirected to a pipe and the
	reader exits early; e.g.:
	  $ echo 'all:; sleep 2' | make -f- -j2 -O |:

	This lets us unlink temporary files, and tell the user that make was
	not able to write its output.
	Reported by Frank Heckenbach <f.heckenbach@fh-soft.de>.

	* src/main.c (main): Ignore SIGPIPE.
	* src/posixos.c (osync_clear): Fix a memory leak.

2022-10-18  Paul Smith  <psmith@gnu.org>

	* NEWS: Release GNU make 4.3.91

	* AUTHORS: Update the authors list.

	* NEWS: Use GNU Make instead of GNU make
	* README.git: Ditto.
	* README.Amiga: Ditto.
	* README.DOS: Ditto.
	* README.OS2: Ditto.
	* README.VMS: Ditto.
	* README.W32: Ditto.
	* README.customs: Ditto.
	* make-gdb.py: Ditto.
	* tests/run_make_tests.pl: Ditto.

	Update URLs to use https rather than http
	* (all): Change http:// to https://
	* README.W32: Remove invalid link to mingw.org.

2022-10-18  Paul Smith  <psmith@gnu.org>

	Rework temp file handling to avoid GNU libc warnings
	Original patch provided by Paul Eggert <eggert@cs.ucla.edu>.
	GNU libc will generate a link-time warning if we use mktemp() even
	though we are using it safely (we only use it with mkfifo()).
	Avoid this and clean up some handling.

	First, check all calls related to temporary files and exit with a
	fatal error and a useful message if we can't obtain them.  In some
	situations it might be possible to continue with reduced capability
	but it's not worth the effort.

	On POSIX systems we can create anonymous temp files using O_TMPFILE
	if it's supported, else if we're using the default location and we
	have dup(2), we can use standard tmpfile() and get an FD from it.

	If we need a named temp file and FILE* and we have mkstemp() we can
	use that, else if we have fdopen() we can get a temp FD and open it.
	If none of those are available all we can do is generate a temp name
	then open it with fopen() which is not secure.

	* src/makeint.h (get_tmpdir): Declare it for use elsewhere.
	* src/misc.c (get_tmpdir): Make it public not static.
	(get_tmptemplate): Simplify the implementation.
	(get_tmppath): Only define this if we have to have it to avoid
	warnings from GNU libc.
	(get_tmpfd): Generate fatal errors on error.
	(get_tmpfile): Ditto.  Open files in "wb+" mode to match tmpfile().
	Require a filename pointer (all callers want it).
	* src/os.h (os_anontmp): Implement for posixos.c as well.
	* src/posix.c (jobserver_setup): Don't use mktemp to avoid GNU libc
	errors.  Instead construct the FIFO name based on the PID.
	(osync_setup): get_tmpfd() can't fail so don't check it.
	(os_anontmp): If the system supports O_TMPFILE use it.  If not, and
	we want to create the temporary file in the default directory, we
	can use tmpfile() then use dup() to copy the file descriptor.
	* src/main.c (main): get_tmpfile() can't fail.
	* src/vmsjobs.c (child_execute_job): get_tmpfile() can't fail.

2022-10-18  Paul Smith  <psmith@gnu.org>

	Add ISDIRSEP() helper macro and use it
	Create a ISDIRSEP() macro to check for directory separator chars
	using the stopchar_map, and replace inline checks and explicit
	STOP_SET calls with this macro.

	* src/makeint.h (ISDIRSEP): Create the macro using MAP_DIRSEP.
	* src/dir.c (find_directory): Replace inline checks with ISDIRSEP.
	(file_exists_p): Ditto.
	(file_impossible): Ditto.
	(file_impossible_p): Ditto.
	(local_stat): Ditto.
	* src/file.c (lookup_file): Ditto.
	* src/function.c (abspath): Ditto.
	* src/job.c (_is_unixy_shell): Ditto.
	(is_bourne_compatible_shell): Ditto.
	(construct_command_argv): Ditto.
	* src/main.c (find_and_set_default_shell): Ditto.
	(main): Ditto.
	* src/read.c (eval): Ditto.
	(parse_file_seq): Ditto.
	* src/remake.c (name_mtime): Ditto.
	* src/vpath.c (construct_vpath_list): Ditto.

2022-10-18  Paul Smith  <psmith@gnu.org>

	Add preprocessor macros for different platforms
	* configure.ac: MK_CONFIGURE shows config.h was generated by configure.
	* src/config.ami: Define MK_AMIGAOS.
	* src/config.h-vms: Define MK_VMS.
	* src/configh.dos: Define MK_DJGPP.
	* src/config.h.W32: Define MK_W32 and WINDOWS32.
	* src/build_w32.bat: Let WINDOWS32 be defined by config.h.  Remove
	unused setting of WIN32.
	* src/job.c: Clean up use of WIN32.
	* src/main.c: Ditto.
	* tests/scripts/features/default_names: Ditto.

2022-10-18  Paul Smith  <psmith@gnu.org>

	Check for recipe line count overflow before it overflows
	awk 'BEGIN {
	       print "x:"
	       for (i = 0; i < 65536; i++)
	         printf "\techo %d\n", i}
	    ' | make -f -

	Outputs only "make: 'x' is up to date."  Larger values run only the
	lines above 65536.  Reported by Paul Eggert <eggert@cs.ucla.edu>.

	* src/commands.c (chop_commands): Check the line count before it has
	a chance to overflow.  Use size_t for max count so it can't overflow.
	Remove stray 'd' in diagnostic.

2022-10-18  Paul Smith  <psmith@gnu.org>

	Remove template files to simplify distribution creation
	The README templates were not useful since the replacement step
	didn't have anything to replace: rename them.

	Rather than creating template files for the config variants, create
	mkconfig.h.in containg PACKAGE_* variables to be replaced, and have
	config variant header files include it.  Note on POSIX we don't use
	this, and continue to generate a single config.h.in file.

	Use config.status to convert the README.in and mkconfig.h.in files
	during distribution creation.

	Modify all users of VERSION to use PACKAGE_VERSION instead.

	* configure.ac: Use GNU Make not GNU make as the package name.
	* README.in: Use GNU Make not GNU make.
	* README.git: Remove references to README.W32.template.
	* .gitignore: Update for new behavior.
	* Basic.mk.template: Remove unused posix_SOURCES and VERSION, and
	references to unshipped mk/Posix.mk
	* Makefile.am: Add src/mkconfig.h as an extra dist file.
	* bootstrap.bat: Rewrite mkconfig.h.in to mkconfig.h
	* maintMakefile: Remove obsolete template files; add mkconfig.h.in.
	* prepare_vms.com: Rewrite mkconfig.h.in to mkconfig.h
	* mk/VMS.mk: Fix incorrect header file prerequisite.
	* src/mkconfig.h.in: New file containing PACKAGE variables.
	* src/config.ami: Include mkconfig.h.
	* src/config.h.W32: Ditto.
	* src/configh.dos: Ditto.
	* src/config.h-vms: Ditto.
	* src/version.c: Use PACKAGE_VERSION not VERSION.

2022-10-16  Juan M. Guerrero  <juan.guerrero@gmx.de>

	Support building with DJGPP 2.05
	* builddos.bat: Use env var settings for paths.  Fix a typo in
	expand.o.  Add the missing load.o compilation and link.  Enable
	Guile support.  Copy Basic.mk from the correct location.
	* src/configh.dos.templage: DJGPP supports strtoll() and ssize_t
	given new enough versions.  Set preprocessor variables to 1 not 0.

2022-10-16  Paul Smith  <psmith@gnu.org>

	* src/job.c: [SV 63185] Include sys/loadavg.h if needed.

2022-10-16  Paul Smith  <psmith@gnu.org>

	[SV 63215] Remember the random seed for shuffle mode
	Basic fix provided by James Hilliard <james.hilliard1@gmail.com>.
	Ensure we remember and propagate the random seed we generate during
	shuffle mode.  Also add a debug statement displaying the seed.

	* src/shuffle.c (shuffle_set_mode): Init and save the randoms seed.
	* src/misc.c (make_rand): Code cleanups.
	* src/main.c (main): Show a debug message containing the seed.

2022-10-15  Paul Smith  <psmith@gnu.org>

	Use (void) rather than () in function declarations
	In C, a function declaration with () allows any set of arguments.
	Use (void) to mean "no arguments".

	* src/dep.h: Switch () to (void) for functions with no arguments.
	* src/makeint.h: Ditto.
	* src/os.h: Ditto.
	* src/shuffle.h: Ditto.
	* src/variable.h: Ditto.

2022-10-15  Paul Smith  <psmith@gnu.org>

	[SV 63157] Ensure temporary files are removed when signaled
	Original patch from Dmitry Goncharov <dgoncharov@users.sf.net>.
	When handling a fatal signal ensure the temporary files for
	stdin and the jobserver fifo (if in use) are deleted.

	* src/makeint.h (temp_stdin_unlink): Declare a new method.
	* src/main.c (temp_stdin_unlink): Delete the stdin temporary file
	if it exists.  If the unlink fails and we're not handling a signal
	then show an error.
	(main): Call temp_stdin_unlink() instead of unlinking by hand.
	* src/commands.c (fatal_error_signal): Invoke cleanup methods if
	we're handling a fatal signal.
	* tests/scripts/features/output-sync: Test signal handling during
	output sync and jobserver with FIFO.
	* tests/scripts/features/temp_stdin: Test signal handling when
	makefiles are read from stdin.

2022-10-15  Paul Smith  <psmith@gnu.org>

	* src/posixos.c (job_root): Remember root jobserver instances
	(jobserver_setup): Set job_root to true.
	(jobserver_clear): if we're the root instance and we're using a
	FIFO, unlink it.  If we're not in a signal handler, free memory.
	(jobserver_acquire_all): Call jobserver_clear().
	(sync_root): Rename from sync_parent for consistency.

	Set the proper type for variables set in signal handlers
	* bootstrap.conf: Get gnulib's sig_atomic_t type checking M4 macro.
	* configure.ac: Invoke it.
	* src/makeint.h (handling_fatal_signal): Set the type correctly.
	* src/commands.c (handling_fatal_signal): Ditto.

2022-10-08  Dmitry Goncharov  <dgoncharov@users.sf.net>

	* tests/test_driver.pl (toplevel): [SV 63156] Keep temp env vars

2022-10-03  Paul Smith  <psmith@gnu.org>

	Clean up some warnings on Windows builds
	* src/arscan.c (parse_int): Avoid conversion from int to char and
	check for overflow given a max value.
	(ar_scan): Check intmax sizes then cast to the proper type.
	(ar_member_touch): Get proper return type from ar_scan and cast it
	to off_t.
	* src/function.c (a_word_hash_cmp): Don't cast from size_t to int.
	(func_filter_filterout): Count using unsigned long to avoid casts.
	(construct_include_path): Explicitly cast to void*.
	* src/shuffle.c (reverse_shuffle_array): Use size_t index.
	* src/w32/subproc/sub_proc.c (process_wait_for_multiple_objects):
	Initialize the return value in case the count is 0.

	* src/misc.c (make_lltoa): Use printf format macro from makeint.h
	(make_ulltoa): Ditto.

	* src/arscan.c (ar_scan): Avoid sign comparison warnings
	Pacify 12.2.1 20220819 (Red Hat 12.2.1-2) -Wsign-compare by checking
	the readbuf() return explicitly for errors then casting from ssize_t.
	Initial patch provided by Paul Eggert <eggert@cs.ucla.edu>.

2022-10-03  Paul Eggert  <eggert@cs.ucla.edu>

	Support systems with 32-bit long and 64-bit time_t
	Don't assume that time_t fits in long, as some hosts (e.g.,
	glibc x86 -D_TIME_BITS=64) have 32-bit long and 64-bit time_t.

	* bootstrap.conf (gnulib_modules): Add largefile, to support files
	with timestamps after Y2038 on hosts with 32-bit long.
	* configure.ac: Do not call AC_SYS_LARGEFILE, as the largefile module
	does that for us.
	* src/makeint.h (PRIdMAX, PRIuMAX, SCNdMAX): Define if not already
	defined (taken from gnulib).
	* src/ar.c: Include intprops.h, for TYPE_MAXIMUM, as
	INTEGER_TYPE_MAXIMUM does not work on time_t without issuing a bunch
	of warnings.
	(ar_member_date): Check that result is in time_t range.
	(ar_member_date_1): Use intmax_t to hold the date.
	(ar_glob_match): Ditto.
	* src/arscan.c (VMS_function, VMS_function_ret, ar_scan)
	(parse_int, ar_scan, ar_member_pos, ar_member_touch)
	(describe_member): Convert long int to intmax_t.
	* src/file.c (file_timestamp_sprintf): Use intmax_t/uintmax_t instead
	of long/unsigned long for values that might be time_t.
	* src/arscan.c (ar_member_touch): Fix buffer overrun if the timestamp
	is too large.

2022-10-03  Paul Smith  <psmith@gnu.org>

	Add support for intmax_t
	* configure.ac: Ask autoconf to detect it.
	* src/config.ami.template: Add #define intmax_t for AmigaOS.
	* src/config.h-vms.template: Add #define intmax_t for VMS.
	* src/config.h.W32.template: Add #define intmax_t for Windows.
	* src/configh.dos.template: Add #define intmax_t for MS-DOS/DJPP.

	* NEWS: Deprecate Xenix

2022-10-02  Paul Smith  <psmith@gnu.org>

	[SV 63098] Temporarily revert the change to pattern rule behavior
	The fix for SV 12078 caused a backward-compatibility issue with some
	makefiles.  In order to allow users to resolve this issue, revert
	that change for this release cycle: it will be reinstated in the
	next release cycle.  Introduce a warning if we detect that the recipe
	of a multi-target pattern rule doesn't create all the targets.

	* NEWS: Announce the future backward-incompatibility.
	* doc/make.texi (Pattern Intro): Describe the behavior and that it
	will change in the future.
	* src/remake.c (check_also_make): Check for also_make targets that
	were not created and generate a warning.
	(update_goal_chain): Call the new function.
	(check_dep): Ditto.
	(update_file_1): Defer implicit rule detection until after we check
	all the also_make files (as it used to be).
	* tests/scripts/features/patternrules: Add tests of the new warning.
	Skip the tests for SV 12078.

2022-10-02  Paul Smith  <psmith@gnu.org>

	* doc/make.texi (Prerequisite Types): [SV 58056] Clarify ordering.

	* src/filedef.h (is_ordinary_mtime): Check for "ordinary" mod time.
	* src/remake.c (update_file_1): Use the new macro.

	* src/remake.c (update_file_1): Return valid enum element, not 0.

	* NEWS: Announce deprecation of OS/2 and AmigaOS ports

	* src/main.c (main): Add debug output for jobserver and osync.
	* src/posixos.c (jobserver_setup): Remove redundant debug output.
	(jobserver_parse_auth): Ditto.

2022-10-02  Andreas Schwab  <schwab@suse.de>  (tiny change)

	[SV 63111] Ensure output-sync is cleaned on re-exec and recursion
	Now that output-sync is using a separate file as a mutex rather than
	stdout, ensure the new file descriptor is closed before re-exec and
	not inherited by children.

	* src/main.c (main): Call osync_clear() before re-exec.
	* src/posixos.c (osync_setup): Reset output-sync handle inheritance.
	(osync_parse_mutex): Ditto.

2022-10-01  Paul Smith  <psmith@gnu.org>

	* src/function.c: Change int to uint to align with gmk_func_ptr

2022-10-01  Dmitry Goncharov  <dgoncharov@users.sf.net>

	* doc/make.texi (Loaded Object API): [SV 63126] Fix typos and examples

2022-10-01  Paul Smith  <psmith@gnu.org>

	Implement a simple xorshift 32bit random number generator
	Avoid relying on the system random number generator for our random
	shuffle, so that the same seed gives the same results on all systems.
	This generator doesn't need to be amazing, just pretty good, so don't
	bother with xorshift* or xorshift+, etc.

	* src/makeint.h: Declare make_seed() and make_rand().
	* src/misc.c (make_seed): Set the seed value for the RNG.
	(make_rand): Return the next random number.  If the seed was not set
	initialize it first.
	* src/shuffle.c (shuffle_set_mode): If we don't get a seed from the
	user just leave it unset (0).
	(shuffle_deps_recursive): Use make_seed() not srand().
	(random_shuffle_array): Use make_rand() not rand().

2022-09-25  Dmitry Goncharov  <dgoncharov@users.sf.net>

	[SV 63100] Set the floc of every created goal dep struct
	* src/read.c (eval): Initialize the goaldep floc pointer.
	* tests/scripts/features/loadapi: Verify that the floc is set after
	unloading and reloading dynamic objects.

2022-09-25  Paul Smith  <psmith@gnu.org>

	* doc/make.texi: Update out of date behavior for grouped targets.

	* README.git: Announce releases to the platform-testers list

2022-09-25  Paul Smith  <psmith@gnu.org>

	Provide new functions to convert long long to string
	The previous attempt to use PRI* macros to avoid compiler-specific
	printf format specifiers didn't work because we are using raw
	long long type, not the uintX_t types.  On systems where long and
	long long are the same size, uint64_t might be type "long" and PRId64
	is just "ld".

	Instead write new functions that convert [unsigned] long long to a
	string and call those instead.

	* src/makeint.h: Declare make_lltoa() and make_ulltoa().
	* src/misc.c (make_lltoa): New function that writes a long long value
	into a provided buffer.  Return the buffer for ease-of-use.
	(make_ulltoa): Ditto, for unsigned long long.
	* src/function.c (func_wordlist): Call these new methods.  Also
	rework the error strings so we share the translated string.
	* src/dir.c (print_dir_data_base): Call the new methods instead of
	using MSVC macros.

2022-09-25  Paul Smith  <psmith@gnu.org>

	Always restore global environ if we use vfork
	We may change the global environ variable in the child; when using
	vfork() this also sets it in the parent.  Preserve the parent's
	environ in child_execute_job() so it takes effect for all callers.

	Reported by Denis Excoffier <bug-tar@Denis-Excoffier.org>
	Root cause found by Martin Dorey <Martin.Dorey@hitachivantara.com>

	* src/job.c (start_job_command): Remove save/restore of the parent
	environment.
	(child_execute_job): Add save/restore of the parent environment,
	if we use vfork().
	* tests/scripts/functions/shell: Add a test the crashes if we don't
	reset environ after we run $(shell ...).

2022-09-25  Dmitry Goncharov  <dgoncharov@users.sf.net>

	* configure.ac: [SV 63070] Clean up the test program for posix_spawn.

2022-09-25  Paul Smith  <psmith@gnu.org>

	* src/posixos.c (osync_clear): Don't close invalid FDs.

	* maintMakefile: Use gnulib ncftpput-ftp if ncftpput is missing.

	* src/misc.c (strncasecmp): Use size_t for length to match std.
	* src/misc.h (strncasecmp): Fix the declaration.

	* configure.ac: Update to GNU make 4.3.91
	* NEWS: Update the version and clarify some backward-compat issues.

2022-09-25  Eli Zaretskii  <eliz@gnu.org>

	Fix compiler warnings in the MS-Windows build.
	* src/w32/w32os.c (osync_get_mutex, osync_parse_mutex): Cast to
	DWORD_PTR when converting integers to HANDLEs and vice versa.

	* src/w32/pathstuff.c (w32ify): Pacify compiler warnings about
	'strncpy'.

	* src/makeint.h (PRId64) [!HAVE_INTTYPES_H]: Define if undefined.
	* src/function.c (func_wordlist): Use PRId64 instead of %lld.

2022-09-24  Eli Zaretskii  <eliz@gnu.org>

	Avoid compilation warnings
	* src/implicit.c: (pattern_search):
	* src/main.c: (main): Avoid compilation warnings for variables
	only used when compiling a debug version with assertions.

2022-09-20  Paul Smith  <psmith@gnu.org>

	Release GNU make 4.3.90
	* NEWS: Update for the prerelease.
	* bootstrap.conf: Choose the latest stable gnulib.
	* README.git: Updates.

	* tests/script/parallelism: Force wait to remove races.

2022-09-20  Dmitry Goncharov  <dgoncharov@users.sf.net>

	[SV 56301] Fail if an included makefile can't be built
	Fail if a mandatory include file fails to be built even if it's
	built as part of a grouped target where the other include file
	is optional.

	* src/main.c (main): If a makefile doesn't build set any_failed.
	* tests/scripts/features/include: Add tests.
	* tests/scripts/options/dash-k: Stop after include build failure.

2022-09-20  Paul Smith  <psmith@gnu.org>

	* tests/scripts/features/statipattrules: [SV 17374] Add test
	Verify that double-colon static pattern rules work.

2022-09-20  Paul Smith  <psmith@gnu.org>

	[SV 12078, SV 62809] Rebuild grouped targets if any is missing
	If any of a set of grouped targets is missing or out of date, even
	if make is not trying to build that target, rebuild them all.
	Ensure this is true for explicit grouped targets as well as pattern
	rule grouped targets.

	Original patch by Jonathan Gravel <jo@stashed.dev>

	* src/remake.c (update_file_1): After matching any pattern rules,
	go through the also_make targets and set noexist as needed.  Also
	compute the oldest this_mtime.
	* tests/scripts/features/grouped_targets: Add regression tests.
	* tests/scripts/features/patternrules: Ditto.
	* tests/features/vpath: Rewrite to use modern run_make_test().
	Add a test that we check for VPATH before implicit rule search.
	Move the tests in vpath2 and vpath3 into this suite.
	* tests/features/vpathplus: Rewrite to use modern run_make_test().

2022-09-17  Dmitry Goncharov  <dgoncharov@users.sf.net>

	* tests/scripts/targets/WAIT: [SV 63071] Remove possible test races.

2022-09-13  Paul Smith  <psmith@gnu.org>

	* doc/make.texi (Parallel Disable): Add clarifications.
	* NEWS: Suggest how to change makefiles that use $(MAKEFLAGS).

2022-09-12  Paul Smith  <psmith@gnu.org>

	[SV 13862] Implement the .WAIT special target
	The next version of the POSIX standard defines parallel execution
	and requires the .WAIT special target as is implemented in some other
	versions of make.

	This implementation behaves similarly to others in that it does not
	create a relationship between targets in the dependency graph, so
	that the same two targets may be run in parallel if they appear as
	prerequisites elsewhere without .WAIT between them.

	Now that we support .WAIT it's trivial to also support prerequisites
	of the .NOTPARALLEL special target, which forces the prerequisites of
	those targets to be run serially (as if .WAIT was specified between
	each one).

	* NEWS: Announce the new .WAIT and .NOTPARALLEL support.
	* doc/make.texi (Parallel Disable): A new section to discuss ways in
	which parallel execution can be controlled.  Modify cross-refs to
	refer to this section.
	* src/dep.h (struct dep): Add a new wait_here boolean.
	(parse_file_seq): Add PARSEFS_WAIT to check for .WAIT dependencies.
	* src/file.c (split_prereqs): Use PARSEFS_WAIT.
	(snap_deps): If .NOTPARALLEL has prerequisites, set .WAIT between
	each of _their_ prerequisites.
	(print_prereqs): Add back in .WAIT when printing prerequisites.
	* src/implicit.c (struct patdeps): Preserve wait_here.
	(pattern_search): Ditto.  Use PARSEFS_WAIT when parsing prereqs for
	pattern rule expansion.
	* src/read.c (check_specials): Don't give up early: remembering to
	update these options is not worth the rare speedup.
	(check_special_file): If .WAIT is given as a target show an error--
	once--if it has prereqs or commands.
	(record_files): Call check_special_file on each target.
	(parse_file_seq): If PARSEFS_WAIT is given, look for .WAIT prereqs.
	If we see one assume that we are building a struct dep chain and set
	the wait_here option while not putting it into the list.
	* src/remake.c (update_file_1): If wait_here is set and we are still
	running, then stop trying to build this target's prerequisites.
	* src/rule.c (get_rule_defn): Add .WAIT to the prerequisite list.
	* src/shuffle.c (shuffle_deps): Don't shuffle the prerequisite list
	if .WAIT appears anywhere in it.
	* tests/scripts/targets/WAIT: Add a test suite for this feature.

2022-09-12  Dmitry Goncharov  <dgoncharov@users.sf.net>

	[SV 63045] Reload each intact unloaded shared object
	If makefile rules do not update an unloaded shared object, load it
	again.  Avoid double loading of the same object if the setup function
	returns -1.

	* src/filedef.h (struct file): Add "unloaded" flag.
	* src/makeint.h (load_file): Take struct file *.
	(unload_file): Return int.
	* src/main.c (main): Reload unloaded shared objects if they weren't
	updated.
	* src/commands.c (execute_file_commands): Set "unloaded" and reset
	"loaded" when a shared object is unloaded.
	* src/read.c (eval): Set "loaded" and reset "unloaded" when a shared
	object is loaded.  Add successfully loaded files to the db.
	* src/load.c (load_file): Check "loaded" to avoid double loading the
	same object.  Fix a memory leak of string loaded.  Return -1, rather
	than 1, if the object is already loaded. This fixes double loading of
	the same object when the setup routine returns -1.
	(load_object): Add a log message.
	(unload_file): Return an error on dlclose failure.  Log a message.
	* tests/scripts/features/loadapi: Add new tests.

2022-09-12  Sergei Trofimovich  <siarheit@google.com>

	[SV 63047] Fix shuffle of SECONDEXPANSION prerequisites
	Commit 07eea3aa4 `make --shuffle` prevented shuffling prerequisites
	that use .SECONDEXPANSION, since shuffle happens before expansion.
	This has two problems:
	1. No shuffling happens for such prerequisites.
	2. Use-after-free when outdated '->shuf' links are used.

	Add a reshuffle into expansion phase right after dependency changes.

	* src/file.c (expand_deps): Add reshuffle if dependencies change.
	* src/shuffle.c (identity_shuffle_array): Fix comment typo.
	* tests/scripts/options/shuffle: Add new SECONDEXPANSION test.

2022-09-11  Paul Smith  <psmith@gnu.org>

	* doc/make.texi (How Make Works): Clarify default goal exceptions.

	* src/shuffle.c: Minor coding changes.

2022-09-11  Paul Smith  <psmith@gnu.org>

	Support the MAKE_TMPDIR environment variable
	Allow build systems to choose an alternative location for make to
	store its temporary files.

	* NEWS: Announce the new environment variable.
	* doc/make.texi (Temporary Files): Provide documentation.
	* src/misc.c (get_tmpdir): Split into a new function.  Compute the
	temporary directory and store it in a static location.
	* tests/scripts/features/jobserver: Add a test of MAKE_TMPDIR.

2022-09-10  Paul Smith  <psmith@gnu.org>

	[SV 62898] Document ways to hide special chars from make functions
	* doc/make.texi (Function Call Syntax): Add a subsubheading describing
	which special characters may need to be hidden from make functions.

2022-09-10  Dmitry Goncharov  <dgoncharov@users.sf.net>

	[SV 63044] load: Update .LOADED if the setup function returns -1
	* src/load.c (load_file): Update .LOADED if setup returns non-0.
	* tests/scripts/features/load: Change the return value based on an
	environment variable.  Ensure that returning -1 still adds to
	.LOADED.  Also add a test that verifies that make doesn't try to
	rebuild the loaded file if -1 is returned.

2022-09-10  Paul Smith  <psmith@gnu.org>

	Enhance the make.texi formatting
	Notes provided by Tzvetelin Katchov <katchov@gnu.org>.

	* doc/make.texi: Remove obsolete @refill statements.  Add some breaks
	to overfull lines.  Fix up some example text.

2022-09-10  Paul Smith  <psmith@gnu.org>

	Clean up maintMakefile
	Notes provided by Tzvetelin Katchov <katchov@gnu.org>

	* maintMakefile (git-very-clean): Add -x to git clean.
	(GNULIBDIR): Use GNULIB_SRCDIR, or the local module if not set.

2022-09-10  Paul Smith  <psmith@gnu.org>

	[SV 63037] Fix tests for newer OS / compiler
	* tests/scripts/features/load: Add function prototypes.
	* tests/scripts/features/temp_stdin: Only set user execute bits.
	Some configurations don't allow changing the group bits...??

2022-09-10  Paul Smith  <psmith@gnu.org>

	[SV 63040] shell: Fall back to the callers environment
	If we detect a recursive variable reference when constructing the
	environment for the shell function, return the original value from the
	caller's environment.  Other options such as failing, returning the
	empty string, or returning the unexpanded make variable value have
	been shown to not behave well in real-world environments.  If the
	variable doesn't exist in the caller's environment, return the empty
	string.

	Found by Sergei Trofimovich <slyich@gmail.com> when testing older
	versions of autoconf.

	* NEWS: Clarify this behavior.
	* doc/make.texi (Shell Function): Ditto.  Also add info about !=.
	* src/expand.c (recursively_expand_for_file): Search the caller's
	environment if we detect a recursive variable expansion.
	* tests/scripts/functions/shell: Add tests for this behavior.

2022-09-08  Paul Smith  <psmith@gnu.org>

	[SV 63016] Don't fail exporting to $(shell ...)
	The fix for SV 10593 caused recursive expansion errors when exporting
	a variable that contains a $(shell ...) invocation.  If we see this
	type of recursion, ignore it and expand to the empty string rather
	than failing.

	* src/variable.h (env_recursion): New global variable.
	* src/variable.c (target_environment): If creating the environment
	for a $(shell ...) function increment env_recursion.  Remove the
	check for expansion in a shell function context.
	* src/expand.c (recursively_expand_for_file): Check for recursive
	expansion in a $(shell ...) environment context and if present,
	show the verbose message and return the empty string.
	* tests/scripts/functions/shell: Add a test for this situation.

2022-09-08  Paul Smith  <psmith@gnu.org>

	Ensure debug output ends in newline
	* src/load.c (load_object): Debug output strings must include \n.
	* src/variable.c (target_environment): Ditto.
	* src/posixos.c: Remove extra newlines.

2022-09-08  Paul Smith  <psmith@gnu.org>

	Sanitize tar file ownership, mode, and order
	For reproducibility ensure all files in the dist tar file are owned by
	root, and sorted by name.  Force the mode on all files to be writable
	by the owner and not writable by group or user, by default.

	Remove unnecessary execute permissions from build_w32.bat.

	Recommended by Tzvetelin Katchov <katchov@gnu.org>.

2022-09-08  Paul Smith  <psmith@gnu.org>

	bootstrap: Update to the latest gnulib bootstrap model
	* README.git: Document the changes.
	* bootstrap.conf: Set GNULIB_REVISION to avoid random updates.
	* configure.ac: Set the minimum autoconf version back to 2.69:
	that's the most common version deployed today, and it still works.
	* bootstrap: Copy the latest from gnulib.
	* autogen.sh: Ditto.
	* autopull.sh: Ditto.
	* bootstrap-funclib.sh: Ditto.

2022-08-30  Paul Smith  <psmith@gnu.org>

	Fix tests for MacOS and Windows
	* maintMakefile: Remove the template headers as prerequisites.
	* tests/scripts/features/jobserver: Only test fifo if enabled.
	* tests/scripts/variables/INCLUDE_DIRS: On MacOS none of the default
	directories exist so .INCLUDE_DIRS is empty by default.
	* tests/scripts/features/se_explicit: Fail via exit.  cp will show
	different error messages on different systems.
	* tests/scripts/features/se_implicit: Ditto.
	* tests/scripts/features/se_statpat: Ditto.

2022-08-30  Paul Smith  <psmith@gnu.org>

	[SV 62840] Don't change IO buffering before printing version
	If users run 'make --version | head -n1' they expect make to exit
	with a success (0) code.  This works because the pipe forces the
	default buffering on stdout to be fully buffered so all the output
	is printed to the pipe in a single write(2) and won't fail.  However
	due to output sync we forcibly set stdout to line buffered, which
	means if the reader closes the pipe fast enough make will exit with
	an error code because the write to stdout failed.

	Move the setup done in output_init() back into main() where it can
	be done in a proper order.  Rework the order of operations during
	startup so that we check for help and version flags before we change
	the buffering.  Clean up the behavior of print_usage().

	Original changes from Dmitry Goncharov <dgoncharov@users.sf.net>.

	* src/main.c (switches): Don't send --version in the environment.
	(print_usage): Add a blank line after the version before the usage.
	Move the die() into this function since we always die() afterward.
	Note the die will flush so no need to do it explicitly.
	(print_version): The caller will fflush when appropriate.
	(close_stdout): Move from output.c so it is installed early.
	(decode_switches): Only call print_usage on error, not for --help.
	(main): Install the close_stdout handler immediately after start.
	Move the calls to print_usage() due to --help and --version to be
	called immediately after we decode the switches.  Move the buffer set
	here from output_init(), immediately after we know we'll be running.
	* src/output.c (output_init): Move buffer setting to main().
	(close_stdout): Move to main().

2022-08-30  Paul Smith  <psmith@gnu.org>

	Rework output sync to lock a temp file on POSIX
	Some POSIX systems do not allow locks to be taken on non-files, such
	as pipes.  This is a problem since very often make is invoked with
	its stdout redirected to a pipe.  Also, if stdout is redirected to a
	file that already has a lock on it for some other reason (perhaps a
	shared file such as /dev/null) it can cause a hang.

	This means our previous method of locking stdout, although it had some
	nice advantages, is not portable enough.  Instead, use a temporary
