2020-01-19  Paul Smith  <psmith@gnu.org>

	GNU Make release 4.3
	* NEWS: Update for the release
	* configure.ac: New release number
	* doc/make.texi: New edition number

	* configure.ac (guile): Check for Guile 3.0 installations

	* src/job.c (sh_cmds): [SV 57625] Update builtin shell command list

	Resolve some documentation issues
	* doc/make.texi (Interrupts): [SV 46193] Recommend defensive recipes
	* doc/make.texi: [SV 49262] Clarify interaction of prerequisites and
	non-terminal match-anything rules.

2020-01-19  Paul Smith  <psmith@gnu.org>

	[SV 40657] Reinstate old behavior for suffix rules with prereqs
	POSIX says that suffix rules cannot have prerequisites, but after
	making this change we observed a number of makefiles "in the wild"
	that were relying on this behavior and failed.

	For .POSIX: makefiles, obey POSIX.  Otherwise preserve the old
	behavior.  However, generate a warning so users know this is a
	problem.  In a future version we will change all behavior to be
	POSIX-conforming.

	* NEWS: describe the change
	* src/rule.c (convert_to_pattern): If posix_pedantic don't make a
	pattern rule if prereqs exist.  Otherwise show a warning.
	* tests/scripts/features/suffixrules: Add tests for the new behavior
	including .POSIX vs. non-.POSIX.

2020-01-05  Dmitry Goncharov  <dgoncharov@users.sf.net>

	* tests/test_driver.pl: Enhance error messages

2020-01-04  Paul Smith  <psmith@gnu.org>

	* doc/make.texi: Change the GFDL to an Appendix

	* NEWS: Clarify authorship of new features.

	Enable compilation with C90 compilers
	* configure.ac: Try compiling Guile headers: they don't work with C90.
	* maintMakefile: Simplify config checks via target-specific variables.
	* src/makeint.h: Use ATTRIBUTE rather than defining __attribute__,
	as that causes compile issues with system headers.
	(ENUM_BITFIELD): Don't use enum bitfields in ANSI mode.
	* src/main.c: Use ATTRIBUTE instead of __attribute__.
	* src/job.h: Ditto.
	* src/file.c: Don't define variables inside for loops.
	* src/rule.c: Ditto.
	* src/dep.h (SI): Only use static inline in non-ANSI mode.

2020-01-03  Paul Smith  <psmith@gnu.org>

	* bootstrap: Update to the latest gnulib version

	Release GNU make 4.2.93
	* NEWS: Update the release and date
	* configure.ac: Update the release number

	Update copyright statements for 2020

2020-01-03  Paul Smith  <psmith@gnu.org>

	Support the .EXTRA_PREREQS special variable
	Initial implementation by Christof Warlich <cwarlich@gmx.de>

	* NEWS: Announce the new feature.
	* doc/make.texi (Other Special Variables): Document .EXTRA_PREREQS.
	* src/dep.h (struct dep): New flag to note extra prereq deps.
	* src/filedef.h (expand_extra_prereqs): Declare a function to expand
	the value of .EXTRA_PREREQS.
	* src/file.c (expand_extra_prereqs): Given a struct variable lookup
	of .EXTRA_PREREQS, convert it into a list of deps and for each one
	make sure it has a struct file and has the new flag set.
	(snap_file): A new function invoked by hash_map that will perform
	per-file operations: set up second expansion, intermediate, and also
	.EXTRA_PREREQS.  Manage circular dependencies by ignoring them.
	(snap_deps): Defer per-file operations until the end.  Look up the
	global .EXTRA_PREREQS and pass it along to snap_file for each file.
	* src/implicit.c (struct patdeps): Remember the extra prereqs flag.
	(pattern_search): Transfer extra prereqs flag settings into the
	matched pattern rule.
	* src/rule.h (snap_implicit_rules): Rename count_implicit_rules to
	snap_implicit_rules since we now do more than count.
	* src/rule.c (snap_implicit_rules): As we walk through all the pattern
	rules, add in any global .EXTRA_PREREQS to the dep list.  Ensure we
	take them into account for the max number of prereqs and name length.
	* src/main.c (main): Add extra-prereqs to .FEATURES.
	Call the renamed snap_implicit_rules.
	* tests/scripts/variables/EXTRA_PREREQS: Add tests.

2020-01-03  Paul Smith  <psmith@gnu.org>

	* tests/scripts/features/patternrules: Use Windows-compatible quoting

	* tests/test_driver.pl: Compute full path to Perl interpreter

	* tests/scripts/features/exec: Don't use $ENV in the description

	* src/makeint.h: Add a declaration for memrchr()

2019-12-27  Paul Smith  <psmith@gnu.org>

	* NEWS: Remove info about disabled /proc/loadavg usage.

2019-12-27  Paul Smith  <psmith@gnu.org>

	[SV 57022] Avoid posix_spawn which fails asynchronously
	Avoid using posix_spawn implementations that fail asynchronously when
	the spawned program can't be invoked: this means instead of getting
	an error such as "No such file or directory" we get just "Exit 127".

	Original implementation of the configure.ac macro provided by
	Martin Dorey <martin.dorey@hds.com>

	Original implementation of the regression tests provided by
	Dmitry Goncharov <dgoncharov@users.sf.net>

	* configure.ac: Test whether posix_spawn fails asynchronously.  In a
	cross-compilation environment, assume that it does not.  If we detect
	that it does, fall back to fork/exec.
	* tests/scripts/features/exec: Add regression tests for different
	shebang invocation methods.

