1 2020-01-19 Paul Smith <psmith@gnu.org>
4 * NEWS: Update for the release
5 * configure.ac: New release number
6 * doc/make.texi: New edition number
8 * configure.ac (guile): Check for Guile 3.0 installations
10 * src/job.c (sh_cmds): [SV 57625] Update builtin shell command list
12 Resolve some documentation issues
13 * doc/make.texi (Interrupts): [SV 46193] Recommend defensive recipes
14 * doc/make.texi: [SV 49262] Clarify interaction of prerequisites and
15 non-terminal match-anything rules.
17 2020-01-19 Paul Smith <psmith@gnu.org>
19 [SV 40657] Reinstate old behavior for suffix rules with prereqs
20 POSIX says that suffix rules cannot have prerequisites, but after
21 making this change we observed a number of makefiles "in the wild"
22 that were relying on this behavior and failed.
24 For .POSIX: makefiles, obey POSIX. Otherwise preserve the old
25 behavior. However, generate a warning so users know this is a
26 problem. In a future version we will change all behavior to be
29 * NEWS: describe the change
30 * src/rule.c (convert_to_pattern): If posix_pedantic don't make a
31 pattern rule if prereqs exist. Otherwise show a warning.
32 * tests/scripts/features/suffixrules: Add tests for the new behavior
33 including .POSIX vs. non-.POSIX.
35 2020-01-05 Dmitry Goncharov <dgoncharov@users.sf.net>
37 * tests/test_driver.pl: Enhance error messages
39 2020-01-04 Paul Smith <psmith@gnu.org>
41 * doc/make.texi: Change the GFDL to an Appendix
43 * NEWS: Clarify authorship of new features.
45 Enable compilation with C90 compilers
46 * configure.ac: Try compiling Guile headers: they don't work with C90.
47 * maintMakefile: Simplify config checks via target-specific variables.
48 * src/makeint.h: Use ATTRIBUTE rather than defining __attribute__,
49 as that causes compile issues with system headers.
50 (ENUM_BITFIELD): Don't use enum bitfields in ANSI mode.
51 * src/main.c: Use ATTRIBUTE instead of __attribute__.
53 * src/file.c: Don't define variables inside for loops.
55 * src/dep.h (SI): Only use static inline in non-ANSI mode.
57 2020-01-03 Paul Smith <psmith@gnu.org>
59 * bootstrap: Update to the latest gnulib version
61 Release GNU make 4.2.93
62 * NEWS: Update the release and date
63 * configure.ac: Update the release number
65 Update copyright statements for 2020
67 2020-01-03 Paul Smith <psmith@gnu.org>
69 Support the .EXTRA_PREREQS special variable
70 Initial implementation by Christof Warlich <cwarlich@gmx.de>
72 * NEWS: Announce the new feature.
73 * doc/make.texi (Other Special Variables): Document .EXTRA_PREREQS.
74 * src/dep.h (struct dep): New flag to note extra prereq deps.
75 * src/filedef.h (expand_extra_prereqs): Declare a function to expand
76 the value of .EXTRA_PREREQS.
77 * src/file.c (expand_extra_prereqs): Given a struct variable lookup
78 of .EXTRA_PREREQS, convert it into a list of deps and for each one
79 make sure it has a struct file and has the new flag set.
80 (snap_file): A new function invoked by hash_map that will perform
81 per-file operations: set up second expansion, intermediate, and also
82 .EXTRA_PREREQS. Manage circular dependencies by ignoring them.
83 (snap_deps): Defer per-file operations until the end. Look up the
84 global .EXTRA_PREREQS and pass it along to snap_file for each file.
85 * src/implicit.c (struct patdeps): Remember the extra prereqs flag.
86 (pattern_search): Transfer extra prereqs flag settings into the
88 * src/rule.h (snap_implicit_rules): Rename count_implicit_rules to
89 snap_implicit_rules since we now do more than count.
90 * src/rule.c (snap_implicit_rules): As we walk through all the pattern
91 rules, add in any global .EXTRA_PREREQS to the dep list. Ensure we
92 take them into account for the max number of prereqs and name length.
93 * src/main.c (main): Add extra-prereqs to .FEATURES.
94 Call the renamed snap_implicit_rules.
95 * tests/scripts/variables/EXTRA_PREREQS: Add tests.
97 2020-01-03 Paul Smith <psmith@gnu.org>
99 * tests/scripts/features/patternrules: Use Windows-compatible quoting
101 * tests/test_driver.pl: Compute full path to Perl interpreter
103 * tests/scripts/features/exec: Don't use $ENV in the description
105 * src/makeint.h: Add a declaration for memrchr()
107 2019-12-27 Paul Smith <psmith@gnu.org>
109 * NEWS: Remove info about disabled /proc/loadavg usage.
111 2019-12-27 Paul Smith <psmith@gnu.org>
113 [SV 57022] Avoid posix_spawn which fails asynchronously
114 Avoid using posix_spawn implementations that fail asynchronously when
115 the spawned program can't be invoked: this means instead of getting
116 an error such as "No such file or directory" we get just "Exit 127".
118 Original implementation of the configure.ac macro provided by
119 Martin Dorey <martin.dorey@hds.com>
121 Original implementation of the regression tests provided by
122 Dmitry Goncharov <dgoncharov@users.sf.net>
124 * configure.ac: Test whether posix_spawn fails asynchronously. In a
125 cross-compilation environment, assume that it does not. If we detect
126 that it does, fall back to fork/exec.
127 * tests/scripts/features/exec: Add regression tests for different
128 shebang invocation methods.
130 2019-12-26 Paul Smith <psmith@gnu.org>
132 [SV 56655] Allow pattern expansion to contain spaces
133 * src/dep.h: Add a new flag PARSEFS_ONEWORD
134 * src/read.c (parse_file_seq): If PARSEFS_ONEWORD is given, treat the
135 entire incoming string as a single pattern.
136 * src/implicit.c (pattern_search): Pass PARSEFS_ONEWORD when parsing
137 patterns for wildcards.
138 * tests/scripts/features/patternrules: Add a new test.
140 2019-12-18 Ben Wijen <ben@wijen.net>
142 * src/misc.c (spin): On WINDOWS32 use Sleep() instead of sleep()
144 * bootstrap.bat: Fix typo in batch file name
146 2019-12-18 Paul Smith <psmith@gnu.org>
148 * src/config.h.W32.template: [SV 57152] MinGW32 doesn't support d_type
150 2019-12-18 Jouke Witteveen <j.witteveen@gmail.com>
152 [SV 54161] Fix second expansion of $* for paths
153 If the stem matches a path containing a directory not just a
154 filename, make sure the second expansion of $* in the
155 prerequisites matches $* in the recipe. This requires using
156 $(*F) when replacing % in the first expansion to preserve the
159 * src/implicit.c (pattern_search): If lastslash is set prepend
160 the directory onto the stem. Then use $(*F) when expanding %.
161 * tests/scripts/features/se_implicit: Add a test case
163 2019-12-17 Jouke Witteveen <j.witteveen@gmail.com>
165 * src/implicit.c (pattern_search): Set lastslash correctly
166 If filename contained multiple slashes lastslash is wrongly set to 0.
167 * configure.ac: Check for the GNU memrchr() extension function.
168 * src/misc.c (memrchr): Supply memrchr() if not available.
170 * src/implicit.c (pattern-search): Remove unneeded 'dir' variable
172 2019-12-17 Paul Smith <psmith@gnu.org>
174 * Makefile.am: Build lzip package instead of bzip2
175 * README.git: Mention changed requirements.
177 * src/job.c (load_too_high): Disable Linux /proc/loadavg for now
178 This new feature has a problem: if you provide a load which is
179 larger than the number of cores then it will always run every job.
180 Before we can enable it we need to at the least learn how to clamp
181 this value to the number of cores. To experiment with it, set
182 PROC_FD_INIT to -2 in job.c to re-enable the feature.
184 * tests/run_make_tests.pl (set_more_defaults): Fix typo
186 2019-12-16 Paul Smith <psmith@gnu.org>
188 * tests/run_make_tests.pl (subst_make_string): Force use of /
189 On Windows the path to the helper tool will contain '\': this will
190 fail if recipes are run with a POSIX shell. Convert '\' to '/'
191 on Windows. While here, escape any spaces in the path as well.
193 Rename jhelp.pl to thelp.pl and make it a generic test helper.
194 * tests/thelp.pl: Rename from tests/jhelp.pl.
195 (op): Use names instead of options for the operations.
196 (op): Add new operations for sleep, mkdir, and rm.
197 (op): Enhance wait to time out
198 * tests/run_make_tests.pl: Add a new #HELPER# replacement
199 (subst_make_string): Use fully-qualified path to thelp.pl
200 * tests/scripts/features/parallelism: Update to use thelp.pl
201 and the new named operations. Use thelp.pl sleep instead of
202 system-specific sleep commands.
203 * tests/scripts/features/output-sync: Update to use thelp.pl
204 instead of complex shell scripts.
205 * Makefile.am: Distribute tests/thelp.pl instead of tests/jhelp.pl
207 2019-10-10 Paul Eggert <eggert@cs.ucla.edu>
209 Port functions/shell test to Solaris 10
210 * tests/scripts/functions/shell: Port exit-status calculation
211 to Solaris 10 with Perl 5.8.4.
213 2019-10-08 Paul Smith <psmith@gnu.org>
215 Release GNU make 4.2.92
216 * NEWS: Update the release and date
217 * configure.ac: Update the release number
219 2019-10-06 Paul Smith <psmith@gnu.org>
221 * doc/make.text (Reading Makefiles): Rewrite to be more clear.
223 2019-10-05 Paul Smith <psmith@gnu.org>
225 * Makefile.am (check-regression): Use PERLFLAGS when running Perl
226 * maintMakefile: Set PERLFLAGS to enable warnings.
227 * tests/run_make_tests.pl: Clean up issues pointed out by perl -w.
229 * tests/scripts/functions/wildcard: Skip slash tests for local glob.
231 tests: Convert %CONFIG_FLAGS to get_config()
232 * tests/config-flags.pm.W32: Create a predefined Windows file.
233 * Makefile.am (test_FILES): Add it to the distribution.
234 * build_w32.bat: Install tests/config-flags.pm if not existing.
235 * tests/run_make_tests.pl (get_config): Create new function.
236 * tests/scripts/features/archives: Call get_config() rather than
237 using %CONFIG_FLAGS directly.
238 * tests/scripts/features/load: Ditto.
239 * tests/scripts/features/loadapi: Ditto.
240 * tests/scripts/functions/wildcard: Ditto.
242 * src/hash.c (jhash_string): Don't read past end of string.
243 Original patch from Dmitry Goncharov <dgoncharov@users.sf.net>.
245 * tests/run_make_tests.pl (valid_option): Add missing File::Spec
247 2019-09-23 Paul Smith <psmith@gnu.org>
249 * src/function.c (func_realpath) [AIX]: Remove trailing slashes.
251 2019-09-22 Paul Smith <psmith@gnu.org>
253 * tests/scripts/features/vpathplus: Fix output for big-endian systems.
254 Our hashing algorithm gives different ordering on LE vs BE systems.
255 Patch from Dmitry Goncharov <dgoncharov@users.sf.net>.
257 2019-09-22 Florian Weimer <fweimer@redhat.com> (tiny change)
259 * configure.ac (HAVE_GETTIMEOFDAY): Avoid undeclared exit function.
261 2019-09-22 Paul Smith <psmith@gnu.org>
263 * test/test_driver.el (_run_with_timeout): Show error message.
265 * job.c (child_error): Modify error message string.
266 This reverts commit 6264deece3bb77798240a906ceed79097adbcf48.
267 Further investigation discovers that the real issue is that
268 GNU Emacs compile mode doesn't have a matching regex for GNU
269 make error messages generated when targets fail. I submitted
270 a patch to GNU Emacs adding a matcher for compile mode.
272 2019-09-21 Paul Smith <psmith@gnu.org>
274 * tests: Convert from File::Spec::Functions to File::Spec.
275 Users report the Functions version doesn't work correctly for some
276 older versions of Perl.
278 * tests/scripts/function/guile: Valgrind doesn't work with Guile.
280 * src/job.c (child_execute_job): Allocate space for argv NULL.
282 2019-09-21 Paul Smith <psmith@gnu.org>
284 [SV 56918] Compute job slots properly on failing command
285 Ensure we properly reduce job_slots_used if a command fails because
286 it doesn't exist/can't be started.
288 * src/job.h (struct child): Add a field jobslot to be set when using
290 * src/job.c (start_waiting_job): Remember if we are using a job slot.
291 (reap_children): Reduce number of job slots used by jobslot.
293 2019-09-21 Paul Smith <psmith@gnu.org>
295 * src/arscan.c (ar_scan): Restrict length for sscanf of ar_mode.
297 * tests/scripts/functions/shell: Detect correct SHELLSTATUS code.
299 * tests/run_make_test.pl: Fix support for valgrind.
300 Change the variable holding the make command to be a list that can
301 hold extra commands and options, not just a string.
303 * tests/run_make_tests.pl (find_prog): Fix syntax error.
305 2019-09-16 Paul Smith <psmith@gnu.org>
307 * NEWS: Update date and clarify -l change.
309 * tests/run_make_tests.pl: Create $scriptsuffix for Windows/VMS.
310 * tests/scripts/features/targetvars: Add a suffix to scripts.
311 * tests/scripts/misc/general4: Ditto.
313 2019-09-16 Paul Smith <psmith@gnu.org>
315 Refresh the test suite framework implementation.
316 Go through both run_make_tests.pl and test_driver.pl and slightly
317 modernize the Perl and clean up indentation etc. Fix a number of
318 warnings in the test scripts detected by running with -w.
320 * tests/test_driver.pl: Move make error string detection out of the
322 (run_all_tests): Ensure that we always look for tests in the cwd.
323 * tests/run_make_tests.pl: Use File::Spec for path manipulations.
324 Correctly use setlocale() when detecting error strings.
325 Get configuration from the config-flags.pm file not config.status.
326 * tests/scripts/features/archives: Use new $cwddir variable.
327 * tests/scripts/features/reinvoke: Add missing semicolon.
328 * tests/scripts/features/vpath2: Avoid non-existent variable.
329 * tests/scripts/functions/foreach: Escape variables.
330 * tests/scripts/misc/bs-nl: Remove non-existing \v escape sequence.
331 * tests/scripts/misc/general4: Use handy create_file().
332 * tests/scripts/options/dash-C: Use Cwd/$cwddir.
333 * tests/scripts/options/dash-I: Use subst_make_string() and #PWD#.
334 * tests/scripts/options/symlinks: Use File::Spec.
335 * tests/scripts/targets/DEFAULT: Use create_file and run_make_test.
336 * tests/scripts/variables/CURDIR: Use run_make_test.
337 * tests/scripts/variables/automatic: Remove extraneous "\".
338 * tests/scripts/vms/library: Remove extra "my" and extraneous "\".
340 2019-09-16 Paul Smith <psmith@gnu.org>
342 * tests/config-flags.pm.in: Add USE_SYSTEM_GLOB.
343 * tests/config_flags_pm.com [VMS]: Ditto.
345 * README.git: [SV 56895] Provide more info about "maintainer mode".
346 * src/read.c (get_next_mword) [HAVE_DOS_PATHS]: Don't fall through to
347 parsing variable references if we find a drivespec in a word!
349 * tests/test_driver.pl: Remember error for "running" a directory.
350 * tests/scripts/features/errors: Check errors "running" a directory.
352 * src/job.c (child_execute_job): Use errno from find_in_given_path().
353 * tests/test_driver.pl: Determine non-executable error message.
354 * tests/scripts/features/errors: Use the local non-executable error.
356 * src/job.c (child_execute_job): Use newer gnulib findprog version.
358 2019-09-10 Eli Zaretskii <eliz@gnu.org>
360 Revert "[SV 56449] (Windows) Use slow path if '%' appears in the command"
361 This reverts commit 38e96eadea6e2cd42a0f414959bac327de9f468a.
362 Per discussion on Savannah, the modified behavior matches
363 the way % is handled in batch files, but not in cmd command
364 lines. And since Make mostly tries to emulate the command
365 line, the new behavior is unexpected and backward-incompatible.
367 2019-09-09 Paul Smith <psmith@gnu.org>
369 Rework the creation of build.sh so it's not a template.
370 * build.sh: Rename from build.template. Get the list of objects
371 from the Makefile. Move configure-replaced variables ...
372 * build.cfg.in: to this new .in file.
373 * configure.ac: Remove special handling of build.sh.in and add
374 build.cfg as a generated file.
375 * Makefile.am (EXTRA_DIST): Remove build.sh.in and add build.sh
376 and build.cfg.in for build.sh.in.
377 * maintMakefile: Remove handling for build.template. Treat
378 build.sh as a source file, not a generated file.
379 * .gitignore: Ignore generated build.cfg file.
381 2019-09-08 Paul Smith <psmith@gnu.org>
383 * gl/modules/make-glob: Move local glob configure.ac to here
384 * configure.ac: from here.
386 2019-09-08 Paul Smith <psmith@gnu.org>
388 [SV 56834] Support local PATH search with posix_spawnp
389 When using exec we install the child's environment before invoking
390 execlp(), so commands are found on the child's PATH. posix_spawnp
391 searches on the parent's PATH, which we don't want.
393 Import gnulib's findprog-in module and use it to search the child's
394 PATH, then use posix_spawn() to run it.
396 Also, posix_spawn() does not fall back to trying sh on ENOEXEC, as
397 execlp() does, so implement that as well.
399 * bootstrap.conf: Add the findprog-in gnulib module
400 * src/job.c: Include findprog.h if we're using posix_spawn.
401 (start_job_command): Remove the handling of child->cmd_name,
402 (child_execute_job): and add it here. Look up the command to be
403 run in the child's path and invoke it if found. If it fails with
404 ENOEXEC then retry it as an argument to the default shell.
405 * tests/scripts/misc/general4: Test makefile PATH assignments.
406 * tests/scripts/features/targetvars: Ditto, for target variables.
408 2019-09-07 Paul Smith <psmith@gnu.org>
410 * doc/make.texi (Recipe Execution): Correct example to use $(<[DF])
412 * configure.ac: Check whether struct dirent has a d_type field
413 * src/dir.c (dir_contents_file_exists_p): Use the autoconf macro
414 HAVE_STRUCT_DIRENT_D_TYPE rather than relying on the GNU libc-
415 specific _DIRENT_HAVE_D_TYPE.
416 * lib/glob.c: Set HAVE_D_TYPE if HAVE_STRUCT_DIRENT_D_TYPE.
418 * src/config.h.W32.template [W32]: Add support for dirent.d_type
419 * src/w32/include/dirent.h: Add DT_* values for dirent.d_type
420 (struct dirent): Add d_type
421 * src/w32/compat/durent.c (readdir): Set dirent.d_type based on
422 Windows file attributes.
424 * src/makeint.h: Add typedef for mode_t if !HAVE_UMASK
426 * build.template: Rewrite to allow gnulib support.
428 * doc/make.texi: Clarify that the jobserver pipe is "blocking"
430 2019-09-07 Paul Smith <psmith@gnu.org>
432 Align child_execute_job among different ports
433 Create a struct childbase which is the basics of struct child needed
434 to invoke child_execute_job(), and can be cast back and forth to a
435 struct child. Ensure all implementations of child_execute_job() take
438 * src/job.h (CHILDBASE): Create a macro to hold the base parts.
439 (struct childbase): A structure containing CHILDBASE.
440 (struct child): Use CHILDBASE as the initial part of child.
441 [VMS]: Remove declaration of VMS version of child_execute_job.
442 * src/job.c (start_job_command): Use new child_execute_job() call.
443 (child_execute_job) [__EMX__]: Implement new calling signature.
444 (child_execute_job): Implement new calling signature.
445 * src/main.c (main) [__EMX__]: Use new child_execute_job() call.
446 * src/function.c (func_shell_base): Use new child_execute_job() call.
447 * src/vmsjobs.c (vmsHandleChildTerm): Accept struct childbase.
448 * src/vmsjobs.c (child_execute_job): Implement new calling signature.
449 Modify the return value to be pid_t, not a boolean, and return the
450 PID rather than setting it in the child. This is OK because our only
451 caller immediately reset PID to -1 anyway if we return 0.
453 2019-09-07 Paul Smith <psmith@gnu.org>
455 * doc/make.tex (Substitution Refs): Clarify patsubst relationship.
457 * src/job.c (start_job_command) [VMS]: Correct VMS comment.
459 2019-09-07 Paul Smith <psmith@gnu.org>
461 Show useful errors when posix_spawn() doesn't do so
462 The posix_spawn() function may not detect that the command to run is
463 invalid when it's invoked. Instead, it will run then exit with
464 error code 127. If that happens do our best to present the user
465 with a useful error message.
467 * src/job.h (struct child): Add cmd_name to hold the command we ran.
468 * src/job.c (start_job_command): On success, remember the cmd_name.
469 (reap_children): On exit 127, stat cmd_name and show a useful error.
470 (free_child): Free cmd_name.
472 2019-09-07 Paul Smith <psmith@gnu.org>
474 * README.git: Describe GCC and GNU make requirements
475 * maintMakefile: Put custom C flags into a separate variable
476 so they can be overridden more easily on the command line.
478 * tests/scripts/features/archives: Fix expected long ar name output.
480 * tetss/run_make_test.pl: Avoid 'sh -c' for Windows portability.
482 Update to GNU make release candidate 4.2.91
484 * tests/scripts/functions/wildcard: Skip dangling symlink test.
485 The built-in glob implementation does not correctly handle dangling
486 symlinks. This needs to be fixed by switching to the latest glob
487 implementation from gnulib but that's a big job: for now avoid the
488 test if we know it will fail.
490 * maintMakefile: Use check-local when testing build.sh.
491 Running 'make check' will rebuild 'make' so we're not testing the
492 build.sh-generated make binary.
494 2019-09-07 Paul Smith <psmith@gnu.org>
496 Don't reset stack size when using posix_spawn()
497 There's no way to run setrlimit() from posix_spawn() so we can't reset
498 the stack limit in children; thus, don't change it in the parent.
500 * src/makeint.h (SET_STACK_SIZE): Don't set this when HAVE_POSIX_SPAWN.
501 * src/job.c (child_execute_job): Remove useless comment.
503 2019-09-07 Paul Smith <psmith@gnu.org>
505 * configure.ac: Remove redundant getloadavg gnulib support
507 * src/dir.c (dir_setup_glob): Initialize unused gl_offs.
508 * tests/scripts/functions/wildcard: Add trailing slash tests.
509 Initial changes by Dmitry Goncharov <dgoncharov@users.sf.net>
511 2019-09-02 Paul Eggert <eggert@cs.ucla.edu>
513 Pacify Oracle Studio c99
515 * src/function.c (struct function_table_entry):
516 Use unsigned int, not unsigned short. Without this patch, c99
517 complains ‘warning: nonportable bit-field type’.
519 Port grouped_targets test to Solaris 10
520 * tests/scripts/features/grouped_targets: Use ‘printf ''’
521 instead of ‘echo -n’, as POSIX says the latter is not portable.
523 Remove useless code in eval
524 * src/read.c (eval): Remove useless code. Without this patch,
525 Oracle Studio 12.6 complains ‘"src/read.c", line 1405: warning:
526 loop not entered at top’.
528 Pacify Oracle Studio 12.6 in init_switches
529 * src/main.c (init_switches): Use a cast to convert char const *
530 to char *. Without this patch, the compiler complains
531 ‘"src/main.c", line 2643: warning: assignment type mismatch:
532 pointer to char "=" pointer to const char’.
534 Pacify Oracle Studio 12.6
535 * src/arscan.c [VMS]: Use ‘#if !defined LBR$_HDRTRUNC’ instead
536 of ‘#ifndef LBR$_HDRTRUNC’ to pacify Oracle Studio 12.6, which
537 looks inside unused #if branches for preprocessor syntax errors.
538 Without this patch it complains ‘"src/arscan.c", line 43: warning:
539 tokens ignored at end of directive line’.
541 2019-09-02 Paul Smith <psmith@gnu.org>
543 * NEWS: Fix incorrect notes.
545 * src/read.c (parse_file_seq): [SV 52076] Don't reverse glob() results.
547 2019-08-28 Eli Zaretskii <eliz@gnu.org>
549 Fix MS-Windows MinGW build
550 * src/w32/subproc/sub_proc.c (process_wait_for_multiple_objects):
551 Fix format specifier for GetLastError's value.
553 * src/job.c (reap_children): Define the 'remote_status_lose' label
554 only for Posix platforms, to avoid compiler warning.
556 * build_w32.bat (LNKOUT): New variable, using forward slashes.
557 Use forward slashes in calls to :Compile, so that linking with GNU
560 * src/makeint.h [!HAVE_UMASK]: Prototype for 'umask'.
561 (UMASK, MODE_T): Don't define.
563 * src/misc.c (get_tmpfile): Don't call UMASK, call umask, to
564 avoid compilation warning on !HAVE_UMASK platforms.
565 * src/output.c (output_tmpfd): Likewise.
567 * src/misc.c (umask) [!HAVE_UMASK]: New no-op function.
569 * src/config.h.W32.template (__USE_MINGW_ANSI_STDIO)
570 [__MINGW32__]: Define to 1, to force Make use ANSI-compatible
571 stdio functions, which also support the non-standard 'Id' and 'Ix'
573 (HAVE_UMASK) [__MINGW32__]: Define to 1.
575 * src/arscan.c (ar_member_touch): Type-cast argument of strlen to
576 avoid compiler warnings.
578 2019-08-26 Paul Smith <psmith@gnu.org>
580 * NEWS: Update for pre-release
582 2019-08-26 Paul Smith <psmith@gnu.org>
584 Update maintainer mode to support debug wait points.
585 Make a spin() method available when compiled in maintainer mode.
586 If a file exists in the working directory with a specific name,
587 make will sleep until the file is deleted.
589 Ensure that maintainer mode is enabled on Windows, using the same
590 algorithm we use on POSIX / autoconf systems.
592 * build_w32.bat: If maintMakefile exists, enable maintainer mode.
593 * src/main.c (main): Replace Windows-only suspend flag with spin().
594 * src/makeint.h: A SPIN() macro calls spin() in maintainer mode.
595 * src/misc.c (spin): If a spin file exists sleep until it's deleted.
597 2019-08-26 Paul Smith <psmith@gnu.org>
599 * tests/scripts/features/archives: [SV 54395] Support non-GNU ar.
601 * tests/scripts/misc/general3: Add more tests for SHELL/.SHELLFLAGS
603 2019-08-25 Paul Smith <psmith@gnu.org>
605 * src/job.c (construct_command_argv): Remove unused VMS code
607 * src/job.c (child_execute_job): Set pid to -1 on posix_spawn failure.
609 2019-08-24 Paul Smith <psmith@gnu.org>
611 * bootstrap: Update from latest gnulib version
613 * scripts/copyright-update: Use git ls-files for controlled files
615 * po/LINGUAS: Add a translation for Bulgarian.
617 2019-07-14 Christian Eggers <ceggers@arri.de> (tiny change)
619 [SV 56449] (Windows) Use slow path if '%' appears in the command
620 * src/job.c (sh_chars_dos): Add '%' as a special character
621 * src/job.c (construct_command_argv_internal): Check for '%' in quotes
623 For the windows version of make, a recipe line cannot be executed
624 diretly by make (without a shell) if a '%' character is present. This
625 character starts a cmd.exe escape sequence.
627 2019-07-14 Paul Smith <psmith@gnu.org>
629 * src/read.c (parse_file_seq): Update comments.
631 2019-07-13 Mike Haboustak <haboustak@gmail.com> (tiny change)
633 [SV 28456] Don't override $< when no default rule has been defined
634 The check for matching a file's command to the default rule's command
635 does not account for null. If no .DEFAULT is defined a rule with no
636 recipe has it's $< variable set to the value of $@. This breaks second
637 expansion, particularly when used with pattern rules.
639 * src/commands.c [set_file_variables]: Check that cmds is set
640 * tests/scripts/features/se_explicit: Test case
641 * tests/scripts/features/se_implicit: Test case
643 2019-07-13 Paul Smith <psmith@gnu.org>
645 Switch to the gnulib version of strerror()
646 * bootstrap.conf: Add strerror module
647 * configure.ac: Remove strerror check
648 * src/misc.c: Remove local strerror() implementation
649 * src/config.ami.template: Remove HAVE_STRERROR
650 * src/config.h-vms.template: Ditto.
651 * src/config.h.W32.template: Ditto.
653 2019-05-19 Paul Smith <psmith@gnu.org>
655 * doc/make.texi: [SV 51974] Clarify makefile parsing operations.
657 * doc/make.texi: [SV 54116] Document whitespace removal trick.
658 Discovered and explained by Michael Henry <gnu@drmikehenry.com>
659 * tests/scripts/variables/flavors: Add a test to preserve the behavior.
661 2019-05-19 Paul Smith <psmith@gnu.org>
663 [SV 46013] Allow recursive variable overrides from Makefiles
664 Ensure that variable overrides are passed to recursive make instances
665 even if no overrides were provided on the command line.
666 Fix suggested by Rici Lake <ricilake@gmail.com>
668 * src/main.c (define_makeflags): Add overrides without respect to the
669 value of command_variables.
670 * tests/scripts/features/recursion: Add a test.
672 2019-05-19 Paul Smith <psmith@gnu.org>
674 Update developer customizations
675 * .ccls: Remove -std=c99: it disables __attribute__ causing warnings.
676 * .dir-locals.el: Force the C coding style to "gnu".
677 * make-gdb.py: Add GDB macros for pretty-printing GNU make structs.
678 * scripts/copyright-update: Use GNULIB_SRCDIR to find update-copyright.
680 2019-05-19 Paul Smith <psmith@gnu.org>
682 [SV 54549] Don't free used set_lists during merge
683 When merging the variable_set_lists for two targets it could be
684 that the "from" set list is a subset of the "to" set list: check
685 for this situation to avoid freeing used memory.
687 * src/variable.c (merge_variable_set_lists): Walk the "to" list and
688 if the "from" list is contained in it, nothing to do.
689 * tests/scripts/features/se_explicit: Add a test.
691 2019-05-19 Paul Smith <psmith@gnu.org>
693 * src/hash.c (jash_string): [SV 54980] Avoid ASAN error
695 2019-05-19 Paul Smith <psmith@gnu.org>
697 [SV 54740] Ensure .SILENT settings do not leak into sub-makes
698 Create a new variable run_silent to hold the current instance's global
699 silence setting, allowing silent_flag to represent only whether the -s
700 option was provided on the command line.
702 * src/makeint.h: Change silent_flag variable to run_silent.
704 * src/remake.c: Ditto.
706 * src/main.c: Add a new global variable run_silent.
707 (decode_switches): After switches are decoded, initialize run_silent.
708 * tests/scripts/targets/SILENT: Add a test for recursive behavior.
710 2019-05-19 Paul Smith <psmith@gnu.org>
712 Update copyright statements for 2019
714 2019-05-12 Kaz Kylheku <kaz@kylheku.com>
716 [SV 8297] Implement "grouped targets" for explicit rules.
717 This patch allows "grouped targets" using the &: syntax:
719 tgt1 tgt2 ... tgtn &: pre1 pre2 ...
722 When the &: separator is used (in single or double colon forms), all
723 the targets are understood to be built by a single invocation of the
724 recipe. This is accomplished by piggy-backing on the already-existing
725 pattern rule feature, using the file's "also_make" list.
727 * NEWS: Add information about grouped targets.
728 * doc/make.texi (Multiple Targets): Add information on grouped targets.
729 (Pattern Intro): Refer to the new section to discuss multiple patterns.
730 * src/main.c (main): Add "grouped-targets" to .FEATURES
731 * src/read.c (make_word_type): Add new types for &: and &::.
732 (eval): Recognize the &: and &:: separator and remember when used.
733 (record_files): Accept an indicator of whether the rule is grouped.
734 If so, update also_make for each file to depend on the other files.
735 (get_next_mword): Recognize the &: and &:: word types.
736 * tests/scripts/features/grouped_targets: New test script.
737 * AUTHORS: Add Kaz Kylheku
739 2019-05-12 Paul Smith <psmith@gnu.org>
741 * variable.c (define_variable_in_set): Clear new structs
743 * po/LINGUAS: Add Portuguese translation
745 Add developer customizations
746 * .ccls: Configure the ccls LSP server
747 * .dir-locals.el: Reset some parameters for ccls and lsp-mode
748 * .gitignore: Update for GTAGS and ccls
749 * maintMakefile: Don't search hidden directories for sources
751 2018-09-16 Paul Smith <psmith@gnu.org>
753 * src/arscan.c (ar_member_touch): [SV 54533] Stop \0 in archive headers
755 Change output_write() to writebuf(), add readbuf() helper.
756 * src/misc.c (writebuf, readbuf): Create helper functions that will
757 reliably write a buffer to a file descriptor in the face of EINTR
758 causing short writes, and read from a file descriptor into a buffer
759 in the face of EINTR causing short reads.
760 * src/makeint.h: Declare these functions.
761 * src/output.c: Remove output_write() and replace with writebuf().
762 (_outputs, out_of_memory): Call writebuf(), not output_write().
763 * src/arscan.c (ar_scan): Call readbuf() instead of read(2).
764 (ar_member_touch): Remove duplicate header write, call writebuf()
765 instead of output_write(), and readbuf() instead of read(2).
767 2018-09-15 Paul Smith <psmith@gnu.org>
769 * doc/make.texi (Remaking Makefiles): [SV 52273] Note MAKE_RESTARTS
771 * src/main.c (main): Set jobserver permissions before re-execing
772 Fixes an issue seen in the Linux kernel build system, reported by
773 Masahiro Yamada <yamada.masahiro@socionext.com>. Fix suggested
774 on the bug-make mailing list by Mike Shal <marfey@gmail.com>.
775 * tests/scripts/features/parallelism: Add a test to verify this.
777 * doc/make.texi: [SV 48970] Clarify the value of $?
779 * doc/make.text: [SV 54360] Weaken "obsolete" language in the manual.
780 There's no need to frighten users away from capabilities which are
781 perfectly reasonable and definitely not going away, by calling them
782 obsolete or discouraged in the manual.
784 [SV 40657] Don't create pattern rules for suffix rules with deps.
785 * NEWS: Update with a backward-compatibility warning.
786 * src/rule.c (convert_to_pattern): If a suffix rule has dependencies,
787 do not create a pattern rule for it. According to the manual suffix
788 rules with prerequisites are treated as normal targets.
789 * tests/scrips/features/suffixrules: Create some regression tests for
790 .SUFFIXES and suffix rules.
792 2018-08-04 Paul Smith <psmith@gnu.org>
794 * NEWS: Update for the latest changes.
796 2018-08-04 Paul Smith <psmith@gnu.org>
798 [SV 54233] Preserve higher command_state values on also_make targets.
799 If multiple pattern rules have the same pattern as also-make targets
800 and we attempt to run them at the same time, we might downgrade the
801 command state from 'running' to 'deps_running'; this will prevent
802 that also_make from being considered complete causing make to wait
803 forever for it to finish.
805 Ensure that set_command_state never downgrades the state of a target.
807 * src/file.c (set_command_state): Don't downgrade command_state.
808 * src/filedef.h (struct file): Document the order prerequisite.
809 * test/scripts/features/patternrules: Test the behavior.
811 2018-08-04 Paul Smith <psmith@gnu.org>
813 * src/job.c (reap_children): Fix inverted win/lose message.
815 * tests/scripts/functions/wildcard: [SV 52018] Test dangling symlink.
817 2018-08-04 Bernhard M. Wiedemann <bwiedemann@suse.de>
819 * src/read.c (parse_file_seq): [SV 52076] Sort wildcard results.
821 2018-08-04 Paul Smith <psmith@gnu.org>
823 * tests/scripts/features/archives: [SV 54395] Test long archive names.
825 2018-08-04 Ben Hutchings <ben@decadent.org.uk>
827 * src/arscan.c (ar_scan): [SV 54395] Allow long names in archives.
828 Commit bc9d72beb0cb "Resolve issues discovered by static code
829 analysis." added range checks on archive member name length. However,
830 on non-AIX systems it also checked BSD-style long names against the
831 short name limits and and checked the *offset* for GNU-style long
832 names against the short name limits. This caused valid long names to
835 * Record the size of the GNU name map and validate offsets against it
836 * Ensure that the last entry in the name map is null-terminated
837 * Apply a maximum length of INT_MAX for element sizes
839 Reported-by: Philipp Wolski <philipp.wolski@kisters.de>
841 2018-08-04 Paul Smith <psmith@gnu.org>
843 * lib/glob.c (glob_in_dir): [SV 53465] Allow symlinks to directories.
844 Fix from Rich Felker <bugdal@aerifal.cx> on the musl mailing list.
845 * tests/scripts/functions/wildcard: Create a regression test for this.
847 * configure.ac: Add --disable-posix-spawn option
848 * maintMakefile: Add a test for the option
849 * src/job.c: Change HAVE_* preprocessor checks to USE_POSIX_SPAWN
851 * src/job.c (child_execute_job): Clean up posix_spawn invocation
853 2018-08-04 Aron Barath <baratharon@caesar.elte.hu>
855 * job.c (child_execute_job): Prefer posix_spawn() over fork()/exec()
857 2018-08-04 Paul Smith <psmith@gnu.org>
859 Clean up errors for invalid commands and add regression tests.
860 * src/function.c (func_shell_base): Use error() instead of recreating
862 * src/job.c (exec_command): Show more standard error messages.
863 * src/load.c (unload_file): Fix whitespace in the error message.
864 * tests/scripts/features/errors: Add tests for starting non-
865 existent commands and new error message formats.
866 * tests/scripts/features/output-sync: New error message formats.
867 * tests/scripts/functions/shell: Ditto.
869 2018-08-04 Paul Smith <psmith@gnu.org>
871 Queue failed fork() (etc.) to be handled like any other failed job.
872 If we failed to fork() we were essentially exiting make immediately
873 without respect to ignore flags, etc. On one hand that makes sense
874 because if you can't fork you're in real trouble, but it doesn't
875 work so well on systems where we don't fork at all. Instead, treat
876 a fork error like any other error by delaying the handling until
877 the next call to reap_children(). Any child with a PID of -1 is
878 considered to have died before starting so check these first without
881 * src/commands.c (fatal_error_signal): Don't kill children that
883 * src/function.c (func_shell_base): Handle cleanup properly if the
885 * src/job.c (reap_children): Check for children that died before
886 starting and handle them without waiting for the PID.
887 (start_job_command): Free memory when the child doesn't start.
888 (start_waiting_job): Don't manage children who never started.
889 (child_execute_job): If the fork fails return PID -1.
890 * src/vmsjobs.c: Check for children that never started.
891 * tests/run_make_tests.pl: Parse config.status to get all options.
893 2018-08-02 Aron Barath <baratharon@caesar.elte.hu>
895 * configure.ac: Check for posix_spawnattr_setsigmask
897 * configure.ac: Check for spawn.h and posix_spawn()
899 * src/makeint.h: Use pid_t to store PIDs, of int.
900 * src/commands.c (getpid): Ditto.
901 * src/job.h (*): Ditto.
902 * src/job.c (*): Ditto.
903 * src/main.c (main): Ditto.
904 * src/remote-cstms.c (start_remote_job): Ditto.
905 * src/remote-stub.c (start_remote_job): Ditto.
907 2018-08-02 spagoveanu@gmail.com <spagoveanu@gmail.com> (tiny change)
909 * src/dir.c: Preserve glob d_type field
910 When using GNU make on a system with glibc glob a pattern ending in
911 a slash is also matching regular files, but only in subdirectories:
913 $ mkdir -p dir/subdir
915 $ touch file1 subdir/file2
916 $ echo 'test:; @echo $(wildcard */ */*/)' | make -f -
918 $ echo 'test: */ */*/; @echo "$?" != */ */*/' | make -f -
919 subdir/ subdir/file2 != subdir/ */*/
921 It happens because in the gl->gl_readdir callback supplied to glob(),
922 dirent->d_type is set to DT_UNKNOWN, and the glob() implementation
923 in glibc assumes that such a directory entry *cannot* possibly be a
926 Pass the actual d_type down to glob(); this is the right thing to do
927 even if glibc is fixed, because it saves an extra stat() syscall for
930 2018-08-02 Paul Smith <psmith@gnu.org>
932 * src/read.c(unescape_char): Use C comments not C++ comments.
933 * src/posixos.c(set_blocking): Ditto.
934 * src/w32/subproc/sub_proc.c(process_init): Ditto
936 Enhance the Basic.mk environment to work with Gnulib
937 * maintMakefile: Omit generated headers from Basic.mk prerequisites.
938 * Basic.mk.template: Rework commands to use with $(call ...) macros.
939 * mk/Amiga.mk: Ditto.
941 * mk/Windows32.mk: Ditto, plus P2W to convert POSIX to Windows paths.
942 * mk/msdosdjgpp.mk: Ditto.
944 2018-07-02 Paul Smith <psmith@gnu.org>
946 Resolve most of the Windows Visual Studio warnings.
947 * Convert integer types to size_t where necessary.
948 * Align other integral types to avoid casts and type warnings.
950 2018-07-02 Paul Smith <psmith@nuodb.com>
952 Update regression tests for Windows.
953 * tests/scripts/features/jobserver: Windows doesn't use pipes
954 * tests/scripts/functions/shell: Don't test kill -2 on Windows
955 * tests/scripts/misc/bs-nl: Windows doesn't handle single quotes
956 * tests/scripts/misc/general3: Ditto.
958 * maintMakefile: Preserve comments during compilation
960 * function.c(abspath): Use memcpy() to avoid GCC 8.1 warnings
962 2018-07-02 Paul Smith <psmith@nuodb.com>
964 Convert GNU make to use the gnulib portability library
965 Move content from glob/* and config/* into standard GNU directory
966 locations lib/* and m4/*.
968 Install the gnulib bootstrap script and its configuration file, and
969 create a bootstrap.bat file for Windows. Update the README.git file
970 with new requirements and instructions for building from Git.
972 At this point we only install the alloca, getloadavg, and FDL modules
973 from gnulib. We keep our old glob/fnmatch implementation since the
974 gnulib versions require significant amounts of infrastructure which
975 doesn't exist on Windows yet. Further work is required here.
977 Due to a problem with gnulib's version of getloadavg, we need to bump
978 the minimum required version of automake to 1.16.1 unfortunately.
980 * README.git: Update instructions
981 * NEWS: Move developer news to a separate section
982 * configure.ac: Update for use with gnulib modules
984 * bootstrap: Bootstrap from Git workspace (import from gnulib)
985 * bootstrap.conf: Bootstrap configuration for GNU make
986 * bootstrap.bat: Bootstrap from Git workspace for Windows
987 * gl/modules/make-glob: Support our local fnmatch/glob implementation
989 * config/acinclude.m4: Move to m4/
990 * config/dospaths.m4: Move to m4/
991 * glob/fnmatch.c: Move to lib/
992 * glob/fnmatch.h.in: Move to lib/
993 * glob/glob.c: Move to lib/
994 * glob/glob.h.in: Move to lib/
996 * Makefile.am: Update for new directories
997 * build.template: Update for new directories
998 * build_w32.bat: Update for new directories
999 * builddos.bat: Update for new directories
1000 * maintMakefile: Update for new directories
1001 * makefile.com: Update for new directories
1002 * mk/Amiga.mk: Update for new directories
1003 * mk/Posix.mk.in: Update for new directories
1004 * mk/VMS.mk: Update for new directories
1005 * mk/Windows32.mk: Update for new directories
1006 * mk/msdosdjgpp.mk: Update for new directories
1008 * po/LINGUAS: One language per line (needed by gnulib)
1010 * INSTALL: Remove (obtained from gnulib)
1011 * src/alloca.c: Remove (obtained from gnulib)
1012 * src/getloadavg.c: Remove (obtained from gnulib)
1013 * po/Makevars: Remove (created by bootstrap)
1014 * config/*: Remove leftover files
1015 * glob/*: Remove leftover files
1017 2018-07-01 Paul Smith <psmith@nuodb.com>
1019 * Makefile.ami, glob/Makefile.ami: Remove obsolete files
1021 2018-07-01 Ola Olsson <ola1olsson@gmail.com>
1023 * doc/make.texi: Updated language
1025 2018-07-01 Paul Smith <psmith@gnu.org>
1027 * all: Update Copyright statements for 2018
1029 * scripts/copyright-update: Maintainer's script for copyright mgmt
1031 2018-02-10 Paul Smith <psmith@gnu.org>
1033 * build_w32.bat: Support Visual Studio 17.
1035 2017-11-19 Paul Smith <psmith@gnu.org>
1037 * configure.ac: Support GLIBC glob interface version 2
1039 2017-11-19 Paul Smith <psmith@gnu.org>
1041 Rework directory structure to use GNU-recommended "src" directory.
1042 Move the source code (other than glob) into the "src" subdirectory.
1043 Update all scripting and recommendations to support this change.
1045 * *.c, *.h, w32/*: Move to src/
1046 * configure.ac, Makefile.am, maintMakefile: Locate new source files.
1047 * Basic.mk.template, mk/*: Update for new source file locations.
1048 * NEWS, README.DOS.template: Update for new locations.
1049 * build.template, build_w32.bat, builddos.bat: Ditto.
1050 * po/POTFILES.in: Ditto
1051 * tests/run_make_tests.pl, tests/scripts/features/load*: Ditto.
1052 * make.1: Move to doc.
1053 * mk/VMS.mk: Add support for building on VMS (hopefully).
1054 * makefile.vms, prepare_w32.bat: Remove.
1055 * SCOPTIONS: Update to define HAVE_CONFIG_H
1057 2017-11-18 Paul Smith <psmith@gnu.org>
1059 * job.c: Add "command" as a known shell built-in.
1060 This is not a POSIX shell built-in but it's common in UNIX shells.
1061 Reported by Nick Bowler <nbowler@draconx.ca>.
1063 * tests/scripts/features/output-sync: Revert bad change in 0c5a9f9b92a
1065 2017-11-18 Paul Smith <psmith@gnu.org>
1067 Remove unsupported build facilities.
1068 Over time the non-standard build and install systems (nmake files,
1069 smake files, Visual Studio project files, etc.) have atrophied and
1070 maintaining them is not worth the effort, for such a simple utility
1071 as make. Remove all the non-standard build tool support and unify
1072 OS-specific build rules under a basic set of (GNU make) makefiles.
1074 Preserve the existing bootstrapping scripts (for POSIX, Windows,
1075 and MS-DOS). Also the existing VMS build scripts are left unchanged:
1076 I don't have enough experience with VMS to venture into this area.
1077 Perhaps one of the VMS maintainers might like to determine whether
1078 conversion would be appropriate.
1080 Rather than create libraries for w32 and glob (non-POSIX), simply
1081 link the object files directly to remove the complexity.
1083 * NEWS: Update with user-facing notes.
1084 * Makefile.am: Clean up to use the latest automake best practices.
1085 Build Windows code directly from the root makefile to avoid recursion.
1086 * README.Amiga, README.DOS.template, README.W32.template: Updated.
1087 * INSTALL: Point readers at the README.git file.
1088 * maintMakefile: Remove obsolete files. Create Basic.mk file.
1089 * Basic.mk.template, mk/*.mk: Create basic GNU make-based makefiles.
1090 * build_w32.bat: Copy Basic.mk to Makefile
1091 * configure.ac: We no longer need AM_PROG_AR.
1092 * dosbuild.bat: Rename to builddos.bat. Incorporate configure.bat.
1093 * Makefile.DOS.template: Remove.
1094 * NMakefile.template, w32/subproc/NMakefile: Remove.
1095 * SMakefile.template, glob/SMakefile, glob/SCOPTIONS, make.lnk: Remove.
1096 * configure.bat, glob/configure.bat: Remove.
1097 * w32/Makefile.am: Remove.
1098 * make_msvc_net2003.sln, make_msvc_net2003.vcproj: Remove.
1100 2017-11-11 Paul Smith <psmith@gnu.org>
1102 * Makefile.am: Add jhelp.pl to remote test setup.
1104 2017-11-11 Paolo Bonzini <pbonzini@redhat.com>
1106 Do not use STOP_SET for singleton compares.
1107 Compare against '$' directly rather than using MAP_VARIABLE.
1108 This saves ~10% for find_map_function, which is the top hotspot in
1109 QEMU's no-op build. The build is sped up overall by about 1.5%
1110 more (from 11.1s to 10.95s).
1112 * read.c (find_map_function): Do not compare against singleton sets.
1114 2017-11-11 Paolo Bonzini <pbonzini@redhat.com>
1116 Speedup parsing of functions.
1117 Use the stopchar map to quickly jump over everything that is
1118 not an open/close brace, an open/close parenthesis or a comma.
1120 This saves 1% on QEMU's noop build (from 11.23s to 11.1s).
1122 * function.c (find_next_argument, handle_function): Check
1123 with STOP_SET before comparing against individual characters.
1124 * main.c (initialize_stopchar_map): Initialize MAP_VARSEP
1125 mappings in stopchar_map.
1126 * makeint.h (MAP_VARSEP): New.
1128 2017-11-11 Paolo Bonzini <pbonzini@redhat.com>
1130 Remove MAP_PERCENT as strchr is faster.
1131 * read.c (find_percent_cached): Use strchr instead of STOP_SET
1133 * makeint.h (MAP_PERCENT): Remove.
1134 * main.c (initialize_stopchar_map): Remove.
1136 2017-11-11 Paolo Bonzini <pbonzini@redhat.com>
1139 This is about twice as fast as the current hash, and removes the
1140 need for double hashing (improving locality of reference). The
1141 hash function is based on Bob Jenkins' design, slightly adapted
1142 wherever Make needs to hash NUL-terminated strings. The old hash
1143 function is kept for case-insensitive hashing.
1145 This saves 8.5% on QEMU's no-op build (from 12.87s to 11.78s).
1147 * configure.ac: Check endianness.
1148 * hash.c (rol32, jhash_mix, jhash_final, JHASH_INITVAL,
1149 sum_get_unaligned_32, jhash): New.
1150 * hash.h (STRING_HASH_1, STRING_N_HASH_1): Use jhash.
1151 (STRING_HASH_2, STRING_N_HASH_2): Return a dummy value.
1152 (STRING_N_COMPARE, return_STRING_N_COMPARE): Prefer memcmp to strncmp.
1154 2017-11-11 Paolo Bonzini <pbonzini@redhat.com>
1156 Use strchr for simple case of find_char_unquote.
1157 In most cases, find_char_unquote has a single stopchar. In that
1158 case we can look for it using strchr's optimized implementation.
1160 This saves 3.5% on QEMU's noop build (from 11.78s to 11.37s).
1162 * read.c (find_char_unquote): Rename to find_map_unquote. Replace
1163 with an implementation optimized for the case where the stopchar
1164 is a singleton. Adjust all callers.
1166 2017-11-11 Paolo Bonzini <pbonzini@redhat.com>
1168 Use strchr/memmove in collapse_continuations.
1169 collapse_continuations is already using strchr to speed up the
1170 common case of no backslash-newline sequence, but on modern
1171 processors it is faster to scan the string twice with
1172 strchr+memmove (or strlen+memmove) than to move bytes manually.
1174 Saves about 1.5% on QEMU's no-op build (from 11.37s to 11.23s).
1176 * misc.c (collapse_continuations): Rewrite the scanning of LINE.
1178 2017-10-31 Paul Smith <psmith@gnu.org>
1180 * main.c (main): [SV 48274] Allow -j in makefile MAKEFLAGS variable.
1181 * tests/jhelp.pl: New file to allow testing parallelism without sleep.
1182 * tests/scripts/features/parallelism: Test this.
1183 * tests/scripts/features/jobserver: Update tests.
1184 * tests/scripts/features/output-sync: Remove useless rm command.
1186 2017-10-30 Paul Smith <psmith@gnu.org>
1188 * job.c (child_error): Modify error message string.
1189 Ensure Emacs compile-mode's next-error doesn't match target failure
1190 messages. Syntax errors in makefiles are still matched.
1192 * function.c (func_if): Check the first character of condition.
1193 Reported by Rob W <robw9739@gmail.com>
1195 2017-10-30 Paul Eggert <eggert@cs.ucla.edu>
1197 glob: Do not assume glibc glob internals.
1198 It has been proposed that glibc glob start using gl_lstat,
1199 which the API allows it to do. GNU 'make' should not get in
1200 the way of this. See:
1201 https://sourceware.org/ml/libc-alpha/2017-09/msg00409.html
1203 * dir.c (local_lstat): New function, like local_stat.
1204 (dir_setup_glob): Use it to initialize gl_lstat too, as the API
1207 2017-10-30 Paul Smith <psmith@gnu.org>
1209 Compute load from number of running processes.
1210 * job.c (load_too_high): If /proc/loadavg is available, compare the
1211 maximum load against the number of processes currently running. If
1212 we can't parse /proc/loadavg, use the previous algorithm.
1214 Concept and initial patch from Sven C. Dack <sven.c.dack@sky.com>
1216 2017-09-30 Eli Zaretskii <eliz@gnu.org>
1218 Fix checking existence of directories on MS-Windows
1219 * remake.c (name_mtime) [WINDOWS32]: Emulate Posix behavior of
1220 'stat' with the likes of "foo/" and "foo/.".
1222 2017-07-09 Paul Smith <psmith@gnu.org>
1224 Update copyright statements for 2017.
1226 Remove uses of unnecessary "register" keyword.
1228 * variable.c (create_pattern_var): [SV 51266] Create with xcalloc().
1229 Reported by Chris Metcalf <cmetcalf@mellanox.com>
1231 [SV 51400] Only unblock fatal signals after child invocation
1232 * job.c (unblock_sigs): Only unblock fatal signals not all signals.
1233 (unblock_all_sigs): Unblock all signals not just fatal signals.
1234 (child_execute_job): Call unblock_all_sigs() in child process.
1235 * job.h: Remove unused function definitions.
1236 * remote-cstms.c (start_remote_job): Call unblock_all_sigs() in
1238 Reported by Koen Van Hoof <koen.van_hoof@nokia.com>
1240 2017-07-01 Paul Smith <psmith@gnu.org>
1242 * function.c (shell_completed): [SV 51014] Add signal to .SHELLSTATUS
1243 * tests/scripts/functions/shell: Verify that .SHELLSTATUS contains
1244 a non-0 value when the shell exits due to a signal.
1246 2017-06-07 Eli Zaretskii <eliz@gnu.org>
1248 Avoid crashes when SHELL=abcde is specified on the command line
1249 * variable.c (do_variable_definition): If $SHELL was not found,
1250 process "SHELL=foo" as any other variable definition. This avoids
1251 segfaults when SHELL=foo is specified on the Make command line.
1252 Reported by Orgad Shaneh <orgads@gmail.com>.
1254 2017-06-04 Paul Smith <psmith@gnu.org>
1256 [SV 51159] Use a non-blocking read with pselect to avoid hangs.
1257 * posixos.c (set_blocking): Set blocking on a file descriptor.
1258 (jobserver_setup): Set non-blocking on the jobserver read side.
1259 (jobserver_parse_auth): Ditto.
1260 (jobserver_acquire_all): Set blocking to avoid a busy-wait loop.
1261 (jobserver_acquire): If the non-blocking read() returns without
1262 taking a token then try again.
1264 [SV 50823] Support filenames containing '$' in MAKEFILE_LIST
1265 * variable.h (enum variable_flavor: Add a new flavor for appended
1266 values that shouldn't be expanded.
1267 * variable.c (do_variable_definition): If given this new flavor,
1268 do not expand the value before appending it.
1269 * read.c (eval_makefile): Use this new flavor for MAKEFILE_LIST
1270 * tests/scripts/variables/MFILE_LIST: Test filenames containing '$'.
1272 * tests/test_driver.pl: Useful error if given an invalid test name.
1274 * NEWS: Do not insert a space during '+=' if the value is empty.
1275 * doc/make.texi (Appending): Document this behavior.
1276 * variable.c (do_variable_definition): Only add a space if the variable
1278 * tests/scripts/variables/flavors: Test this behavior.
1280 2017-06-04 Enrique Olaizola <enrique_olaizola16@hotmail.com> (tiny change)
1282 * read.c (read_all_makefiles): [SV 50909] Add MAKEFILES to strcache
1284 2017-06-04 Paul Smith <psmith@gnu.org>
1286 * po/LINGUAS: Add support for traditional Chinese (zh_TW)
1288 Rename output_tmpfile() to a misc function get_tmpfile()
1289 * output.c: Remove output_tmpfile() and umask handling.
1291 * misc.c: Add get_tmpfile() and umask handling.
1293 * function.c: Rename output_tmpfile() to get_tmpfile().
1297 [SV 13651] Handle out-of-memory conditions slightly more gracefully.
1298 * makeint.h: Change OUT_OF_MEM() macro to out_of_memory() function.
1299 * output.h, job.h: Move FD_* macros from job.h to output.h.
1300 * output.c (output_write): Write a buffer to an FD directly.
1301 (out_of_memory): Use output_write() to avoid allocating more
1302 memory while writing the error, and call exit() instead of die().
1303 This does mean we can't translate the error string, though.
1304 * misc.c (xmalloc, xcalloc, xrealloc, xstrdup, xstrndup): Call new
1305 out_of_memory() rather than OUT_OF_MEM().
1306 * read.c (parse_file_seq): Ditto.
1308 Clean up close-on-exec, particularly with jobserver pipes.
1309 * configure.ac: Check sys/file.h and assume fileno() always exists.
1310 * output.h: Move output-specific content from job.h to output.h.
1311 * os.h (fd_inherit, fd_noinherit): New functions manage FD inheritance.
1312 * posixos.c (fd_inherit, fd_noinherit): Implement for POSIX systems.
1313 (jobserver_setup): Force jobserver FDs to not be inherited by default.
1314 (jobserver_pre_child): Enable inheritance in recursive invocations.
1315 (jobserver_post_child): Disable inheritance after recursive invocations.
1316 * w32/w32os.c (fd_inherit, fd_noinherit): Implement for W32 systems.
1317 * job.h (CLOSE_ON_EXEC): Remove macro in deference to new fd_noinherit.
1318 * function.c (func_shell_base): Convert CLOSE_ON_EXEC to fd_noinherit.
1319 * job.c (child_execute_job): Ditto.
1320 * output.c (setup_tmpfile): Ditto.
1321 * read.c (eval_makefile): Ditto, plus remove HAVE_FILENO check.
1322 * w32/include/sub_proc.h: Remove process_noinherit for fd_noinherit.
1323 * w32/subproc/sub_proc.c: Ditto.
1325 [SV 50300] Use CFLAGS value of "-O1" in POSIX mode.
1326 * read.c (record_files): Use "-O1" not "-O" for CFLAGS and FFLAGS.
1327 * tests/scripts/targets/POSIX: Test for the new value.
1329 * configure.ac: [SV 50648] Detect Guile 2.2 packages.
1331 * doc/make.texi: [SV 50304] Add missing close parenthesis.
1333 Add test suite support to Windows
1334 * main.c (main): Sanitize program name detection on Windows.
1335 * makeint.h: 'program' is a const string on all platforms now.
1336 * tests/run_make_tests.bat: Windows bat file to invoke tests
1337 * tests/test_driver.pl: Obtain system-specific error messages.
1338 (get_osname): Compute the $port_type here. Add more $osname checks
1339 for different Windows Perl ports.
1340 (_run_command): Rewrite the timeout capability to work properly
1341 with Windows. Don't use Perl fork/exec; instead use system(1,...)
1342 which allows a more reliable/proper kill operation.
1343 Also, allow options to be given as a list instead of a string, to
1344 allow more complex quoting of command-line arguments.
1345 * tests/run_make_tests.pl (run_make_with_options): Allow options
1346 to be provided as a list in addition to a simple string.
1347 (set_more_defaults): Write sample makefiles and run make on them
1348 instead of trying to run echo and invoking make with -f-, to avoid
1349 relying on shell and echo to get basic configuration values. Also
1350 create a $sh_name variable instead of hard-coding /bin/sh.
1351 * tests/scripts/features/archives: Skip on Windows.
1352 * tests/scripts/features/escape: Use list method for passing options.
1353 * tests/scripts/features/include: Use system-specific error messages.
1354 * tests/scripts/features/output-sync: "Command not found" errors
1355 generate very different / odd output on Windows. This needs to be
1356 addressed but for now disable these tests on Windows.
1357 * tests/scripts/functions/abspath: Disable on Windows.
1358 * tests/scripts/functions/file: Use system-specific error messages.
1359 * tests/scripts/functions/shell: "Command not found" errors generate
1360 very different / odd output on Windows. This needs to be addressed
1361 but for now disable these tests on Windows.
1362 * tests/scripts/misc/close_stdout: Disable on Windows.
1363 * tests/scripts/options/dash-k: Use system-specific error messages.
1364 * tests/scripts/options/dash-l: Disable on Windows.
1365 * tests/scripts/options/eval: Use list method for passing options.
1366 * tests/scripts/options/general: Skip some non-portable tests.
1367 * tests/scripts/targets/ONESHELL: Skip some non-portable tests.
1368 * tests/scripts/targets/POSIX: Skip some non-portable tests.
1369 * tests/scripts/variables/MAKEFILES: Skip some non-portable tests.
1370 * tests/scripts/variables/SHELL: Use a makefile not -f- for testing.
1372 2017-06-04 Enrique Olaizola <enrique_olaizola16@hotmail.com>
1374 * tests/run_make_tests.pl: [SV 50902] Find Perl modules
1376 2017-01-11 Eli Zaretskii <eliz@gnu.org>
1378 [SV 50021] Avoid infloop on MS-Windows with short scripts
1379 * job.c (reap_children) [WINDOWS32]: Avoid recursive call to
1380 reap_children when the argument passed to
1381 map_windows32_error_to_string is negative or too large.
1383 2016-12-28 Paul Smith <psmith@gnu.org>
1385 * main.c (switches): Add -E as an alias for --eval.
1386 * make.1: Document the -E and --eval options.
1387 * doc/make.texi: Document the -E option.
1388 * tests/scripts/options/eval: Test the -E option and MAKEFILES.
1389 * NEWS: Add information about the new option.
1391 * main.c (switches): Add --no-silent to undo -s options.
1392 * make.1: Document the new flag.
1393 * doc/make.texi: Document the new flag. Remove suggestions that the
1394 .SILENT special target is deprecated or should not be used.
1395 * tests/scripts/options/dash-s: Test the -s and --no-silent options.
1396 * NEWS: Add information about the new option.
1398 2016-12-26 Martin Dorey <martin.dorey@hds.com>
1400 * job.c (child_execute_job): [SV 49938] Avoid spurious GCC warning.
1402 * main.c (main): [SV 49935] Fix uninitialized variable.
1404 2016-12-26 Paul Smith <psmith@gnu.org>
1406 [SV 40236] Handle included file open failures properly.
1407 * read.c (eval_makefile): Set deps->error if we discovered any
1408 error reading makefiles, and set NONEXISTENT_MTIME so we know
1409 it needs to be rebuilt.
1410 * main.c (main): Clean up management of makefile_mtimes.
1411 * tests/scripts/features/include: Add open failure testcases.
1413 Portability changes for the test suite.
1414 * tests/test_driver.pl: Save error strings for later comparison.
1415 * tests/run_make_tests.pl: Create portable commands for later use.
1416 * tests/*: Use these new variables.
1418 [SV 20513] Un-escaped # are not comments in function invocations
1419 * NEWS: Document the change, as a backward-incompatible change.
1420 * main.c (main): Add 'nocomment' to the .FEATURES variable.
1421 * read.c (remove_comments): Skip variable references during remove.
1422 (find_char_unquote): Fix comments for new STOPMAP support.
1423 * tests/scripts/features/escape: Test new escape syntax.
1424 * tests/scripts/functions/guile: Ditto.
1425 * tests/scripts/functions/shell: Ditto.
1427 * main.c (main): [SV 40234] Show correct error message.
1429 2016-12-26 Christoph Schulz <develop@kristov.de>
1431 * main.c (switches): [SV 48809] Accept obsolete jobserver flag.
1433 2016-12-26 Paul Smith <psmith@gnu.org>
1435 * read.c (get_next_mword): [SV 49865] Make fallthrough explicit.
1437 [SV 49114] Remove support for the NO_FLOAT compile flag.
1438 * makeint.h (max_load_average): Always a double.
1439 * main.c (max_load_average, default_load_average): Always doubles.
1440 (switches): -l option is a "floating" format.
1441 (decode_switches, define_makeflags): Support "floating" format.
1442 * remake.c (f_mtime): Show time skew as double.
1443 * rule.c (print_rule_data_base): Show percentages as double.
1444 * Makefile.ami, README.DOS.template, SMakefile.template: Remove
1445 references to NO_FLOAT.
1446 * SCOPTIONS, glob/SCOPTIONS: Remove NO_FLOAT settings.
1448 [SV 45477] [SV 49115] Parse DOS/Windows drivespecs correctly.
1449 * read.c (parse_file_seq) [WINDOWS32]: Only consider a colon part of
1450 a path if it's in a valid Windows drivespec.
1452 2016-12-25 Paul Smith <psmith@gnu.org>
1454 [SV 49116] Check potential null pointer dereference.
1455 * w32/subproc/sub_proc.c (make_command_line): Simplify cygwin shell
1456 check for correctness.
1458 2016-12-25 Jaak Ristioja <jaak@ristioja.ee>
1460 * expand.c (variable_append): [SV 49113] Possible null ptr deref
1462 * w32/*/dirent.*: [SV 49111] Remove unused telldir()
1464 2016-12-25 Paul Smith <psmith@gnu.org>
1466 Add more GCC warnings to the maintainer build.
1467 * arscan.c: [SV 49112] Correct TEST printf() formatting.
1468 Recommended by Jaak Ristioja <jaak@ristioja.ee>
1469 * hash.c: Correct fprintf() formatting.
1470 * maintMakefile: Add extra GCC warning flags.
1472 * po/Makevars, makeint.h, debug.h: Add xgettext C format flags.
1474 * po/LINGUAS: Added Serbian translation.
1476 * README.template: Clarify some items in the README
1478 * doc/make.texi: [SV 48951] Fix documentation typo.
1480 * maintMakefile: Update default GPG ID for new key.
1482 2016-12-14 Paul Smith <psmith@gnu.org>
1484 Resolve issues discovered by static code analysis.
1485 * maintMakefile: Add a rule to submit code for analysis.
1486 * configure.ac: Check for availability of the umask() function.
1487 * output.c (output_tmpfd, output_tmpfile): Use umask on temp files.
1488 * makeint.h (PATH_VAR): Reserve an extra character for nul bytes.
1489 * function.c (func_error): Initialize buffer to empty string.
1490 * job.c (child_execute_job): Verify validity of fdin.
1491 * main.c (main): Simplify code for makefile updating algorithm.
1492 * arscan.c (ar_scan): Verify member name length before reading.
1493 * read.c (readline): Cast pointer arithmetic to avoid warnings.
1494 * remake.c (update_file): Remove unreachable code.
1495 (name_mtime): Verify symlink name length.
1497 2016-11-12 Eli Zaretskii <eliz@gnu.org>
1499 * NEWS: Mention the extended support for -jN on MS-Windows.
1501 2016-11-12 Marc Ullman <marc@mathworks.com>
1503 Support more than 63 jobs on MS-Windows
1504 * job.c (start_waiting_job, load_too_high):
1505 * w32/w32os.c (jobserver_setup, jobserver_acquire): Abstracted out
1506 MAXIMUM_WAIT_OBJECTS. Call process_table_full instead.
1507 * w32/include/sub_proc.h: Update and add prototypes.
1508 * w32/subproc/sub_proc.c (GMAKE_MAXIMUM_WAIT_OBJECTS): New macro.
1509 (process_wait_for_multiple_objects): Drop-in replacement for Windows
1510 API WaitForMultipleOjects.
1511 (process_wait_for_any_private): Replaced MAXIMUM_WAIT_OBJECTS with
1512 GMAKE_MAXIMUM_WAIT_OBJECTS.
1513 (process_table_full): Replacement for process_used_slots.
1514 (process_used_slots): Removed, as no longer needed.
1515 (process_table_usable_size): Returns maximum usable size of process
1517 (process_table_actual_size): Returns actual size of process table.
1518 (process_register): Added assertion.
1519 (process_easy): Abstracted out MAXIMUM_WAIT_OBJECTS.
1521 2016-10-09 Eli Zaretskii <eliz@gnu.org>
1523 Only include strings.h in MinGW builds
1525 * job.c: Include strings.h only if HAVE_STRINGS_H is defined.
1527 * config.h.W32.template (HAVE_STRINGS_H): Define only for MinGW,
1528 as MSVC doesn't have this header.
1530 2016-10-06 Eli Zaretskii <eliz@gnu.org>
1532 Update the Guile version tested with the MS-Windows build.
1534 Avoid compiler warnings with MinGW runtime 3.22.2
1536 * job.c: Include strings.h, to get the prototypes of strcasecmp
1537 and strncasecmp with latest MinGW runtime versions.
1538 * config.h.W32.template (HAVE_STRINGS_H): Define.
1540 2016-06-24 Paul Smith <psmith@gnu.org>
1542 * README.W32.template: Update the build documentation.
1543 * build_w32.bat: Fix issues with Visual Studio builds. Fix an error
1544 that always created Debug builds. Support 32bit and 64bit builds.
1546 * Update to pre-release version 4.2.90.
1548 2016-06-10 Paul Smith <psmith@gnu.org>
1550 GNU Make release 4.2.1.
1552 2016-06-06 Paul Smith <psmith@gnu.org>
1554 * maintMakefile: TP recommends rsync for retrieving PO files.
1556 2016-05-31 Jeremy Devenport <jeremy.devenport@gmail.com> (tiny change)
1558 * main.c (main): [SV 48009] Reset stack limit for make re-exec.
1560 2016-05-31 Paul Smith <psmith@gnu.org>
1562 [SV 47995] Ensure forced double-colon rules work with -j.
1563 The fix for SV 44742 had a side-effect that some double-colon targets
1564 were skipped. This happens because the "considered" facility assumed
1565 that all targets would be visited on each walk through the dependency
1566 graph: we used a bit for considered and toggled it on each pass; if
1567 we didn't walk the entire graph on every pass the bit would get out
1568 of sync. The new behavior after SV 44742 might return early without
1569 walking the entire graph. To fix this I changed the considered value
1570 to an integer which is monotonically increasing: it is then never
1571 possible to incorrectly determine that a previous pass through the
1572 graph already considered the current target.
1574 * filedef.h (struct file): make CONSIDERED an unsigned int.
1575 * main.c (main): No longer need to reset CONSIDERED.
1576 * remake.c (update_goal_chain): increment CONSIDERED rather than
1577 inverting it between 0<->1.
1578 (update_file_1): Reset CONSIDERED to 0 so it's re-considered.
1580 * tests/scripts/features/double_colon: Add a regression test.
1582 2016-05-31 Paul Smith <psmith@gnu.org>
1584 * DELETE_ON_ERROR: [SV 48061] Use "exit 1" for portability.
1585 Reported by Joel Fredrikson <Joel.Fredrikson@it.uu.se>
1587 * w32/pathstuff.c: [SV 47996] Use ISBLANK() not isblank().
1589 2016-05-28 Eli Zaretskii <eliz@gnu.org>
1591 Fix printing time stamps on MS-Windows
1592 * dir.c (print_dir_data_base) [WINDOWS32]: Use %I64u format for
1593 printing unsigned 64-bit data types, as %ull is not universally
1596 2016-05-27 Luke Allardyce <lukeallardyce@gmail.com> (tiny change)
1598 [SV 48037] Fix MinGW build with Posix configury tools
1599 * w32/Makefile.am (libw32_a_CPPFLAGS): Add -I$(srcdir)/glob.
1601 2016-05-22 Paul Smith <psmith@gnu.org>
1603 GNU Make release 4.2.
1605 2016-05-21 Joe Crayne <oh.hello.joe@gmail.com> (tiny change)
1607 [SV 44742] Fix double-colon rules plus parallel builds.
1608 * remake.c (update_file): Don't update double-colon target status
1609 if we're still building targets.
1610 (ftime_t): Don't propagate timestamps for double-colon targets that
1611 we've not examined yet.
1612 * tests/scripts/features/double_colon: Add parallel build tests.
1614 2016-05-21 Paul Smith <psmith@gnu.org>
1616 * read.c (eval): [SV 47960] Skip record waiting files when ignoring.
1617 * tests/scripts/features/conditionals: Test this scenario.
1619 Separate the GNU make load ABI from internal types.
1620 Create an internal type "floc" and convert all users to that type.
1621 * gnumake.h (gmk_floc): Remove the offset field from this type.
1622 * loadapi.c (gmk_eval): Convert gmk_floc to internal floc.
1624 2016-05-21 Paul Eggert <eggert@cs.ucla.edu>
1626 Fixes for enhanced GCC warnings.
1627 Move function prototypes into header files and out of .c files.
1628 Use void argument lists for functions that accept no args.
1629 Remove unused macros. Make private functions static. Align
1630 types with printf format characters.
1632 2016-05-21 Paul Smith <psmith@gnu.org>
1634 Fix compile issues with Windows and VMS.
1635 * main.c (initialize_stopchar_map): isblank() is not part of C89.
1636 Install bits for space and tab directly.
1637 * makeint.h: Don't define vfork; autoconf handles this for us.
1638 * vmsjobs.c: Rename NEXT_TOKEN to V_NEXT_TOKEN to avoid conflicts.
1639 * dir.c (print_dir_data_base): Visual Studio C doesn't have int64_t.
1640 * w32/subproc/sub_proc.c (process_begin): Missing arg to memset().
1641 * build_w32.bat: Don't use obsolete Visual Studio flags.
1643 Allow compiling with an ISO C 1989/1990 compiler.
1644 * posixos.c (jobserver_post_child): Use C89 for loop syntax.
1645 * remake.c (update_goal_chain): Ditto.
1646 * variable.c (parse_variable_definition): Ditto.
1648 2016-05-17 Eli Zaretskii <eliz@gnu.org>
1650 [SV 47942] Avoid random crashes in subordinate programs on MS-Windows
1651 * w32/subproc/sub_proc.c (process_begin): Zero out startInfo
1652 before using it. Fixes crashes in Intel Fortran compiler invoked
1655 2016-04-24 Eli Zaretskii <eliz@gnu.org>
1657 Fix the MS-Windows MinGW build
1658 * build_w32.bat (GccCompile): Use -std=gnu99, as some code uses
1659 C99 features ('for' loop initial declarations).
1661 * dir.c (print_dir_data_base) [WINDOWS32]: Cast 'mtime' to
1662 'int64_t', and use %I64d to print it, to avoid compile-time
1663 warning about printing a 'time_t' value, which could be either
1664 a 32-bit or a 64 bit integral type.
1666 2016-04-23 Paul Smith <psmith@gnu.org>
1668 * tests/scripts/features/output-sync: increase test timeout.
1669 I'm getting random failures with a timeout of 10s; increase to 30s.
1671 2016-04-11 Paul Smith <psmith@gnu.org>
1673 * NEWS: Update for pre-release
1675 * dep.h, makeint.h (show_goal_error): Move to makeint.h.
1677 2016-04-11 Paul Smith <psmith@gnu.org>
1679 [SV 46433] Show recipe line offsets in line number messages.
1680 While displaying line numbers, show the relevant line number inside
1681 the recipe not just the first line of the entire recipe.
1682 Sample changes suggested by Brian Vandenberg <phantall@gmail.com>
1684 * gnumake.h (gmk_floc): Add an 'offset' to track the recipe offset.
1685 * read.c (eval, eval_makefile, eval_buffer): Initialize 'offset'.
1686 (record_files, install_pattern_rule): Ditto.
1687 * job.c (new_job, job_next_command): Update 'offset' based on the
1688 line of the recipe we're expanding or invoking.
1689 (child_error): Add 'offset' when showing the line number.
1690 * function.c (func_shell_base): Ditto.
1691 * output.c (error, fatal): Ditto.
1692 * NEWS: Mention the new ability.
1693 * tests/scripts/features/errors: Check the line number on errors.
1694 * tests/scripts/functions/warning: Check the line number on warnings.
1695 * tests/scripts/features/output-sync,
1696 tests/scripts/features/parallelism, tests/scripts/functions/shell,
1697 tests/scripts/functions/error: Update line numbers.
1699 2016-04-09 Paul Smith <psmith@gnu.org>
1701 * maintMakefile: Add a rule for storing preprocessor output.
1703 [SV 102] Don't show unnecessary include file errors.
1704 Delay the generation of error messages for included files until we
1705 are sure that we can't rebuild that included file.
1706 * dep.h (struct dep): Don't reuse "changed"; make a separate field
1707 to keep "flags". Get rid of dontcare and use the flag.
1708 (struct goaldep): Create a new structure for goal prereqs
1709 that tracks an errno value and the floc where the include happened.
1710 Rework the structures to ensure they are supersets as expected.
1711 In maintainer mode with GCC, use inline to get type checking.
1712 * read.c (eval_makefile): Return a struct goaldep for the new
1713 makefile. Ensure errno is set properly to denote a failure.
1714 (read_all_makefiles): Switch to goaldep and check errno.
1715 (eval): Don't show included file errors; instead remember them.
1716 * remake.c (update_goal_chain): Set global variables to the current
1717 goaldep we're building, and the entire chain.
1718 (show_goal_error): Check if the current failure is a consequence
1719 of building an included makefile and if so print an error.
1720 (complain): Call show_goal_error() on rule failure.
1721 * job.c (child_error): Call show_goal_error() on child error.
1722 * main.c (main): Switch from struct dep to goaldep.
1723 * misc.c (free_dep_chain): Not used; make into a macro.
1724 * tests/scripts/features/include: Update and include new tests.
1725 * tests/scripts/options/dash-B, tests/scripts/options/dash-W,
1726 tests/scripts/options/print-directory,
1727 tests/scripts/variables/MAKE_RESTARTS: Update known-good-output.
1729 * job.c (child_error): Add filename length to output length.
1730 Reported by Dale Stimson <dale@riyescott.com>
1732 2016-04-04 Paul Smith <psmith@gnu.org>
1734 Preserve the real value of -jN in MAKEFLAGS using jobserver.
1735 Previously if the jobserver was active, MAKEFLAGS would contain only
1736 the -j option but not the number (not -j5 or whatever) so users
1737 could not discover that value. Allow that value to be provided in
1738 MAKEFLAGS without error but still give warnings if -jN is provided
1739 on the command line if the jobserver is already activated.
1741 * NEWS: Discuss the new behavior.
1742 * os.h, posixos.c, w32/w32os.c: Return success/failure from
1743 jobserver_setup() and jobserver_parse_auth().
1744 * main.c (main): Separate the command line storage of job slots (now
1745 in arg_job_slots) from the control storage (in job_slots). Make a
1746 distinction between -jN flags read from MAKEFLAGS and those seen
1747 on the command line: for the latter if the jobserver is enabled then
1748 warn and disable it, as before.
1749 * tests/scripts/features/jobserver: Add new testing.
1751 2016-04-04 Paul Smith <psmith@gnu.org>
1753 * tests/run_make_tests.pl: Add file/lineno info to .run file.
1755 * maintMakefile: Fix logging of check-alt-config target.
1757 * job.c (child_execute_job): Fix $(shell...) under NO_OUTPUT_SYNC.
1758 * main.c (decode_output_sync_flags): Use NONE for NO_OUTPUT_SYNC.
1760 * main.c (main): Restrict disabling debugging for MAKEFILES.
1762 * Makefile.am, w32/Makefile.am: Fix *os.c for Windows builds.
1763 Original change provided by Luke Allardyce <lukeallardyce@gmail.com>
1765 * make.texi: Confirm that CURDIR contains an absolute path.
1767 * docs/make.texi: [SV 47392] Add "Integrating make" chapter.
1769 Change --jobserver-fds to more generic --jobserver-auth.
1770 * NEWS: Mention the change.
1771 * main.c: Rename jobserver_fds variable to jobserver_auth and
1772 --jobserver-fds option to --jobserver-auth.
1773 * os.h, posixos.c, w32/w32os.c: Rename jobserver_parse_arg() and
1774 jobserver_get_arg() to jobserver_parse_auth()/jobserver_get_auth().
1776 2016-03-23 Paul Smith <psmith@gnu.org>
1778 * tests/run_make_tests.pl: Preserve $make_command
1779 * tests/scripts/options/dash-n: Use $make_command. This fixes
1780 a spurious failure when running tests with valgrind enabled.
1782 * variable.c: Clean up some memory leaks.
1784 [SV 46995] Strip leading/trailing space from variable names
1785 * makeint.h: Change MAP_SPACE to MAP_NEWLINE, and add MAP_PATHSEP
1786 and MAP_SPACE which is now MAP_BLANK|MAP_NEWLINE. Create
1787 NEW_TOKEN(), END_OF_TOKEN(), ISBLANK(), ISSPACE() macros.
1788 * main.c (initialize_stopchar_map): Set MAP_NEWLINE only for
1790 * Convert all uses of isblank() and isspace() to macros.
1791 * Examine all uses of isblank() (doesn't accept newlines) and
1792 change them wherever possible to ISSPACE() (does accept newlines).
1793 * function.c (func_foreach): Strip leading/trailing space.
1794 * variable.c (parse_variable_definition): Clean up.
1795 * tests/scripts/functions/foreach: Test settings and errors.
1796 * tests/scripts/functions/call: Rewrite to new-style.
1797 * tests/scripts/misc/bs-nl: Add many more tests for newlines.
1799 2016-03-21 Paul Smith <psmith@gnu.org>
1801 * function.c (func_file): Support reading from files.
1802 * NEWS: Add information about reading files.
1803 * make.texi (File Function): Describe reading files.
1804 * tests/scripts/functions/file: Test new features for $(file ...)
1806 2016-03-20 Paul Smith <psmith@gnu.org>
1808 * doc/make.texi (Setting Variables): Fix typo (add comma).
1810 * job.c (child_error): Combine file info with error message.
1811 * tests/scripts/...: Update error message matches.
1813 2016-03-19 Paul Smith <psmith@gnu.org>
1815 * variable.c: Align type of variable_changenum.
1817 2016-03-13 Paul Smith <psmith@gnu.org>
1819 [SV 45728] Detect changes in .VARIABLES more accurately.
1820 For performance, we only recompute .VARIABLES when (a) it's expanded
1821 and (b) when its value will change from a previous expansion. To
1822 determine (b) we were checking the number of entries in the hash
1823 table which used to work until we started undefining entries: now if
1824 you undefine and redefine the same number of entries in between
1825 expanding .VARIABLES, it doesn't detect any change. Instead, keep
1826 an increasing change number.
1827 * variables.c: Add variable_changenum.
1828 (define_variable_in_set, merge_variable_sets): Increment
1829 variable_changenum if adding a new variable to the global set.
1830 (undefine_variable_in_set): Increment variable_changenum if
1831 undefining a variable from the global set.
1832 (lookup_special_var): Test variable_changenum not the hash table.
1833 * tests/scripts/variables/special: Test undefining variables.
1835 * main.c(main): Disable output sync without parallel builds.
1837 [SV 46581] Pre-define .LOADED to avoid warnings.
1838 * main.c (main): Pre-define .LOADED as a default-level variable.
1839 * load.c (load_file): Set the value rather than append it. Avoid
1840 adding an extra initial whitespace.
1841 * tests/scripts/features/load: Run with --warn-undefined-variables.
1843 2016-03-13 Paul Smith <psmith@gnu.org>
1845 [SV 44555] Use vfork() instead of fork() where available.
1846 Testing has shown that vfork() is actually significantly
1847 more efficient on systems where it's supported, even for
1848 copy-on-write implementations. If make is big enough,
1849 duplicating the page tables is significant overhead.
1851 * configure.ac: Check for fork/vfork.
1852 * makeint.h: Include vfork.h and set up #define for it.
1853 * os.h, posixos.c (get_bad_stdin): For children who can't use
1854 the normal stdin file descriptor, get a broken one.
1855 * job.c (start_job_command): Avoid so many ifdefs and simplify
1856 the invocation of child_execute_job()
1857 (child_execute_job): move the fork operation here so it can
1858 return early for the parent process. Switch to use vfork().
1859 * function.c (func_shell_base): Use new child_execute_job() and
1861 * job.h, main.c, remote-cstms.c, vmsjobs.c, w32os.c: Update
1862 declarations and calls.
1864 2016-03-09 Paul Smith <psmith@gnu.org>
1866 * job.c (exec_command): [SV 47365] Show error on exec failure.
1868 2016-03-08 Paul Smith <psmith@gnu.org>
1870 [SV 46261] Use pselect() for jobserver where supported.
1871 * Makefile.am, configure.ac: Check for pselect() and sys/select.h.
1872 * main.c (main): Block SIGCHLD if we have pselect() support.
1873 * posixos.c (jobserver_acquire): If we support pselect() then use
1874 it to query the jobserver pipe, while also listening for SIGCHLD.
1875 Also pselect() supports a timeout so avoid alarm() calls.
1877 Clean up some compiler warnings.
1878 * commands.c, commands.h: Use unsigned char for flags.
1879 * dir.c: Use time_t and size_t, and char for a boolean value.
1880 * job.c: Use unsigned and char.
1881 * read.c: Return a signed type since -1 is a valid return code.
1883 Extract jobserver implementation into OS-specific files.
1884 * os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
1885 * job.c, job.h, main.c, makeint.h: Move content to new files.
1886 * w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
1887 * Makefile.am: Build and package OS-specific files.
1888 * build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
1889 Update for new files, and clean up the build.
1890 * POTFILES.in, maintMakefile, NMakefile.template: Ditto.
1891 * w32/subproc/build.bat: Delete as unused.
1893 [SV 46261] Add more EINTRLOOP wrappers.
1894 This cannot be a perfect solution because there are always other
1895 possible places EINTR can happen, including external libraries
1896 such as gettext, Guile etc.
1898 2016-02-29 Paul Smith <psmith@gnu.org>
1900 * strcache.c (add_hugestring): [SV 46832] Support huge strings.
1901 The strcache was limited to strings of length 65535 or less,
1902 because the length is kept in an unsigned short. To support
1903 huge strings add a new simple linked list, which we don't try
1906 * strcache.c (add_string): [SV 47071] Handle huge initial string.
1907 If the very first string added to the string cache is more than
1908 half the maximum size, we failed when moving the only strcache
1909 buffer to the full list.
1911 [SV 47151] Exit with 1 when checking recursive make -q
1912 * job.h (struct child): New bit to mark recursive command lines.
1913 * job.c (start_job_command): Set the recursive command line bit.
1914 (reap_children): If the child is a recursive command and it exits
1915 with 1 during question mode, don't print an error and exit with 1.
1916 * tests/scripts/options/dash-q: Add a regression test.
1918 * main.c (define_makeflags): Add parens to avoid GCC warning.
1920 2016-02-29 Paul Smith <psmith@gnu.org>
1922 * tests/scripts/features/archives: Handle deterministic archives.
1923 Newer versions of binutils allow ar to be compiled to generate
1924 "deterministic archives" by default: in this mode no timestamp
1925 information is generated in the static archive, which utterly
1926 breaks GNU make's archive updating capability. Debian and Ubuntu
1927 have turned this feature on by default in their distributions
1928 which causes the regression tests to fail.
1930 Update the regression tests to check for the availability of the
1931 "U" option to ar which disables deterministic archives and allows
1932 GNU make's archive support to work properly again.
1934 2016-02-28 Paul Smith <psmith@gnu.org>
1936 Update Copyright statements for the new year.
1938 * doc/make.texi: [SV 47163] Fix typo in 'ifdef' documentation.
1940 * doc/make.texi: [SV 35455] Add more uses for Empty Recipes.
1942 2015-11-07 Gisle Vanem <gvanem@yahoo.no>
1944 Fix diagnostics on MS-Windows when environment is too large
1945 * w32/subproc/sub_proc.c (process_begin): Fix test of the error
1946 cause when the environment block is too large.
1948 2015-10-27 Eli Zaretskii <eliz@gnu.org>
1950 Update README.W32.template
1951 * README.W32.template: Update for latest developments. Make it
1952 clear we don't recommend using HAVE_CASE_INSENSITIVE_FS in
1955 [SV 46304] Don't invoke C++ compiler on C sources on MS-Windows
1956 * default.c (default_variables) [HAVE_CASE_INSENSITIVE_FS]: Make
1957 COMPILE.C and LINK.C be synonyms for COMPILE.c and LINK.c,
1960 2015-09-23 Eli Zaretskii <eliz@gnu.org>
1962 [SV 45838] When invoking w32 programs, don't use free'd memory.
1963 * w32/subproc/sub_proc.c (process_begin): Freeing argv[0] makes
1964 the other argv[i] pointers invalid, so need to allocate a new
1965 array and copy argv[i] for i != 0 first, replacing argv[0] with
1966 the batch file name, before we can free argv[0].
1968 2015-07-13 Paul Smith <psmith@gnu.org>
1970 * implicit.c (pattern_search): [SV 43677] Mark files secondary.
1971 In order to fix SV 12267 we were marking the prerequisites of
1972 implicit (pattern) targets that existed elsewhere in the makefile
1973 as precious to keep them from being deleted as intermediate files.
1974 However this also keeps them from being deleted on error. Instead
1975 mark them as secondary.
1976 * tests/scripts/targets/DELETE_ON_ERROR: Test DELETE_ON_ERROR.
1978 2015-07-12 Paul Smith <psmith@gnu.org>
1980 [SV 28092] Preserve the exit status of the $(shell...) function.
1981 Add a new variable .SHELLSTATUS which holds the exit status of the
1982 last-invoked shell function or != assignment.
1984 * NEWS, doc/make.texi: Document the change.
1985 * function.c (shell_completed, msdos_openpipe, func_shell_base): Add
1986 shell_completed() to handle the completion of the shell, by setting
1987 .SHELLSTATUS. Call it where needed.
1988 * job.c (child_handler): Call shell_completed().
1989 * tests/scripts/functions/shell: Add tests for .SHELLSTATUS.
1991 2015-07-12 Paul Smith <psmith@gnu.org>
1993 * tests/scripts/misc/fopen-fail: [SV 42390] Increase test timeout.
1994 * Makefile.am (check-regression): Force ulimit -n for fopen-fail test.
1996 * job.c: [SV 43936] Check sigaction for error return.
1998 [SV 45049] Check for '$' being the last character in a string.
1999 * expand.c (variable_expand_string): Add a single '$' if '$' ends the
2001 * read.c (find_char_unquote, get_next_mword): Stop if '$' ends the
2003 * variable.c (parse_variable_definition): Ditto.
2005 * read.c (unescape_char): [SV 45050] Handle final backslashes.
2006 If the last thing in the string to be unescaped is a backslash,
2007 stop without reading beyond the end of the string.
2009 * strcache.c: [SV 45275] Handle very long strings.
2010 Our previous behavior for handling too-long strings involved
2011 increasing the size of the default string cache buffer, but the
2012 implementation was incomplete. Instead, create a one-off large
2013 string cache entry and add it directly to the full cache list
2014 without changing the default buffer size.
2016 2015-07-12 Duncan Moore <duncan.moore@gmx.com> (tiny change)
2018 * job.c [RISCOS]: Remove logic that is no longer required.
2020 2015-07-12 Paul Smith <psmith@gnu.org>
2022 * remake.c (update_file): [SV 44742] Keep double-colon rule status.
2023 Fix suggested by Everett Boyer <EvBoyer@aol.com>
2025 2015-07-10 James Johnston <johnstonj.public@codenest.com> (tiny change)
2027 [SVN 45515] Check exit status of sub-make in subproc.bat
2028 * subproc.bat: Exit when sub-make invocation fails.
2030 2015-07-10 Eli Zaretskii <eliz@gnu.org>
2032 [SV 45515] Ignore Windows-specific build artifacts
2033 * .gitignore: Ignore *.exe, *.dll.a, *.lib, *pdb, and a few more MSVC
2035 Suggested by James Johnston <johnstonj.public@codenest.com>
2037 2015-02-28 Eli Zaretskii <eliz@gnu.org>
2039 [SV 44348] Fix handling of shell widlcards on MS-Windows.
2040 * job.c (construct_command_argv_internal): If shell wildcard
2041 characters are found inside a string quoted with "..", give up the
2042 fast route and go through the shell. Fixes Savannah bug #44348.
2044 2015-01-27 John Malmberg <wb8tyw@qsl.net>
2046 Fix bs-nl handling, exit and Environment for VMS.
2047 This fix required a complete rewrite of the command parser vmsjobs.c
2048 child_execute_job. The old parser had too many incorrect assumptions
2049 about DCL commands and could not be repaired to extended.
2051 The parser now more closely parses VMS commands and handles quoted
2052 commands and redirection. Command File mode has been improved, but can
2053 not fully support bs-nl syntax.
2055 VMS Unix shell simulation has been improved.
2057 * commands.c: vms_comma_separator is now a run-time setting.
2058 * function.c: vms_comma_separator is now a run-time setting.
2059 * function.c(func_basename_dir) now reports "[]" or "./" based on
2060 VMS crtl runtime setting.
2061 * job.c(start_job_command): VMS Handle empty commands propery.
2062 * main.c: Add VMS environment variables for run-time settings.
2063 * vms_legacy_behavior - Force older behavior.
2064 * vms_comma_separator - Commas or spaces for separators.
2065 * vms_unix_simulation - Enhanced Posix shell simulation features.
2066 * Detect if VMS CRTL is set to report Unix paths instead of VMS.
2067 * ':' and '>' are also MAP_DIRSEP on VMS.
2068 * makeint.h: Add VMS run-time option variables.
2069 * readme.vms: Update to current behavior.
2070 * variable.c(define_variable_in_set): Fix VMS Environment variable
2072 * variable.c(define_automatic_variables): Remove some VMS specific
2073 automatic variables and use the Unix ones instead.
2074 * vms_export_symbol.c: Set max symbol size correctly.
2075 * vmsjobs.c: child_execute_job() complete rewrite of VMS comand
2077 * vmsjobs.c(build_vms_cmd): VMS commmand building with shell simulation.
2079 2014-12-27 Christian Boos <cboos@edgewall.org> (tiny change)
2081 Fix $(shell) on hosts with 64-bit pid_t.
2082 * function.c: Use pid_t for shell_function_pid.
2085 2014-10-20 Paul Smith <psmith@gnu.org>
2087 * main.c (main): [SV 43434] Handle NULL returns from ttyname().
2089 2014-10-20 Benedikt Morbach <benedikt.morbach@googlemail.com> (tiny change)
2091 * tests/scripts/features/archives: [SV 43405] override AR variable.
2093 2014-10-20 John Malmberg <wb8tyw@qsl.net>
2095 Fix VMS implicit rules and UNIX paths.
2096 This fixes VMS implicit rules and UNIX style pathname handling.
2097 It also fixes some of the VMS style pathname handling, more work
2098 there will be needed later.
2099 TODO: There are other case insensitive platforms besides VMS.
2100 We need to find out why there is extra VMS code for this. This
2101 indicates either the extra VMS code is not needed, or the case
2102 insensitive support may not be complete on the other case
2103 insensitive platforms.
2105 * default.c: Add missing definitions to default_suffix_rules[] and
2106 default_variables[].
2107 TODO: As it is important that VMS DCL mode definitions must always
2108 be a superset of UNIX definitions, a better way of maintaining the
2109 VMS DCL mode definitions should be devised.
2110 * dir.c (downcase_inplace): Add a reentrant downcase() routine.
2111 Add future support for VMS 8.2+ _USE_STD_STAT macro which will
2112 disable a lot of VMS specific code from compiling.
2113 (dir_file_exists_p): vmsify filename only if directory name has VMS
2114 directory delimiters.
2115 (file_exists_p): Handle both VMS and UNIX directories.
2116 (file_impossible): Handle both VMS and Unix directories. Track
2117 whether a VMS format path is needed for the return value.
2118 * file.c (lookup_file): Check if vmsify is needed; handle UNIX paths.
2119 * implicit.c (pattern_search): Enable UNIX paths.
2120 * read.c (parse_file_seq): Enable UNIX paths.
2121 * remake.c (f_mtime): Fix gpath_search call for VMS paths.
2122 * rule.c (count_implicit_rule): Enable UNIX paths, Fix VMS paths.
2123 * vpath.c (selective_vpath_search): Enable UNIX paths.
2125 2014-10-20 John Malmberg <wb8tyw@qsl.net>
2127 Update README.VMS and move news to the NEWS file
2128 * NEWS: Merge in VMS history.
2129 * README.VMS: Remove VMS history, document current behavior and
2132 2014-10-20 John Malmberg <wb8tyw@qsl.net>
2134 [SV 41758]: Fix archive support for VMS.
2135 Upated to match change to run_make_tests and some future fixes to
2138 * arscan.c: Use ANSI compatible pragmas instead of VAX C extensions.
2139 * tests/scripts/features/archives: Fix tests to use VMS rules and
2140 answers when running on VMS and using DCL as a shell.
2141 * tests/scripts/features/vpath3: Fix epected answer on test when
2143 * tests/scripts/vms/library: (New) Test the VMS library rules that
2144 are not tested by existing tests.
2146 2014-10-20 John Malmberg <wb8tyw@qsl.net>
2148 [SV 42447]: VMS simulate exporting symbols
2149 This also includes fixing the most of the exit handling code for VMS.
2152 Previously about 94 Tests in 36 categories fail.
2153 Now about 45 tests in 22 categories fail.
2155 Because some tests do not properly clean up, the number of tests that
2156 fail can vary by one or two test cases between consecutive runs.
2158 * Makefile.am: Add new VMS files.
2159 * job.c: add prototype for vms_strsignal().
2160 * job.c: (child_error): Remove VMS specific code as no longer needed.
2161 * job.c: (reap_children): The VMS specific code was setting the
2162 status to 0 instead of setting it to the proper exit status.
2163 * job.h: Add vms_launch_status to struct child.
2164 * main.c: (main): Use environment variables for options to use MCR
2165 * instead of a foreign command, and to always use command files for
2167 For VMS use (set_program_name) routine which is common to ports of
2168 other GNU packages to VMS to set the program name used internally.
2169 Use (vms_putenv_symbol) to set up symbols to be visible in child
2170 programs, including recursive make launched by execve()
2171 Start of Bash shell detection code for VMS.
2172 * makefile.com: Need nested_include=none for building on VMS search
2173 lists. Add vms_progname, vms_exit, and vms_export_symbol.
2174 * makefile.vms: Need nested_include=none for building on VMS search
2175 lists. Add vms_progname, vms_exit, vms_export_symbol.
2176 * makeint.h: Make sure non-standard "VMS" macro is defined. Add
2177 prototypes for new VMS routines. Remove VMS-specific failure codes.
2178 * vmsjobs.c: Add VMS POSIX exit code constants.
2179 (_is_unixy_shell): Detect Bash shell.
2180 (vms_strsignal): simulate strsignal() on VMS.
2181 (vmsHandleChildTerm): fix to properly report failed LIB$SPAWN() exit
2182 status codes. Remove code that duplicated code in job.c.
2183 (child_execute_job): Export environment symbols before spawning a
2184 child and restore afterward unless option to use command files for
2185 subprocesses is set. Improve handling of UNIX null commands ":".
2186 * vms_exit.c: Provides vms_exit() to detect if an exit code is UNIX
2187 or VMS, and converts the UNIX code into a VMS exit code.
2188 * vms_export_symbol.c: Routines to create DCL symbols that work like
2189 shell aliases or exported shell symbols and clean them up on exit.
2190 * vms_export_symbol_test.com: Unit test for vms_export_symbol.c
2191 * vms_progname.c: New file: VMS specific replace for progname.c that
2192 is used in some GNU projects.
2194 2014-10-20 John Malmberg <wb8tyw@qsl.net>
2196 Set up for running tests on VMS.
2197 * run_make_tests.pl: set $port_type to be 'VMS-DCL' when the test are
2198 run from the VMS DCL Interpreter. When the tests are run from GNV
2199 on VMS, the $port_type will be 'UNIX'.
2200 * run_make_tests.com: VMS search list support. This is needed for
2201 using a search list such as prj_root = lcl_root:,vms_root:,src_root:
2202 for building and testing.
2204 2014-10-09 Paul Smith <psmith@gnu.org>
2206 * configure.ac, NEWS, README.git: Set up for the next release.
2208 2014-10-05 Paul Smith <psmith@gnu.org>
2210 GNU Make release 4.1.
2212 2014-10-02 Eli Zaretskii <eliz@gnu.org>
2214 Fix Cygwin compilation error.
2215 * job.c (construct_command_argv_internal) [HAVE_DOS_PATHS]: Fix
2216 initializer for sh_chars_sh.
2217 Reported by Denis Excoffier<cygwin@Denis-Excoffier.org>.
2219 2014-10-01 Gisle Vanem <gvanem@yahoo.no>
2223 * makeint.h (ftruncate): Define also for __WATCOMC__.
2225 2014-10-01 Eli Zaretskii <eliz@gnu.org>
2227 Avoid compilation warnings.
2228 * main.c (find_and_set_default_shell, main) [WINDOWS32]: Declare
2229 variables 'const char *' to avoid compiler warnings.
2230 * job.c (construct_command_argv_internal) [!NDEBUG]: Declare 'end'
2231 and set it only if NDEBUG is not defined, to avoid compiler
2234 Treat redirection of standard handles on Windows as it is done on Unix.
2235 * job.c (start_job_command) [WINDOWS32]: Compute outfd and errfd
2236 as on Posix platforms, and pass the results to process_easy.
2237 * function.c (windows32_openpipe) [WINDOWS32]: Accept an
2238 additional argument ERRFD and use it for redirecting the standard
2239 error handle passed to the subprocess.
2240 (func_shell_base) [WINDOWS32]: Pass the computed errfd to
2243 2014-09-30 Paul Smith <psmith@gnu.org>
2245 Update Copyright statements for 2014.
2247 * tests/scripts/features/load: Avoid unused variable warnings.
2249 * loadapi.c (gmk_eval): Use C90 syntax.
2251 2014-09-30 Hartmut Becker <becker.ismaning@freenet.de>
2253 * job.c: fix make action continuation lines.
2254 * vmsjobs.c: fix writing DCL command files when trimming (white
2255 spaces and $ signs) especially after a split (command continuation).
2257 2014-09-15 Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> (tiny change)
2259 * configure.ac: Fix spacing in helptext of customs
2261 2014-09-15 Eli Zaretskii <eliz@gnu.org>
2263 Support MAKE_TERMOUT and MAKE_TERMERR on MS-Windows.
2264 * w32/compat/posixfcn.c (isatty, ttyname): New functions.
2265 * config.h.W32.template (HAVE_TTYNAME): Define. Add a prototype
2268 2014-09-15 Paul Smith <psmith@gnu.org>
2270 * loadapi.c (gmk_eval): [SV 43221] Preserve var buff content for eval.
2272 * main.c, NEWS, doc/make.text: Rename MAKE_TTY* to MAKE_TERM*
2274 2014-09-14 Paul Smith <psmith@gnu.org>
2276 * main.c (main): Set MAKE_TTYOUT and MAKE_TTYERR.
2277 * configure.ac: Test for isatty() and ttyname()
2278 * makeint.h: provide a substitute for ttyname() if it's not available.
2279 * config.ami.template, config.h-vms.template, config.h.W32.template:
2280 define/undefine HAVE_ISATTY/HAVE_TTYNAME macros.
2281 * NEWS, doc/make.texi: Document these new variables.
2283 2014-09-07 Paul Smith <psmith@gnu.org>
2285 * tests/config-flags.pm.in, tests/scripts/features/archives: [SV 43046]
2286 Use the "ar" program detected by configure when running the test suite.
2288 * doc/make.texi: Clarify implicit rule lookup of phony targets
2289 Reported by Frank Heckenbach <f.heckenbach@fh-soft.de>
2291 2014-09-07 Hartmut Becker <becker.ismaning@freenet.de>
2293 Fix and enhance VMS library support.
2294 * ar.c: fix VMS library search for members, which do not have
2295 suffixes, aka filename extensions.
2296 * arscan.c: fix time conversion and library callback routines.
2297 * default.c: more suffixes and automatically create the VMS library
2298 if it doesn't exists.
2300 Enhance VMS exporting make environment variables.
2301 * config.h-vms.template: add feature macro USE_DCL_COM_FILE to always
2302 write a DCL command file, enabled by default.
2303 * vmsjobs.c: with USE_DCL_COM_FILE enabled write make variables as DCL
2304 symbol assignments into the command file. This enables printing
2305 directory and make level info for recursive use of make. This also
2306 enables forced DCL symbol substitution in the actions.
2308 Fix VMS automatic variable expansion
2309 * function.c: add VMS code to func_notdir_suffix and func_basename_dir
2310 to work on comma separated lists; this fixes the expansion of
2311 $(^D), $(+D) and the F variants for VMS.
2313 * main.c [VMS]: Say that parallel jobs (-j) are not supported on VMS
2315 Enhance/fix VMS ONESHELL implementation and command execution
2316 * job.c, vmsjobs.c: fix some double quote and new line handling;
2317 implement ONESHELL with writing multiple lines into one DCL command
2318 procedure; in ONESHELL allow VMS/make internal redirection only on the
2319 first line; fix the created DCL command procedure, which didn't abort
2320 on errors; return correct exit status from the DCL command procedure;
2321 preserve current procedure verification; make the generated command
2322 procedure more robust.
2324 Enhance/fix VMS setting of program name, MAKE/MAKE_COMMAND variables
2325 * default.c, main.c, makeint.h, vmsfunctions.c: prefix argv[0] with
2326 "mcr " for MAKE/MAKE_COMMAND and set the program name to the image
2327 filename (without the .exe;version)
2328 * vmsfunctions.c: remove obsolete code
2329 * vmsify: use xmalloc
2331 Enhance/fix VMS exit code handling.
2332 * commands.c, function.c, hash.c, job.c, main.c, output.c:
2333 use MAKE exit codes.
2334 * makeint.h: encode make exit codes so that they are VMS compatible.
2335 * job.c: check child exit code for VMS style exit codes.
2336 * vmsjobs.c: save and return VMS style exit code.
2338 Enhance/fix VMS multi-line support.
2339 * job.c: split the command line at a newline.
2340 * default.c, vmsjobs.c: change ECHO variable to a pseudo builtin,
2341 which ensures that the VMS/DCL ECHO ("write sys$output") is used
2342 and is correctly quoted.
2343 * vmsjobs.c: remove unused builtin 'rm'.
2345 * config_flags_pm.com, [RENAMED test_make.com] run_make_tests.com:
2346 Moved into tests directory.
2348 Enhance/fix VMS build environment
2349 * config.h-vms.template: make sure the CRTL version is known
2350 * makefile.com: always compile/link the guile module, remove VAXCRTL
2351 parameter, new LIST parameter
2352 * makefile.vms: always compile/link the guile module, use more
2353 complete dependencies
2354 * prepare_vms.com: helper to create a VMS config file when building
2355 from a snapshot of the repository
2357 2014-09-07 Paul Smith <psmith@gnu.org>
2359 * configure.ac, maintMakefile, w32/Makefile.am: Fix autotools issues.
2360 Reported by Paul Eggert <eggert@cs.ucla.edu>
2362 2014-08-30 Eli Zaretskii <eliz@gnu.org>
2364 Change the order of "makefile" and "Makefile" to match the manual.
2366 Fix regression with "makefile" not being found on MS-Windows.
2367 * read.c (read_all_makefiles) [WINDOWS32]: Recognize "makefile",
2368 all-lowercase, as a makefile. Reported by Michael Waeber
2371 2014-07-16 Eli Zaretskii <eliz@gnu.org>
2373 Fix compilation on MS-Windows.
2374 * makeint.h [WINDOWS32]: Don't declare 'program' as 'const char *',
2375 since it is modified in 'main'.
2377 2014-07-12 Eli Zaretskii <eliz@gnu.org>
2379 [SV 42695] Fix compilation error on MS-Windows.
2380 * main.c [WINDOWS32]: Don't declare 'program' as 'const char *',
2381 since it is modified in 'main'.
2383 2014-07-12 Jonny Grant <jg@jguk.org> (tiny change)
2385 Fix defalt_makefiles[] for MS-Windows.
2386 * read.c (read_all_makefiles) [WINDOWS32]: Remove the redundant
2387 "makefile" and add "makefile.mak".
2389 2014-07-07 Fredrik Fornwall <fredrik@fornwall.net> (tiny change)
2391 * arscan.c [ANDROID]: Android has no ar.h but supports archives.
2393 2014-07-07 Paul Smith <psmith@gnu.org>
2395 * read.c (eval): [SV 41677] Correct test for TAB vs. 8 spaces.
2397 2014-07-07 Piotr Jaroszynski <pjaroszynski@nvidia.com> (tiny change)
2399 * output.c (pump_from_tmp): [SV 42378] Flush the output file regularly.
2401 2014-07-07 John Malmberg <wb8tyw@qsl.net>
2403 Update the regression test harness to support VMS.
2404 * config_flags_pm.com, test_make.com: set up and run the regression
2405 test environment on VMS.
2406 * tests/run_make_tests.pl [VMS]: Use an alternate rmdir()
2407 implementation on VMS.
2408 (run_make_with_options) [VMS]: Provide VMS-specific quoting and shell
2410 (set_more_defaults) [VMS]: Set default values when running on VMS.
2411 * tests/test_driver.pl (vms_get_process_logicals) [VMS]: Retrieve the
2412 proper values from %ENV on VMS.
2413 (resetENV) [VMS]: Use it.
2414 (toplevel) [VMS]: Fix a bug with opendir() on some logical_devices.
2415 (compare_output) [VMS]: Convert VMS test output to a "standard" format.
2416 (_run_command) [VMS]: Handle signals and exit codes the VMS way.
2417 (remove_directory_tree_inner) [VMS]: Unlink all versions of the file.
2419 2014-07-07 Paul Smith <psmith@gnu.org>
2421 * various: Assume ISO C89-compliant free() implementation.
2423 * maintMakefile, various: Improve constification of the codebase.
2425 [SV 41983] Support omitting the text argument to $(file ...)
2426 Reported by Tim Murphy <tnmurphy@gmail.com>
2427 * function.c (func_file): Only write TEXT if it is not NULL.
2428 * NEWS, doc/make.texi: Document the new feature
2429 * tests/scripts/functions/file: Verify that the no-text version of
2430 $(file ...) works and doesn't add a newline.
2432 2014-05-13 Jacques Germishuys <jacques.germishuys@gmail.com>
2434 NMakefile.template ($(OUTDIR)/posixfcn.obj): Fix a typo.
2436 2014-05-01 Paul Smith <psmith@gnu.org>
2438 [SV 42249] Propagate correct rule status results.
2439 * remake.c (update_file, update_file_1, check_dep): Return an enum
2440 update_status value instead of an int, and keep the highest value we
2441 find as we walk the graph so that the ultimate status is correct.
2442 * tests/scripts/options/dash-q: Add a test for updating prerequisites.
2444 2014-02-08 Paul Smith <psmith@gnu.org>
2446 * Rename MAP_PATHSEP to MAP_DIRSEP.
2448 * configure.ac: Fixup for newer autoconf/automake
2450 2014-02-08 Ray Donnelly <mingw.android@gmail.com> (tiny change)
2452 * output.c: Ensure space for final nul byte in fmtbuf.
2454 2014-02-07 Gisle Vanem <gvanem@yahoo.no> (tiny change)
2456 Improve error reporting in the Windows port when env size is too large.
2457 w32/subproc/misc.c (arr2envblk): Compute and return the size of
2458 the environment passed to child process.
2460 w32/subproc/sub_proc.c (process_begin): If the call to
2461 CreateProcess failed with EINVAL, and the required environment
2462 size was larger than 32KB, assume it's a Windows XP limitation,
2463 and display an error message to that effect.
2465 w32/subproc/proc.h (arr2envblk): Update prototype.
2467 2014-02-01 Paul Smith <psmith@gnu.org>
2469 * job.c (set_child_handler_action_flags): [SV 41341]
2470 Ensure signal handler is in place before alarm(1).
2472 2014-01-20 Alan Hourihane <alanh@fairlite.co.uk> (tiny change)
2474 * configure.ac: [SV 40790] Fix load autoconf variables.
2476 2014-01-17 Pavel Fedin <p.fedin@samsung.com> (tiny change)
2478 Allow the EMX build to use output_sync.
2479 job.c (start_job_command): Move the child output diversion out
2481 [__EMX__]: Don't use fixed FD_STDOUT and FD_STDERR in the call to
2484 2014-01-12 Paul Smith <psmith@gnu.org>
2486 * commands.c: [SV 40789] Remove unneeded header dlfcn.h
2488 * main.c (die): Close output_context AND make_sync.
2489 die() can be invoked inside a separate output_context, if the
2490 $(error ...) function is expanded as part of a recipe.
2492 2014-01-11 Pavel Fedin <p.fedin@samsung.com> (tiny change)
2494 Fix .LIBPATTERNS for MS-Windows builds.
2495 default.c (.LIBPATTERNS) [__CYGWIN__ || WINDOWS32]: Provide
2496 library patterns for MS-Windows.
2498 2013-11-27 Paul Smith <psmith@gnu.org>
2500 * w32/*: Remove TABs from the source code.
2501 I know whitespace commits are annoying, but having these TABs is
2502 causing me to miss things when I search through the code. This
2503 doesn't try to change the w32 code to meet GNU coding standards.
2505 * main.c (decode_env_switches): Ensure we have enough space.
2506 Reported (with patch) by Gerte Hoogewerf <g.hoogewerf@gmail.com>
2508 2013-11-27 Stephan T. Lavavej <stl@nuwen.net> (tiny change)
2510 Solve some Windows build issues.
2511 * main.c (main): Use ONS(), not OSN().
2512 (prepare_mutex_handle_string) [WINDOWS32]: Use %Ix formatting to
2513 support both 32bit and 64bit systems.
2514 * job.c (free_child, new_job): Use ONS(), not OSN().
2515 * w32/subproc/w32err.c (map_windws32_error_to_string): Use O() when
2518 2013-11-24 Paul Smith <psmith@gnu.org>
2520 * features/loadapi (test_expand): Allocate memory for the nul byte.
2522 * load.c (load_file): Reset the name length minus the symbol.
2524 * read.c (unescape_char): Use memmove() for overlapping memory.
2526 Fix memory leak during environment option decoding.
2527 * main.c (decode_switches): Always make a copy of option arguments.
2528 (decode_env_switches): Use a stack buffer to convert environment
2529 switches for parsing.
2531 [SV 40226] Add a new type of switch: single-string options
2532 * main.c (struct command_switch): Change the "string" types to "strlist"
2533 and make "string" be a single-valued string instead.
2534 (output_sync_option, jobserver_fds, sync_mutex): Change to string type.
2535 (decode_output_sync_flags): Handle single strings instead of lists.
2536 (prepare_mutex_handle_string): Ditto.
2538 (clean_jobserver): Ditto.
2539 (init_switches): Handle the new type.
2540 (decode_switches): Ditto.
2541 (define_makeflags): Ditto.
2543 2013-11-23 Daniel Richard G <skunk@iskunk.org> (tiny change)
2545 * load.c: [SV 40515] Define RTLD_GLOBAL if not set.
2547 2013-11-23 Paul Smith <psmith@gnu.org>
2549 [SV 40361] Don't use vsnprintf(), which is an ISO C99 function.
2550 * output.c (error, fatal, message): Take an extra argument specifying
2551 how many bytes are used by the formatted arguments.
2552 (get_buffer): New function that allocates the requested buffer size.
2553 Remove msc_vsnprintf(), vfmtconcat(), and fmtconcat() as unneeded.
2554 * makeint.h: Declare various helper macros for generating output.
2555 * *.c: Change all error(), fatal(), message() calls to use the macros,
2556 or pass the extra length argument directly.
2558 2013-10-27 Paul Smith <psmith@gnu.org>
2560 * makeint.h (STOP_SET): [SV 40371] Cast to unsigned char.
2561 * tests/scripts/misc/utf8: Test variable names with characters >127.
2562 Fix suggested by Robert Bogomip <bob.bogo@milohedge.com>
2564 2013-10-24 Gerte Hoogewerf <g.hoogewerf@gmail.com>
2566 Fix MS Visual Studio NET2003 build.
2567 * make_msvc_net2003.vcproj: Do not exclude guile.c from compilation.
2569 2013-10-23 Christian Boos <cboos@edgewall.org>
2571 Fix SV bug #40227 with respect to stack size set for the MSVC build.
2572 * NMakefile.template (/STACK): Increase to 0x400000, mainly for
2573 the 64-bit builds. Fixes SV bug #40227.
2576 2013-10-23 Eli Zaretskii <eliz@gnu.org>
2578 Fix the MS-Windows build: now guile.c must always be compiled in.
2579 * build_w32.bat: Always compile guile.c and link against guile.o.
2580 Reported by Alexey Pavlov <alexpux@gmail.com>.
2582 * makeint.h (guile_gmake_setup): Define prototype unconditionally,
2583 to avoid compiler warnings.
2585 2013-10-22 Eli Zaretskii <eliz@gnu.org>
2587 Fix Savannah bug #31150 with failures due to setting window title.
2588 * sub_proc.c (process_begin): Don't set startInfo.lpTitle, it
2589 reportedly causes SV bug #31150, and according to MSDN it's a
2592 Fix Savannah bug 40241 with Unixy file names as commands to MSYS shell.
2593 * sub_proc.c: Include filedef.h and variable.h.
2594 (process_begin): If exec_path was not found, but its first
2595 character is '/', assume there's some shell magic, and invoke the
2596 command through '$(SHELL) -c "COMMAND"'. Fixes SV bug#40241.
2597 (make_command_line): Kludgey feature: if full_exec_path is "-c",
2598 assume that argv[0] is not to be skipped, as it holds the command
2599 string to be passed to the shell.
2601 2013-10-20 Paul Smith <psmith@gnu.org>
2603 * glob.c (glob) [SV 18123]: Cherry-pick glibc fix
2604 Apply commit a471e96a5352a5f0bde6d32dd36d33524811a2b1 from
2605 git://sourceware.org/git/glibc.git to fix
2606 https://sourceware.org/bugzilla/show_bug.cgi?id=10278
2608 * read.c (record_files): [SV 33034] Change fatal() to error()
2609 Allows deprecated syntax. However we don't guarantee this syntax
2610 will continue to be legal in the future.
2611 Change suggested by David Boyce <david.s.boyce@gmail.com>
2613 * README.git: Add some missing release steps.
2615 2013-10-19 Paul Smith <psmith@gnu.org>
2617 [SV 40240] Use configure info to build load test shared libs
2618 * tests/config-flags.pm.in: A new file containing variable assignments
2619 for the test suite; these variables are set by configure to contain
2620 the values detected there for compilers, flags, etc.
2621 * tests/run_make_tests.pl: Require the config-flags.pm file
2622 * tests/scripts/features/load, tests/scripts/features/loadapi: Use the
2623 configure-provided values when building the shared test library.
2624 * configure.ac: Replace tests/config-flags.pm.in
2625 * Makefile.am: Make sure tests/config-flags.pm is up to date
2627 * maintMakefile (checkcfg.%): Add testing of build.sh
2629 [SV 40254] Modify build.sh to work properly with Guile support.
2630 * guile.c (guile_gmake_setup) [HAVE_GUILE]: Define a stub function
2631 when Guile support is not enabled.
2632 * main.c (main) [HAVE_GUILE]: Always invoke guile_gmake_setup().
2633 * Makefile.am: Make guile.c standard, not optional.
2634 * build.template: Add the Guile compiler and linker flags.
2636 * maintMakefile: Accept variable overrides from the environment.
2638 * NEWS: Fix version so we can build a distfile.
2640 * read.c (eval): Avoid GCC warning to add braces.
2642 * GNUMAKEFLAGS: Remove -O so it passes in NO_OUTPUT_SYNC mode.
2644 2013-10-18 Christian Boos <cboos@edgewall.org>
2646 Fix initialization of stringlist variables for jobserver_fds and sync_mutex.
2649 main.c (prepare_mutex_handle_string, main): Initialize
2650 stringlist variables with at least 2 members, as one member is not
2651 currently supported.
2653 2013-10-18 Eli Zaretskii <eliz@gnu.org>
2655 Fix MinGW64 problem with non-compliant vsnprintf.
2656 makeint.h (__USE_MINGW_ANSI_STDIO) [__MINGW64_VERSION_MAJOR]:
2657 Define for MinGW64, to force it to use an ANSI-compliant
2658 implementation of vsnprintf. Reported by Christian Boos
2659 <cboos@edgewall.org>.
2661 Fix the MSVC build on MS-Windows.
2662 output.c (vsnprintf) [_MSC_VER]: Define, instead of defining
2663 snprintf, which isn't used. Reported by Christian Boos
2664 <cboos@edgewall.org>.
2665 NMakefile.template (OBJS): Add load.obj and posixfcn.obj.
2666 ($(OUTDIR)/pathstuff.obj): New dependency.
2667 Suggested by Christian Boos <cboos@edgewall.org>.
2669 2013-10-13 Paul Smith <psmith@gnu.org>
2671 [SV 40139] Modify "missing separator" for better translation
2673 Add support for updating the GNU make web pages.
2674 Add makefile rules for updating the http://www.gnu.org/software/make
2675 web pages, including the online GNU make manual.
2677 Convert to auto-generated ChangeLog files.
2678 Rename existing ChangeLog files so they won't be distributed.
2679 Add targets to maintMakefile to generate ChangeLog from the Git
2680 repository. This will require a version of gnulib be available.
2681 Because ChangeLog is auto-generated, we have to switch our
2682 automake mode to "foreign" or it will complain and fail.
2684 Set up for the next release.