2019-12-26  Paul Smith  <psmith@gnu.org>

	[SV 56655] Allow pattern expansion to contain spaces
	* src/dep.h: Add a new flag PARSEFS_ONEWORD
	* src/read.c (parse_file_seq): If PARSEFS_ONEWORD is given, treat the
	entire incoming string as a single pattern.
	* src/implicit.c (pattern_search): Pass PARSEFS_ONEWORD when parsing
	patterns for wildcards.
	* tests/scripts/features/patternrules: Add a new test.

2019-12-18  Ben Wijen  <ben@wijen.net>

	* src/misc.c (spin): On WINDOWS32 use Sleep() instead of sleep()

	* bootstrap.bat: Fix typo in batch file name

2019-12-18  Paul Smith  <psmith@gnu.org>

	* src/config.h.W32.template: [SV 57152] MinGW32 doesn't support d_type

2019-12-18  Jouke Witteveen  <j.witteveen@gmail.com>

	[SV 54161] Fix second expansion of $* for paths
	If the stem matches a path containing a directory not just a
	filename, make sure the second expansion of $* in the
	prerequisites matches $* in the recipe.  This requires using
	$(*F) when replacing % in the first expansion to preserve the
	simple filename.

	* src/implicit.c (pattern_search): If lastslash is set prepend
	the directory onto the stem.  Then use $(*F) when expanding %.
	* tests/scripts/features/se_implicit: Add a test case

2019-12-17  Jouke Witteveen  <j.witteveen@gmail.com>

	* src/implicit.c (pattern_search): Set lastslash correctly
	If filename contained multiple slashes lastslash is wrongly set to 0.
	* configure.ac: Check for the GNU memrchr() extension function.
	* src/misc.c (memrchr): Supply memrchr() if not available.

	* src/implicit.c (pattern-search): Remove unneeded 'dir' variable

2019-12-17  Paul Smith  <psmith@gnu.org>

	* Makefile.am: Build lzip package instead of bzip2
	* README.git: Mention changed requirements.

	* src/job.c (load_too_high): Disable Linux /proc/loadavg for now
	This new feature has a problem: if you provide a load which is
	larger than the number of cores then it will always run every job.
	Before we can enable it we need to at the least learn how to clamp
	this value to the number of cores.  To experiment with it, set
	PROC_FD_INIT to -2 in job.c to re-enable the feature.

	* tests/run_make_tests.pl (set_more_defaults): Fix typo

2019-12-16  Paul Smith  <psmith@gnu.org>

	* tests/run_make_tests.pl (subst_make_string): Force use of /
	On Windows the path to the helper tool will contain '\': this will
	fail if recipes are run with a POSIX shell.  Convert '\' to '/'
	on Windows.  While here, escape any spaces in the path as well.

	Rename jhelp.pl to thelp.pl and make it a generic test helper.
	* tests/thelp.pl: Rename from tests/jhelp.pl.
	(op): Use names instead of options for the operations.
	(op): Add new operations for sleep, mkdir, and rm.
	(op): Enhance wait to time out
	* tests/run_make_tests.pl: Add a new #HELPER# replacement
	(subst_make_string): Use fully-qualified path to thelp.pl
	* tests/scripts/features/parallelism: Update to use thelp.pl
	and the new named operations.  Use thelp.pl sleep instead of
	system-specific sleep commands.
	* tests/scripts/features/output-sync: Update to use thelp.pl
	instead of complex shell scripts.
	* Makefile.am: Distribute tests/thelp.pl instead of tests/jhelp.pl

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

	Port functions/shell test to Solaris 10
	* tests/scripts/functions/shell: Port exit-status calculation
	to Solaris 10 with Perl 5.8.4.

2019-10-08  Paul Smith  <psmith@gnu.org>

	Release GNU make 4.2.92
	* NEWS: Update the release and date
	* configure.ac: Update the release number

2019-10-06  Paul Smith  <psmith@gnu.org>

	* doc/make.text (Reading Makefiles): Rewrite to be more clear.

2019-10-05  Paul Smith  <psmith@gnu.org>

	* Makefile.am (check-regression): Use PERLFLAGS when running Perl
	* maintMakefile: Set PERLFLAGS to enable warnings.
	* tests/run_make_tests.pl: Clean up issues pointed out by perl -w.

	* tests/scripts/functions/wildcard: Skip slash tests for local glob.

	tests: Convert %CONFIG_FLAGS to get_config()
	* tests/config-flags.pm.W32: Create a predefined Windows file.
	* Makefile.am (test_FILES): Add it to the distribution.
	* build_w32.bat: Install tests/config-flags.pm if not existing.
	* tests/run_make_tests.pl (get_config): Create new function.
	* tests/scripts/features/archives: Call get_config() rather than
	using %CONFIG_FLAGS directly.
	* tests/scripts/features/load: Ditto.
	* tests/scripts/features/loadapi: Ditto.
	* tests/scripts/functions/wildcard: Ditto.

	* src/hash.c (jhash_string): Don't read past end of string.
	Original patch from Dmitry Goncharov <dgoncharov@users.sf.net>.

	* tests/run_make_tests.pl (valid_option): Add missing File::Spec

2019-09-23  Paul Smith  <psmith@gnu.org>

	* src/function.c (func_realpath) [AIX]: Remove trailing slashes.

2019-09-22  Paul Smith  <psmith@gnu.org>

	* tests/scripts/features/vpathplus: Fix output for big-endian systems.
	Our hashing algorithm gives different ordering on LE vs BE systems.
	Patch from Dmitry Goncharov <dgoncharov@users.sf.net>.

2019-09-22  Florian Weimer  <fweimer@redhat.com>  (tiny change)

	* configure.ac (HAVE_GETTIMEOFDAY): Avoid undeclared exit function.

2019-09-22  Paul Smith  <psmith@gnu.org>

	* test/test_driver.el (_run_with_timeout): Show error message.

	* job.c (child_error): Modify error message string.
	This reverts commit 6264deece3bb77798240a906ceed79097adbcf48.
	Further investigation discovers that the real issue is that
	GNU Emacs compile mode doesn't have a matching regex for GNU
	make error messages generated when targets fail.  I submitted
	a patch to GNU Emacs adding a matcher for compile mode.

2019-09-21  Paul Smith  <psmith@gnu.org>

	* tests: Convert from File::Spec::Functions to File::Spec.
	Users report the Functions version doesn't work correctly for some
	older versions of Perl.

	* tests/scripts/function/guile: Valgrind doesn't work with Guile.

	* src/job.c (child_execute_job): Allocate space for argv NULL.

2019-09-21  Paul Smith  <psmith@gnu.org>

	[SV 56918] Compute job slots properly on failing command
	Ensure we properly reduce job_slots_used if a command fails because
	it doesn't exist/can't be started.

	* src/job.h (struct child): Add a field jobslot to be set when using
	a job slot.
	* src/job.c (start_waiting_job): Remember if we are using a job slot.
	(reap_children): Reduce number of job slots used by jobslot.

2019-09-21  Paul Smith  <psmith@gnu.org>

	* src/arscan.c (ar_scan): Restrict length for sscanf of ar_mode.

	* tests/scripts/functions/shell: Detect correct SHELLSTATUS code.

	* tests/run_make_test.pl: Fix support for valgrind.
	Change the variable holding the make command to be a list that can
	hold extra commands and options, not just a string.

	* tests/run_make_tests.pl (find_prog): Fix syntax error.

2019-09-16  Paul Smith  <psmith@gnu.org>

	* NEWS: Update date and clarify -l change.

	* tests/run_make_tests.pl: Create $scriptsuffix for Windows/VMS.
	* tests/scripts/features/targetvars: Add a suffix to scripts.
	* tests/scripts/misc/general4: Ditto.

2019-09-16  Paul Smith  <psmith@gnu.org>

	Refresh the test suite framework implementation.
	Go through both run_make_tests.pl and test_driver.pl and slightly
	modernize the Perl and clean up indentation etc.  Fix a number of
	warnings in the test scripts detected by running with -w.

	* tests/test_driver.pl: Move make error string detection out of the
	base test driver.
	(run_all_tests): Ensure that we always look for tests in the cwd.
	* tests/run_make_tests.pl: Use File::Spec for path manipulations.
	Correctly use setlocale() when detecting error strings.
	Get configuration from the config-flags.pm file not config.status.
	* tests/scripts/features/archives: Use new $cwddir variable.
	* tests/scripts/features/reinvoke: Add missing semicolon.
	* tests/scripts/features/vpath2: Avoid non-existent variable.
	* tests/scripts/functions/foreach: Escape variables.
	* tests/scripts/misc/bs-nl: Remove non-existing \v escape sequence.
	* tests/scripts/misc/general4: Use handy create_file().
	* tests/scripts/options/dash-C: Use Cwd/$cwddir.
	* tests/scripts/options/dash-I: Use subst_make_string() and #PWD#.
	* tests/scripts/options/symlinks: Use File::Spec.
	* tests/scripts/targets/DEFAULT: Use create_file and run_make_test.
	* tests/scripts/variables/CURDIR: Use run_make_test.
	* tests/scripts/variables/automatic: Remove extraneous "\".
	* tests/scripts/vms/library: Remove extra "my" and extraneous "\".

2019-09-16  Paul Smith  <psmith@gnu.org>

	* tests/config-flags.pm.in: Add USE_SYSTEM_GLOB.
	* tests/config_flags_pm.com [VMS]: Ditto.

	* README.git: [SV 56895] Provide more info about "maintainer mode".
	* src/read.c (get_next_mword) [HAVE_DOS_PATHS]: Don't fall through to
	parsing variable references if we find a drivespec in a word!

	* tests/test_driver.pl: Remember error for "running" a directory.
	* tests/scripts/features/errors: Check errors "running" a directory.

	* src/job.c (child_execute_job): Use errno from find_in_given_path().
	* tests/test_driver.pl: Determine non-executable error message.
	* tests/scripts/features/errors: Use the local non-executable error.

	* src/job.c (child_execute_job): Use newer gnulib findprog version.

2019-09-10  Eli Zaretskii  <eliz@gnu.org>

	Revert "[SV 56449] (Windows) Use slow path if '%' appears in the command"
	This reverts commit 38e96eadea6e2cd42a0f414959bac327de9f468a.
	Per discussion on Savannah, the modified behavior matches
	the way % is handled in batch files, but not in cmd command
	lines.  And since Make mostly tries to emulate the command
	line, the new behavior is unexpected and backward-incompatible.

2019-09-09  Paul Smith  <psmith@gnu.org>

	Rework the creation of build.sh so it's not a template.
	* build.sh: Rename from build.template.  Get the list of objects
	from the Makefile.  Move configure-replaced variables ...
	* build.cfg.in: to this new .in file.
	* configure.ac: Remove special handling of build.sh.in and add
	build.cfg as a generated file.
	* Makefile.am (EXTRA_DIST): Remove build.sh.in and add build.sh
	and build.cfg.in for build.sh.in.
	* maintMakefile: Remove handling for build.template.  Treat
	build.sh as a source file, not a generated file.
	* .gitignore: Ignore generated build.cfg file.

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

	* gl/modules/make-glob: Move local glob configure.ac to here
	* configure.ac: from here.

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

	[SV 56834] Support local PATH search with posix_spawnp
	When using exec we install the child's environment before invoking
	execlp(), so commands are found on the child's PATH.  posix_spawnp
	searches on the parent's PATH, which we don't want.

	Import gnulib's findprog-in module and use it to search the child's
	PATH, then use posix_spawn() to run it.

	Also, posix_spawn() does not fall back to trying sh on ENOEXEC, as
	execlp() does, so implement that as well.

	* bootstrap.conf: Add the findprog-in gnulib module
	* src/job.c: Include findprog.h if we're using posix_spawn.
	(start_job_command): Remove the handling of child->cmd_name,
	(child_execute_job): and add it here.  Look up the command to be
	run in the child's path and invoke it if found.  If it fails with
	ENOEXEC then retry it as an argument to the default shell.
	* tests/scripts/misc/general4: Test makefile PATH assignments.
	* tests/scripts/features/targetvars: Ditto, for target variables.

2019-09-07  Paul Smith  <psmith@gnu.org>

	* doc/make.texi (Recipe Execution): Correct example to use $(<[DF])

	* configure.ac: Check whether struct dirent has a d_type field
	* src/dir.c (dir_contents_file_exists_p): Use the autoconf macro
	HAVE_STRUCT_DIRENT_D_TYPE rather than relying on the GNU libc-
	specific _DIRENT_HAVE_D_TYPE.
	* lib/glob.c: Set HAVE_D_TYPE if HAVE_STRUCT_DIRENT_D_TYPE.

	* src/config.h.W32.template [W32]: Add support for dirent.d_type
	* src/w32/include/dirent.h: Add DT_* values for dirent.d_type
	(struct dirent): Add d_type
	* src/w32/compat/durent.c (readdir): Set dirent.d_type based on
	Windows file attributes.

	* src/makeint.h: Add typedef for mode_t if !HAVE_UMASK

	* build.template: Rewrite to allow gnulib support.

	* doc/make.texi: Clarify that the jobserver pipe is "blocking"

2019-09-07  Paul Smith  <psmith@gnu.org>

	Align child_execute_job among different ports
	Create a struct childbase which is the basics of struct child needed
	to invoke child_execute_job(), and can be cast back and forth to a
	struct child.  Ensure all implementations of child_execute_job() take
	the same arguments.

	* src/job.h (CHILDBASE): Create a macro to hold the base parts.
	(struct childbase): A structure containing CHILDBASE.
	(struct child): Use CHILDBASE as the initial part of child.
	[VMS]: Remove declaration of VMS version of child_execute_job.
	* src/job.c (start_job_command): Use new child_execute_job() call.
	(child_execute_job) [__EMX__]: Implement new calling signature.
	(child_execute_job): Implement new calling signature.
	* src/main.c (main) [__EMX__]: Use new child_execute_job() call.
	* src/function.c (func_shell_base): Use new child_execute_job() call.
	* src/vmsjobs.c (vmsHandleChildTerm): Accept struct childbase.
	* src/vmsjobs.c (child_execute_job): Implement new calling signature.
	Modify the return value to be pid_t, not a boolean, and return the
	PID rather than setting it in the child.  This is OK because our only
	caller immediately reset PID to -1 anyway if we return 0.

2019-09-07  Paul Smith  <psmith@gnu.org>

	* doc/make.tex (Substitution Refs): Clarify patsubst relationship.

	* src/job.c (start_job_command) [VMS]: Correct VMS comment.

2019-09-07  Paul Smith  <psmith@gnu.org>

	Show useful errors when posix_spawn() doesn't do so
	The posix_spawn() function may not detect that the command to run is
	invalid when it's invoked.  Instead, it will run then exit with
	error code 127.  If that happens do our best to present the user
	with a useful error message.

	* src/job.h (struct child): Add cmd_name to hold the command we ran.
	* src/job.c (start_job_command): On success, remember the cmd_name.
	(reap_children): On exit 127, stat cmd_name and show a useful error.
	(free_child): Free cmd_name.

2019-09-07  Paul Smith  <psmith@gnu.org>

	* README.git: Describe GCC and GNU make requirements
	* maintMakefile: Put custom C flags into a separate variable
	so they can be overridden more easily on the command line.

	* tests/scripts/features/archives: Fix expected long ar name output.

	* tetss/run_make_test.pl: Avoid 'sh -c' for Windows portability.

	Update to GNU make release candidate 4.2.91

	* tests/scripts/functions/wildcard: Skip dangling symlink test.
	The built-in glob implementation does not correctly handle dangling
	symlinks.  This needs to be fixed by switching to the latest glob
	implementation from gnulib but that's a big job: for now avoid the
	test if we know it will fail.

	* maintMakefile: Use check-local when testing build.sh.
	Running 'make check' will rebuild 'make' so we're not testing the
	build.sh-generated make binary.

2019-09-07  Paul Smith  <psmith@gnu.org>

	Don't reset stack size when using posix_spawn()
	There's no way to run setrlimit() from posix_spawn() so we can't reset
	the stack limit in children; thus, don't change it in the parent.

	* src/makeint.h (SET_STACK_SIZE): Don't set this when HAVE_POSIX_SPAWN.
	* src/job.c (child_execute_job): Remove useless comment.

2019-09-07  Paul Smith  <psmith@gnu.org>

	* configure.ac: Remove redundant getloadavg gnulib support

	* src/dir.c (dir_setup_glob): Initialize unused gl_offs.
	* tests/scripts/functions/wildcard: Add trailing slash tests.
	Initial changes by Dmitry Goncharov <dgoncharov@users.sf.net>

2019-09-02  Paul Eggert  <eggert@cs.ucla.edu>

	Pacify Oracle Studio c99
	* src/dep.h (DEP):
	* src/function.c (struct function_table_entry):
	Use unsigned int, not unsigned short.  Without this patch, c99
	complains ‘warning: nonportable bit-field type’.

	Port grouped_targets test to Solaris 10
	* tests/scripts/features/grouped_targets: Use ‘printf ''’
	instead of ‘echo -n’, as POSIX says the latter is not portable.

	Remove useless code in eval
	* src/read.c (eval): Remove useless code.  Without this patch,
	Oracle Studio 12.6 complains ‘"src/read.c", line 1405: warning:
	loop not entered at top’.

	Pacify Oracle Studio 12.6 in init_switches
	* src/main.c (init_switches): Use a cast to convert char const *
	to char *.  Without this patch, the compiler complains
	‘"src/main.c", line 2643: warning: assignment type mismatch:
	pointer to char "=" pointer to const char’.

	Pacify Oracle Studio 12.6
	* src/arscan.c [VMS]: Use ‘#if !defined LBR$_HDRTRUNC’ instead
	of ‘#ifndef LBR$_HDRTRUNC’ to pacify Oracle Studio 12.6, which
	looks inside unused #if branches for preprocessor syntax errors.
	Without this patch it complains ‘"src/arscan.c", line 43: warning:
	tokens ignored at end of directive line’.

2019-09-02  Paul Smith  <psmith@gnu.org>

	* NEWS: Fix incorrect notes.

	* src/read.c (parse_file_seq): [SV 52076] Don't reverse glob() results.

2019-08-28  Eli Zaretskii  <eliz@gnu.org>

	Fix MS-Windows MinGW build
	* src/w32/subproc/sub_proc.c (process_wait_for_multiple_objects):
	Fix format specifier for GetLastError's value.

	* src/job.c (reap_children): Define the 'remote_status_lose' label
	only for Posix platforms, to avoid compiler warning.

	* build_w32.bat (LNKOUT): New variable, using forward slashes.
	Use forward slashes in calls to :Compile, so that linking with GNU
	ld works.

	* src/makeint.h [!HAVE_UMASK]: Prototype for 'umask'.
	(UMASK, MODE_T): Don't define.

	* src/misc.c (get_tmpfile): Don't call UMASK, call umask, to
	avoid compilation warning on !HAVE_UMASK platforms.
	* src/output.c (output_tmpfd): Likewise.

	* src/misc.c (umask) [!HAVE_UMASK]: New no-op function.

	* src/config.h.W32.template (__USE_MINGW_ANSI_STDIO)
	[__MINGW32__]: Define to 1, to force Make use ANSI-compatible
	stdio functions, which also support the non-standard 'Id' and 'Ix'
	specifiers.
	(HAVE_UMASK) [__MINGW32__]: Define to 1.

	* src/arscan.c (ar_member_touch): Type-cast argument of strlen to
	avoid compiler warnings.

2019-08-26  Paul Smith  <psmith@gnu.org>

	* NEWS: Update for pre-release

2019-08-26  Paul Smith  <psmith@gnu.org>

	Update maintainer mode to support debug wait points.
	Make a spin() method available when compiled in maintainer mode.
	If a file exists in the working directory with a specific name,
	make will sleep until the file is deleted.

	Ensure that maintainer mode is enabled on Windows, using the same
	algorithm we use on POSIX / autoconf systems.

	* build_w32.bat: If maintMakefile exists, enable maintainer mode.
	* src/main.c (main): Replace Windows-only suspend flag with spin().
	* src/makeint.h: A SPIN() macro calls spin() in maintainer mode.
	* src/misc.c (spin): If a spin file exists sleep until it's deleted.

2019-08-26  Paul Smith  <psmith@gnu.org>

	* tests/scripts/features/archives: [SV 54395] Support non-GNU ar.

	* tests/scripts/misc/general3: Add more tests for SHELL/.SHELLFLAGS

2019-08-25  Paul Smith  <psmith@gnu.org>

	* src/job.c (construct_command_argv): Remove unused VMS code

	* src/job.c (child_execute_job): Set pid to -1 on posix_spawn failure.

2019-08-24  Paul Smith  <psmith@gnu.org>

	* bootstrap: Update from latest gnulib version

	* scripts/copyright-update: Use git ls-files for controlled files

	* po/LINGUAS: Add a translation for Bulgarian.

2019-07-14  Christian Eggers  <ceggers@arri.de>  (tiny change)

	[SV 56449] (Windows) Use slow path if '%' appears in the command
	* src/job.c (sh_chars_dos): Add '%' as a special character
	* src/job.c (construct_command_argv_internal): Check for '%' in quotes

	For the windows version of make, a recipe line cannot be executed
	diretly by make (without a shell) if a '%' character is present. This
	character starts a cmd.exe escape sequence.

2019-07-14  Paul Smith  <psmith@gnu.org>

	* src/read.c (parse_file_seq): Update comments.

2019-07-13  Mike Haboustak  <haboustak@gmail.com>  (tiny change)

	[SV 28456] Don't override $< when no default rule has been defined
	The check for matching a file's command to the default rule's command
	does not account for null. If no .DEFAULT is defined a rule with no
	recipe has it's $< variable set to the value of $@. This breaks second
	expansion, particularly when used with pattern rules.

	* src/commands.c [set_file_variables]: Check that cmds is set
	* tests/scripts/features/se_explicit: Test case
	* tests/scripts/features/se_implicit: Test case

2019-07-13  Paul Smith  <psmith@gnu.org>

	Switch to the gnulib version of strerror()
	* bootstrap.conf: Add strerror module
	* configure.ac: Remove strerror check
	* src/misc.c: Remove local strerror() implementation
	* src/config.ami.template: Remove HAVE_STRERROR
	* src/config.h-vms.template: Ditto.
	* src/config.h.W32.template: Ditto.

2019-05-19  Paul Smith  <psmith@gnu.org>

	* doc/make.texi: [SV 51974] Clarify makefile parsing operations.

	* doc/make.texi: [SV 54116] Document whitespace removal trick.
	Discovered and explained by Michael Henry <gnu@drmikehenry.com>
	* tests/scripts/variables/flavors: Add a test to preserve the behavior.

2019-05-19  Paul Smith  <psmith@gnu.org>

	[SV 46013] Allow recursive variable overrides from Makefiles
	Ensure that variable overrides are passed to recursive make instances
	even if no overrides were provided on the command line.
	Fix suggested by Rici Lake <ricilake@gmail.com>

	* src/main.c (define_makeflags): Add overrides without respect to the
	value of command_variables.
	* tests/scripts/features/recursion: Add a test.

2019-05-19  Paul Smith  <psmith@gnu.org>

	Update developer customizations
	* .ccls: Remove -std=c99: it disables __attribute__ causing warnings.
	* .dir-locals.el: Force the C coding style to "gnu".
	* make-gdb.py: Add GDB macros for pretty-printing GNU make structs.
	* scripts/copyright-update: Use GNULIB_SRCDIR to find update-copyright.

2019-05-19  Paul Smith  <psmith@gnu.org>

	[SV 54549] Don't free used set_lists during merge
	When merging the variable_set_lists for two targets it could be
	that the "from" set list is a subset of the "to" set list: check
	for this situation to avoid freeing used memory.

	* src/variable.c (merge_variable_set_lists): Walk the "to" list and
	if the "from" list is contained in it, nothing to do.
	* tests/scripts/features/se_explicit: Add a test.

2019-05-19  Paul Smith  <psmith@gnu.org>

	* src/hash.c (jash_string): [SV 54980] Avoid ASAN error

2019-05-19  Paul Smith  <psmith@gnu.org>

	[SV 54740] Ensure .SILENT settings do not leak into sub-makes
	Create a new variable run_silent to hold the current instance's global
	silence setting, allowing silent_flag to represent only whether the -s
	option was provided on the command line.

	* src/makeint.h: Change silent_flag variable to run_silent.
	* src/job.c: Ditto.
	* src/remake.c: Ditto.
	* src/file.c: Ditto.
	* src/main.c: Add a new global variable run_silent.
	(decode_switches): After switches are decoded, initialize run_silent.
	* tests/scripts/targets/SILENT: Add a test for recursive behavior.

2019-05-19  Paul Smith  <psmith@gnu.org>

	Update copyright statements for 2019

2019-05-12  Kaz Kylheku  <kaz@kylheku.com>

	[SV 8297] Implement "grouped targets" for explicit rules.
	This patch allows "grouped targets" using the &: syntax:

	  tgt1 tgt2 ... tgtn &: pre1 pre2 ...
	        recipe

	When the &: separator is used (in single or double colon forms), all
	the targets are understood to be built by a single invocation of the
	recipe.  This is accomplished by piggy-backing on the already-existing
	pattern rule feature, using the file's "also_make" list.

	* NEWS: Add information about grouped targets.
	* doc/make.texi (Multiple Targets): Add information on grouped targets.
	(Pattern Intro): Refer to the new section to discuss multiple patterns.
	* src/main.c (main): Add "grouped-targets" to .FEATURES
	* src/read.c (make_word_type): Add new types for &: and &::.
	(eval): Recognize the &: and &:: separator and remember when used.
	(record_files): Accept an indicator of whether the rule is grouped.
	If so, update also_make for each file to depend on the other files.
	(get_next_mword): Recognize the &: and &:: word types.
	* tests/scripts/features/grouped_targets: New test script.
	* AUTHORS: Add Kaz Kylheku

2019-05-12  Paul Smith  <psmith@gnu.org>

	* variable.c (define_variable_in_set): Clear new structs

	* po/LINGUAS: Add Portuguese translation

	Add developer customizations
	* .ccls: Configure the ccls LSP server
	* .dir-locals.el: Reset some parameters for ccls and lsp-mode
	* .gitignore: Update for GTAGS and ccls
	* maintMakefile: Don't search hidden directories for sources

2018-09-16  Paul Smith  <psmith@gnu.org>

	* src/arscan.c (ar_member_touch): [SV 54533] Stop \0 in archive headers

	Change output_write() to writebuf(), add readbuf() helper.
	* src/misc.c (writebuf, readbuf): Create helper functions that will
	reliably write a buffer to a file descriptor in the face of EINTR
	causing short writes, and read from a file descriptor into a buffer
	in the face of EINTR causing short reads.
	* src/makeint.h: Declare these functions.
	* src/output.c: Remove output_write() and replace with writebuf().
	(_outputs, out_of_memory): Call writebuf(), not output_write().
	* src/arscan.c (ar_scan): Call readbuf() instead of read(2).
	(ar_member_touch): Remove duplicate header write, call writebuf()
	instead of output_write(), and readbuf() instead of read(2).

2018-09-15  Paul Smith  <psmith@gnu.org>

	* doc/make.texi (Remaking Makefiles): [SV 52273] Note MAKE_RESTARTS

	* src/main.c (main): Set jobserver permissions before re-execing
	Fixes an issue seen in the Linux kernel build system, reported by
	Masahiro Yamada <yamada.masahiro@socionext.com>.  Fix suggested
	on the bug-make mailing list by Mike Shal <marfey@gmail.com>.
	* tests/scripts/features/parallelism: Add a test to verify this.

	* doc/make.texi: [SV 48970] Clarify the value of $?

	* doc/make.text: [SV 54360] Weaken "obsolete" language in the manual.
	There's no need to frighten users away from capabilities which are
	perfectly reasonable and definitely not going away, by calling them
	obsolete or discouraged in the manual.

	[SV 40657] Don't create pattern rules for suffix rules with deps.
	* NEWS: Update with a backward-compatibility warning.
	* src/rule.c (convert_to_pattern): If a suffix rule has dependencies,
	do not create a pattern rule for it.  According to the manual suffix
	rules with prerequisites are treated as normal targets.
	* tests/scrips/features/suffixrules: Create some regression tests for
	.SUFFIXES and suffix rules.

2018-08-04  Paul Smith  <psmith@gnu.org>

	* NEWS: Update for the latest changes.

2018-08-04  Paul Smith  <psmith@gnu.org>

	[SV 54233] Preserve higher command_state values on also_make targets.
	If multiple pattern rules have the same pattern as also-make targets
	and we attempt to run them at the same time, we might downgrade the
	command state from 'running' to 'deps_running'; this will prevent
	that also_make from being considered complete causing make to wait
	forever for it to finish.

	Ensure that set_command_state never downgrades the state of a target.

	* src/file.c (set_command_state): Don't downgrade command_state.
	* src/filedef.h (struct file): Document the order prerequisite.
	* test/scripts/features/patternrules: Test the behavior.

2018-08-04  Paul Smith  <psmith@gnu.org>

	* src/job.c (reap_children): Fix inverted win/lose message.

	* tests/scripts/functions/wildcard: [SV 52018] Test dangling symlink.

2018-08-04  Bernhard M. Wiedemann  <bwiedemann@suse.de>

	* src/read.c (parse_file_seq): [SV 52076] Sort wildcard results.

2018-08-04  Paul Smith  <psmith@gnu.org>

	* tests/scripts/features/archives: [SV 54395] Test long archive names.

2018-08-04  Ben Hutchings  <ben@decadent.org.uk>

	* src/arscan.c (ar_scan): [SV 54395] Allow long names in archives.
	Commit bc9d72beb0cb "Resolve issues discovered by static code
	analysis." added range checks on archive member name length.  However,
	on non-AIX systems it also checked BSD-style long names against the
	short name limits and and checked the *offset* for GNU-style long
	names against the short name limits.  This caused valid long names to
	be rejected.

	* Record the size of the GNU name map and validate offsets against it
	* Ensure that the last entry in the name map is null-terminated
	* Apply a maximum length of INT_MAX for element sizes

	Reported-by: Philipp Wolski <philipp.wolski@kisters.de>

2018-08-04  Paul Smith  <psmith@gnu.org>

	* lib/glob.c (glob_in_dir): [SV 53465] Allow symlinks to directories.
	Fix from Rich Felker <bugdal@aerifal.cx> on the musl mailing list.
	* tests/scripts/functions/wildcard: Create a regression test for this.

	* configure.ac: Add --disable-posix-spawn option
	* maintMakefile: Add a test for the option
	* src/job.c: Change HAVE_* preprocessor checks to USE_POSIX_SPAWN

	* src/job.c (child_execute_job): Clean up posix_spawn invocation

2018-08-04  Aron Barath  <baratharon@caesar.elte.hu>

	* job.c (child_execute_job): Prefer posix_spawn() over fork()/exec()

2018-08-04  Paul Smith  <psmith@gnu.org>

	Clean up errors for invalid commands and add regression tests.
	* src/function.c (func_shell_base): Use error() instead of recreating
	the error output.
	* src/job.c (exec_command): Show more standard error messages.
	* src/load.c (unload_file): Fix whitespace in the error message.
	* tests/scripts/features/errors: Add tests for starting non-
	existent commands and new error message formats.
	* tests/scripts/features/output-sync: New error message formats.
	* tests/scripts/functions/shell: Ditto.

2018-08-04  Paul Smith  <psmith@gnu.org>

	Queue failed fork() (etc.) to be handled like any other failed job.
	If we failed to fork() we were essentially exiting make immediately
	without respect to ignore flags, etc.  On one hand that makes sense
	because if you can't fork you're in real trouble, but it doesn't
	work so well on systems where we don't fork at all.  Instead, treat
	a fork error like any other error by delaying the handling until
	the next call to reap_children().  Any child with a PID of -1 is
	considered to have died before starting so check these first without
	waiting for them.

	* src/commands.c (fatal_error_signal): Don't kill children that
	never started.
	* src/function.c (func_shell_base): Handle cleanup properly if the
	child doesn't start.
	* src/job.c (reap_children): Check for children that died before
	starting and handle them without waiting for the PID.
	(start_job_command): Free memory when the child doesn't start.
	(start_waiting_job): Don't manage children who never started.
	(child_execute_job): If the fork fails return PID -1.
	* src/vmsjobs.c: Check for children that never started.
	* tests/run_make_tests.pl: Parse config.status to get all options.

2018-08-02  Aron Barath  <baratharon@caesar.elte.hu>

	* configure.ac: Check for posix_spawnattr_setsigmask

	* configure.ac: Check for spawn.h and posix_spawn()

	* src/makeint.h: Use pid_t to store PIDs, of int.
	* src/commands.c (getpid): Ditto.
	* src/job.h (*): Ditto.
	* src/job.c (*): Ditto.
	* src/main.c (main): Ditto.
	* src/remote-cstms.c (start_remote_job): Ditto.
	* src/remote-stub.c (start_remote_job): Ditto.

2018-08-02  spagoveanu@gmail.com  <spagoveanu@gmail.com>  (tiny change)

	* src/dir.c: Preserve glob d_type field
	When using GNU make on a system with glibc glob a pattern ending in
	a slash is also matching regular files, but only in subdirectories:

	$ mkdir -p dir/subdir
	$ cd dir
	$ touch file1 subdir/file2
	$ echo 'test:; @echo $(wildcard */ */*/)' | make -f -
	subdir/ subdir/file2
	$ echo 'test: */ */*/; @echo "$?" != */ */*/' | make -f -
	subdir/ subdir/file2 != subdir/ */*/

	It happens because in the gl->gl_readdir callback supplied to glob(),
	dirent->d_type is set to DT_UNKNOWN, and the glob() implementation
	in glibc assumes that such a directory entry *cannot* possibly be a
	regular file.

	Pass the actual d_type down to glob(); this is the right thing to do
	even if glibc is fixed, because it saves an extra stat() syscall for
	each dirent.

2018-08-02  Paul Smith  <psmith@gnu.org>

	* src/read.c(unescape_char): Use C comments not C++ comments.
	* src/posixos.c(set_blocking): Ditto.
	* src/w32/subproc/sub_proc.c(process_init): Ditto

	Enhance the Basic.mk environment to work with Gnulib
	* maintMakefile: Omit generated headers from Basic.mk prerequisites.
	* Basic.mk.template: Rework commands to use with $(call ...) macros.
	* mk/Amiga.mk: Ditto.
	* mk/VMS.mk: Ditto.
	* mk/Windows32.mk: Ditto, plus P2W to convert POSIX to Windows paths.
	* mk/msdosdjgpp.mk: Ditto.

2018-07-02  Paul Smith  <psmith@gnu.org>

	Resolve most of the Windows Visual Studio warnings.
	* Convert integer types to size_t where necessary.
	* Align other integral types to avoid casts and type warnings.

2018-07-02  Paul Smith  <psmith@nuodb.com>

	Update regression tests for Windows.
	* tests/scripts/features/jobserver: Windows doesn't use pipes
	* tests/scripts/functions/shell: Don't test kill -2 on Windows
	* tests/scripts/misc/bs-nl: Windows doesn't handle single quotes
	* tests/scripts/misc/general3: Ditto.

	* maintMakefile: Preserve comments during compilation

	* function.c(abspath): Use memcpy() to avoid GCC 8.1 warnings

2018-07-02  Paul Smith  <psmith@nuodb.com>

	Convert GNU make to use the gnulib portability library
	Move content from glob/* and config/* into standard GNU directory
	locations lib/* and m4/*.

	Install the gnulib bootstrap script and its configuration file, and
	create a bootstrap.bat file for Windows.  Update the README.git file
	with new requirements and instructions for building from Git.

	At this point we only install the alloca, getloadavg, and FDL modules
	from gnulib.  We keep our old glob/fnmatch implementation since the
	gnulib versions require significant amounts of infrastructure which
	doesn't exist on Windows yet.  Further work is required here.

	Due to a problem with gnulib's version of getloadavg, we need to bump
	the minimum required version of automake to 1.16.1 unfortunately.

	* README.git: Update instructions
	* NEWS: Move developer news to a separate section
	* configure.ac: Update for use with gnulib modules

	* bootstrap: Bootstrap from Git workspace (import from gnulib)
	* bootstrap.conf: Bootstrap configuration for GNU make
	* bootstrap.bat: Bootstrap from Git workspace for Windows
	* gl/modules/make-glob: Support our local fnmatch/glob implementation

	* config/acinclude.m4: Move to m4/
	* config/dospaths.m4: Move to m4/
	* glob/fnmatch.c: Move to lib/
	* glob/fnmatch.h.in: Move to lib/
	* glob/glob.c: Move to lib/
	* glob/glob.h.in: Move to lib/

	* Makefile.am: Update for new directories
	* build.template: Update for new directories
	* build_w32.bat: Update for new directories
	* builddos.bat: Update for new directories
	* maintMakefile: Update for new directories
[--snip--]
