]> git.ipfire.org Git - thirdparty/make.git/log
thirdparty/make.git
8 years ago* function.c (shell_completed): [SV 51014] Add signal to .SHELLSTATUS
Paul Smith [Mon, 5 Jun 2017 00:06:48 +0000 (20:06 -0400)] 
* function.c (shell_completed): [SV 51014] Add signal to .SHELLSTATUS

* tests/scripts/functions/shell: Verify that .SHELLSTATUS contains
a non-0 value when the shell exits due to a signal.

8 years agoAvoid crashes when SHELL=abcde is specified on the command line
Eli Zaretskii [Wed, 7 Jun 2017 05:32:35 +0000 (08:32 +0300)] 
Avoid crashes when SHELL=abcde is specified on the command line

* variable.c (do_variable_definition): If $SHELL was not found,
process "SHELL=foo" as any other variable definition.  This avoids
segfaults when SHELL=foo is specified on the Make command line.
Reported by Orgad Shaneh <orgads@gmail.com>.

8 years ago[SV 51159] Use a non-blocking read with pselect to avoid hangs.
Paul Smith [Sat, 3 Jun 2017 20:20:51 +0000 (16:20 -0400)] 
[SV 51159] Use a non-blocking read with pselect to avoid hangs.

* posixos.c (set_blocking): Set blocking on a file descriptor.
(jobserver_setup): Set non-blocking on the jobserver read side.
(jobserver_parse_auth): Ditto.
(jobserver_acquire_all): Set blocking to avoid a busy-wait loop.
(jobserver_acquire): If the non-blocking read() returns without
taking a token then try again.

8 years ago[SV 50823] Support filenames containing '$' in MAKEFILE_LIST
Paul Smith [Sun, 28 May 2017 04:33:29 +0000 (00:33 -0400)] 
[SV 50823] Support filenames containing '$' in MAKEFILE_LIST

* variable.h (enum variable_flavor: Add a new flavor for appended
values that shouldn't be expanded.
* variable.c (do_variable_definition): If given this new flavor,
do not expand the value before appending it.
* read.c (eval_makefile): Use this new flavor for MAKEFILE_LIST
* tests/scripts/variables/MFILE_LIST: Test filenames containing '$'.

8 years ago* tests/test_driver.pl: Useful error if given an invalid test name.
Paul Smith [Sun, 28 May 2017 04:32:26 +0000 (00:32 -0400)] 
* tests/test_driver.pl: Useful error if given an invalid test name.

8 years ago* NEWS: Do not insert a space during '+=' if the value is empty.
Paul Smith [Sun, 28 May 2017 00:07:30 +0000 (20:07 -0400)] 
* NEWS: Do not insert a space during '+=' if the value is empty.

* doc/make.texi (Appending): Document this behavior.
* variable.c (do_variable_definition): Only add a space if the variable
value is not empty.
* tests/scripts/variables/flavors: Test this behavior.

8 years ago* read.c (read_all_makefiles): [SV 50909] Add MAKEFILES to strcache
Enrique Olaizola [Sat, 27 May 2017 18:56:57 +0000 (14:56 -0400)] 
* read.c (read_all_makefiles): [SV 50909] Add MAKEFILES to strcache

Copyright-paperwork-exempt: yes

8 years ago* po/LINGUAS: Add support for traditional Chinese (zh_TW)
Paul Smith [Sat, 20 May 2017 14:35:51 +0000 (10:35 -0400)] 
* po/LINGUAS: Add support for traditional Chinese (zh_TW)

8 years agoRename output_tmpfile() to a misc function get_tmpfile()
Paul Smith [Sat, 11 Feb 2017 18:42:37 +0000 (13:42 -0500)] 
Rename output_tmpfile() to a misc function get_tmpfile()

* output.c: Remove output_tmpfile() and umask handling.
* output.h: Ditto.
* misc.c: Add get_tmpfile() and umask handling.
* makeint.h: Ditto.
* function.c: Rename output_tmpfile() to get_tmpfile().
* main.c: Ditto.
* vmsjobs.c: Ditto.

8 years ago[SV 13651] Handle out-of-memory conditions slightly more gracefully.
Paul Smith [Mon, 2 Jan 2017 20:46:30 +0000 (15:46 -0500)] 
[SV 13651] Handle out-of-memory conditions slightly more gracefully.

* makeint.h: Change OUT_OF_MEM() macro to out_of_memory() function.
* output.h, job.h: Move FD_* macros from job.h to output.h.
* output.c (output_write): Write a buffer to an FD directly.
(out_of_memory): Use output_write() to avoid allocating more
memory while writing the error, and call exit() instead of die().
This does mean we can't translate the error string, though.
* misc.c (xmalloc, xcalloc, xrealloc, xstrdup, xstrndup): Call new
out_of_memory() rather than OUT_OF_MEM().
* read.c (parse_file_seq): Ditto.

8 years agoClean up close-on-exec, particularly with jobserver pipes.
Paul Smith [Mon, 2 Jan 2017 19:08:54 +0000 (14:08 -0500)] 
Clean up close-on-exec, particularly with jobserver pipes.

* configure.ac: Check sys/file.h and assume fileno() always exists.
* output.h: Move output-specific content from job.h to output.h.
* os.h (fd_inherit, fd_noinherit): New functions manage FD inheritance.
* posixos.c (fd_inherit, fd_noinherit): Implement for POSIX systems.
(jobserver_setup): Force jobserver FDs to not be inherited by default.
(jobserver_pre_child): Enable inheritance in recursive invocations.
(jobserver_post_child): Disable inheritance after recursive invocations.
* w32/w32os.c (fd_inherit, fd_noinherit): Implement for W32 systems.
* job.h (CLOSE_ON_EXEC): Remove macro in deference to new fd_noinherit.
* function.c (func_shell_base): Convert CLOSE_ON_EXEC to fd_noinherit.
* job.c (child_execute_job): Ditto.
* output.c (setup_tmpfile): Ditto.
* read.c (eval_makefile): Ditto, plus remove HAVE_FILENO check.
* w32/include/sub_proc.h: Remove process_noinherit for fd_noinherit.
* w32/subproc/sub_proc.c: Ditto.

8 years ago[SV 50300] Use CFLAGS value of "-O1" in POSIX mode.
Paul Smith [Sun, 16 Apr 2017 19:40:57 +0000 (15:40 -0400)] 
[SV 50300] Use CFLAGS value of "-O1" in POSIX mode.

* read.c (record_files): Use "-O1" not "-O" for CFLAGS and FFLAGS.
* tests/scripts/targets/POSIX: Test for the new value.

8 years ago* configure.ac: [SV 50648] Detect Guile 2.2 packages.
Paul Smith [Sun, 16 Apr 2017 19:03:48 +0000 (15:03 -0400)] 
* configure.ac: [SV 50648] Detect Guile 2.2 packages.

8 years ago* doc/make.texi: [SV 50304] Add missing close parenthesis.
Paul Smith [Sun, 16 Apr 2017 18:22:44 +0000 (14:22 -0400)] 
* doc/make.texi: [SV 50304] Add missing close parenthesis.

8 years agoAdd test suite support to Windows
Paul Smith [Mon, 17 Apr 2017 19:37:57 +0000 (15:37 -0400)] 
Add test suite support to Windows

* main.c (main): Sanitize program name detection on Windows.
* makeint.h: 'program' is a const string on all platforms now.
* tests/run_make_tests.bat: Windows bat file to invoke tests
* tests/test_driver.pl: Obtain system-specific error messages.
(get_osname): Compute the $port_type here.  Add more $osname checks
for different Windows Perl ports.
(_run_command): Rewrite the timeout capability to work properly
with Windows.  Don't use Perl fork/exec; instead use system(1,...)
which allows a more reliable/proper kill operation.
Also, allow options to be given as a list instead of a string, to
allow more complex quoting of command-line arguments.
* tests/run_make_tests.pl (run_make_with_options): Allow options
to be provided as a list in addition to a simple string.
(set_more_defaults): Write sample makefiles and run make on them
instead of trying to run echo and invoking make with -f-, to avoid
relying on shell and echo to get basic configuration values.  Also
create a $sh_name variable instead of hard-coding /bin/sh.
* tests/scripts/features/archives: Skip on Windows.
* tests/scripts/features/escape: Use list method for passing options.
* tests/scripts/features/include: Use system-specific error messages.
* tests/scripts/features/output-sync: "Command not found" errors
generate very different / odd output on Windows.  This needs to be
addressed but for now disable these tests on Windows.
* tests/scripts/functions/abspath: Disable on Windows.
* tests/scripts/functions/file: Use system-specific error messages.
* tests/scripts/functions/shell: "Command not found" errors generate
very different / odd output on Windows.  This needs to be addressed
but for now disable these tests on Windows.
* tests/scripts/misc/close_stdout: Disable on Windows.
* tests/scripts/options/dash-k: Use system-specific error messages.
* tests/scripts/options/dash-l: Disable on Windows.
* tests/scripts/options/eval: Use list method for passing options.
* tests/scripts/options/general: Skip some non-portable tests.
* tests/scripts/targets/ONESHELL: Skip some non-portable tests.
* tests/scripts/targets/POSIX: Skip some non-portable tests.
* tests/scripts/variables/MAKEFILES: Skip some non-portable tests.
* tests/scripts/variables/SHELL: Use a makefile not -f- for testing.

8 years ago* tests/run_make_tests.pl: [SV 50902] Find Perl modules
Enrique Olaizola [Sat, 27 May 2017 18:24:33 +0000 (14:24 -0400)] 
* tests/run_make_tests.pl: [SV 50902] Find Perl modules

8 years ago[SV 50021] Avoid infloop on MS-Windows with short scripts
Eli Zaretskii [Wed, 11 Jan 2017 18:43:41 +0000 (20:43 +0200)] 
[SV 50021] Avoid infloop on MS-Windows with short scripts

* job.c (reap_children) [WINDOWS32]: Avoid recursive call to
reap_children when the argument passed to
map_windows32_error_to_string is negative or too large.

8 years ago* main.c (switches): Add -E as an alias for --eval.
Paul Smith [Wed, 28 Dec 2016 05:41:38 +0000 (00:41 -0500)] 
* main.c (switches): Add -E as an alias for --eval.

* make.1: Document the -E and --eval options.
* doc/make.texi: Document the -E option.
* tests/scripts/options/eval: Test the -E option and MAKEFILES.
* NEWS: Add information about the new option.

8 years ago* main.c (switches): Add --no-silent to undo -s options.
Paul Smith [Wed, 28 Dec 2016 05:23:55 +0000 (00:23 -0500)] 
* main.c (switches): Add --no-silent to undo -s options.

* make.1: Document the new flag.
* doc/make.texi: Document the new flag.  Remove suggestions that the
.SILENT special target is deprecated or should not be used.
* tests/scripts/options/dash-s: Test the -s and --no-silent options.
* NEWS: Add information about the new option.

8 years ago* job.c (child_execute_job): [SV 49938] Avoid spurious GCC warning.
Martin Dorey [Mon, 26 Dec 2016 19:09:38 +0000 (14:09 -0500)] 
* job.c (child_execute_job): [SV 49938] Avoid spurious GCC warning.

8 years ago* main.c (main): [SV 49935] Fix uninitialized variable.
Martin Dorey [Mon, 26 Dec 2016 18:26:44 +0000 (13:26 -0500)] 
* main.c (main): [SV 49935] Fix uninitialized variable.

8 years ago[SV 40236] Handle included file open failures properly.
Paul Smith [Sun, 25 Dec 2016 22:41:50 +0000 (17:41 -0500)] 
[SV 40236] Handle included file open failures properly.

* read.c (eval_makefile): Set deps->error if we discovered any
error reading makefiles, and set NONEXISTENT_MTIME so we know
it needs to be rebuilt.
* main.c (main): Clean up management of makefile_mtimes.
* tests/scripts/features/include: Add open failure testcases.

8 years agoPortability changes for the test suite.
Paul Smith [Fri, 23 Dec 2016 18:33:58 +0000 (13:33 -0500)] 
Portability changes for the test suite.

* tests/test_driver.pl: Save error strings for later comparison.
* tests/run_make_tests.pl: Create portable commands for later use.
* tests/*: Use these new variables.

8 years ago[SV 20513] Un-escaped # are not comments in function invocations
Paul Smith [Thu, 22 Dec 2016 23:47:26 +0000 (18:47 -0500)] 
[SV 20513] Un-escaped # are not comments in function invocations

* NEWS: Document the change, as a backward-incompatible change.
* main.c (main): Add 'nocomment' to the .FEATURES variable.
* read.c (remove_comments): Skip variable references during remove.
(find_char_unquote): Fix comments for new STOPMAP support.
* tests/scripts/features/escape: Test new escape syntax.
* tests/scripts/functions/guile: Ditto.
* tests/scripts/functions/shell: Ditto.

8 years ago* main.c (main): [SV 40234] Show correct error message.
Paul Smith [Thu, 22 Dec 2016 21:35:47 +0000 (16:35 -0500)] 
* main.c (main): [SV 40234] Show correct error message.

8 years ago* main.c (switches): [SV 48809] Accept obsolete jobserver flag.
Christoph Schulz [Sun, 18 Dec 2016 18:54:35 +0000 (13:54 -0500)] 
* main.c (switches): [SV 48809] Accept obsolete jobserver flag.

8 years ago* read.c (get_next_mword): [SV 49865] Make fallthrough explicit.
Paul Smith [Sun, 18 Dec 2016 18:49:14 +0000 (13:49 -0500)] 
* read.c (get_next_mword): [SV 49865] Make fallthrough explicit.

8 years ago[SV 49114] Remove support for the NO_FLOAT compile flag.
Paul Smith [Sun, 18 Dec 2016 17:43:18 +0000 (12:43 -0500)] 
[SV 49114] Remove support for the NO_FLOAT compile flag.

* makeint.h (max_load_average): Always a double.
* main.c (max_load_average, default_load_average): Always doubles.
(switches): -l option is a "floating" format.
(decode_switches, define_makeflags): Support "floating" format.
* remake.c (f_mtime): Show time skew as double.
* rule.c (print_rule_data_base): Show percentages as double.
* Makefile.ami, README.DOS.template, SMakefile.template: Remove
references to NO_FLOAT.
* SCOPTIONS, glob/SCOPTIONS: Remove NO_FLOAT settings.

8 years ago[SV 45477] [SV 49115] Parse DOS/Windows drivespecs correctly.
Paul Smith [Sun, 18 Dec 2016 17:25:24 +0000 (12:25 -0500)] 
[SV 45477] [SV 49115] Parse DOS/Windows drivespecs correctly.

* read.c (parse_file_seq) [WINDOWS32]: Only consider a colon part of
a path if it's in a valid Windows drivespec.

8 years ago[SV 49116] Check potential null pointer dereference.
Paul Smith [Sun, 18 Dec 2016 15:22:43 +0000 (10:22 -0500)] 
[SV 49116] Check potential null pointer dereference.

* w32/subproc/sub_proc.c (make_command_line): Simplify cygwin shell
check for correctness.

8 years ago* expand.c (variable_append): [SV 49113] Possible null ptr deref
Jaak Ristioja [Sun, 18 Dec 2016 14:48:46 +0000 (09:48 -0500)] 
* expand.c (variable_append): [SV 49113] Possible null ptr deref

8 years ago* w32/*/dirent.*: [SV 49111] Remove unused telldir()
Jaak Ristioja [Sun, 18 Dec 2016 14:45:47 +0000 (09:45 -0500)] 
* w32/*/dirent.*: [SV 49111] Remove unused telldir()

8 years agoAdd more GCC warnings to the maintainer build.
Paul Smith [Sun, 18 Dec 2016 02:50:50 +0000 (21:50 -0500)] 
Add more GCC warnings to the maintainer build.

* arscan.c: [SV 49112] Correct TEST printf() formatting.
Recommended by Jaak Ristioja <jaak@ristioja.ee>
* hash.c: Correct fprintf() formatting.
* maintMakefile: Add extra GCC warning flags.

8 years ago* po/Makevars, makeint.h, debug.h: Add xgettext C format flags.
Paul Smith [Sat, 17 Dec 2016 18:16:22 +0000 (13:16 -0500)] 
* po/Makevars, makeint.h, debug.h: Add xgettext C format flags.

8 years ago* po/LINGUAS: Added Serbian translation.
Paul Smith [Sat, 17 Dec 2016 14:12:00 +0000 (09:12 -0500)] 
* po/LINGUAS: Added Serbian translation.

8 years ago* README.template: Clarify some items in the README
Paul Smith [Wed, 14 Dec 2016 22:24:43 +0000 (17:24 -0500)] 
* README.template: Clarify some items in the README

8 years ago* doc/make.texi: [SV 48951] Fix documentation typo.
Paul Smith [Wed, 14 Dec 2016 22:23:09 +0000 (17:23 -0500)] 
* doc/make.texi: [SV 48951] Fix documentation typo.

8 years ago* maintMakefile: Update default GPG ID for new key.
Paul Smith [Sun, 23 Oct 2016 20:34:55 +0000 (16:34 -0400)] 
* maintMakefile: Update default GPG ID for new key.

8 years agoResolve issues discovered by static code analysis.
Paul Smith [Sun, 25 Sep 2016 23:06:56 +0000 (19:06 -0400)] 
Resolve issues discovered by static code analysis.

* maintMakefile: Add a rule to submit code for analysis.
* configure.ac: Check for availability of the umask() function.
* output.c (output_tmpfd, output_tmpfile): Use umask on temp files.
* makeint.h (PATH_VAR): Reserve an extra character for nul bytes.
* function.c (func_error): Initialize buffer to empty string.
* job.c (child_execute_job): Verify validity of fdin.
* main.c (main): Simplify code for makefile updating algorithm.
* arscan.c (ar_scan): Verify member name length before reading.
* read.c (readline): Cast pointer arithmetic to avoid warnings.
* remake.c (update_file): Remove unreachable code.
(name_mtime): Verify symlink name length.

8 years ago* NEWS: Mention the extended support for -jN on MS-Windows.
Eli Zaretskii [Sat, 12 Nov 2016 09:03:14 +0000 (11:03 +0200)] 
* NEWS: Mention the extended support for -jN on MS-Windows.

8 years agoSupport more than 63 jobs on MS-Windows
Marc Ullman [Sat, 12 Nov 2016 08:53:28 +0000 (10:53 +0200)] 
Support more than 63 jobs on MS-Windows

* job.c (start_waiting_job, load_too_high):
* w32/w32os.c (jobserver_setup, jobserver_acquire): Abstracted out
MAXIMUM_WAIT_OBJECTS.  Call process_table_full instead.
* w32/include/sub_proc.h: Update and add prototypes.
* w32/subproc/sub_proc.c (GMAKE_MAXIMUM_WAIT_OBJECTS): New macro.
(process_wait_for_multiple_objects): Drop-in replacement for Windows
API WaitForMultipleOjects.
(process_wait_for_any_private): Replaced MAXIMUM_WAIT_OBJECTS with
GMAKE_MAXIMUM_WAIT_OBJECTS.
(process_table_full): Replacement for process_used_slots.
(process_used_slots): Removed, as no longer needed.
(process_table_usable_size): Returns maximum usable size of process
table.
(process_table_actual_size): Returns actual size of process table.
(process_register): Added assertion.
(process_easy): Abstracted out MAXIMUM_WAIT_OBJECTS.

8 years agoOnly include strings.h in MinGW builds
Eli Zaretskii [Sun, 9 Oct 2016 13:09:52 +0000 (16:09 +0300)] 
Only include strings.h in MinGW builds

* main.c:
* job.c: Include strings.h only if HAVE_STRINGS_H is defined.

* config.h.W32.template (HAVE_STRINGS_H): Define only for MinGW,
as MSVC doesn't have this header.

8 years agoUpdate the Guile version tested with the MS-Windows build.
Eli Zaretskii [Thu, 6 Oct 2016 19:41:47 +0000 (22:41 +0300)] 
Update the Guile version tested with the MS-Windows build.

8 years agoAvoid compiler warnings with MinGW runtime 3.22.2
Eli Zaretskii [Thu, 6 Oct 2016 19:39:14 +0000 (22:39 +0300)] 
Avoid compiler warnings with MinGW runtime 3.22.2

* main.c:
* job.c: Include strings.h, to get the prototypes of strcasecmp
and strncasecmp with latest MinGW runtime versions.
* config.h.W32.template (HAVE_STRINGS_H): Define.

9 years ago* README.W32.template: Update the build documentation.
Paul Smith [Sun, 19 Jun 2016 14:52:17 +0000 (10:52 -0400)] 
* README.W32.template: Update the build documentation.

* build_w32.bat: Fix issues with Visual Studio builds.  Fix an error
that always created Debug builds.  Support 32bit and 64bit builds.

9 years ago* Update to pre-release version 4.2.90.
Paul Smith [Sat, 25 Jun 2016 00:49:32 +0000 (20:49 -0400)] 
* Update to pre-release version 4.2.90.

9 years agoGNU Make release 4.2.1. 4.2.1
Paul Smith [Mon, 6 Jun 2016 12:32:45 +0000 (08:32 -0400)] 
GNU Make release 4.2.1.

9 years ago* maintMakefile: TP recommends rsync for retrieving PO files.
Paul Smith [Mon, 6 Jun 2016 12:32:00 +0000 (08:32 -0400)] 
* maintMakefile: TP recommends rsync for retrieving PO files.

9 years ago* main.c (main): [SV 48009] Reset stack limit for make re-exec.
Jeremy Devenport [Tue, 31 May 2016 07:09:24 +0000 (03:09 -0400)] 
* main.c (main): [SV 48009] Reset stack limit for make re-exec.

Copyright-paperwork-exempt: yes

9 years ago[SV 47995] Ensure forced double-colon rules work with -j.
Paul Smith [Tue, 31 May 2016 06:56:51 +0000 (02:56 -0400)] 
[SV 47995] Ensure forced double-colon rules work with -j.

The fix for SV 44742 had a side-effect that some double-colon targets
were skipped.  This happens because the "considered" facility assumed
that all targets would be visited on each walk through the dependency
graph: we used a bit for considered and toggled it on each pass; if
we didn't walk the entire graph on every pass the bit would get out
of sync.  The new behavior after SV 44742 might return early without
walking the entire graph.  To fix this I changed the considered value
to an integer which is monotonically increasing: it is then never
possible to incorrectly determine that a previous pass through the
graph already considered the current target.

* filedef.h (struct file): make CONSIDERED an unsigned int.
* main.c (main): No longer need to reset CONSIDERED.
* remake.c (update_goal_chain): increment CONSIDERED rather than
inverting it between 0<->1.
(update_file_1): Reset CONSIDERED to 0 so it's re-considered.
(check_dep): Ditto.
* tests/scripts/features/double_colon: Add a regression test.

9 years ago* DELETE_ON_ERROR: [SV 48061] Use "exit 1" for portability.
Paul Smith [Tue, 31 May 2016 06:26:26 +0000 (02:26 -0400)] 
* DELETE_ON_ERROR: [SV 48061] Use "exit 1" for portability.

Reported by Joel Fredrikson <Joel.Fredrikson@it.uu.se>

9 years ago* w32/pathstuff.c: [SV 47996] Use ISBLANK() not isblank().
Paul Smith [Wed, 25 May 2016 21:25:25 +0000 (17:25 -0400)] 
* w32/pathstuff.c: [SV 47996] Use ISBLANK() not isblank().

9 years agoFix printing time stamps on MS-Windows
Eli Zaretskii [Sat, 28 May 2016 09:53:02 +0000 (12:53 +0300)] 
Fix printing time stamps on MS-Windows

* dir.c (print_dir_data_base) [WINDOWS32]: Use %I64u format for
printing unsigned 64-bit data types, as %ull is not universally
supported.

9 years ago[SV 48037] Fix MinGW build with Posix configury tools
Luke Allardyce [Fri, 27 May 2016 19:39:55 +0000 (22:39 +0300)] 
[SV 48037] Fix MinGW build with Posix configury tools

* w32/Makefile.am (libw32_a_CPPFLAGS): Add -I$(srcdir)/glob.

Copyright-paperwork-exempt: yes

9 years agoGNU Make release 4.2. 4.2
Paul Smith [Sat, 21 May 2016 19:23:54 +0000 (15:23 -0400)] 
GNU Make release 4.2.

9 years ago[SV 44742] Fix double-colon rules plus parallel builds.
Joe Crayne [Sat, 21 May 2016 21:26:00 +0000 (17:26 -0400)] 
[SV 44742] Fix double-colon rules plus parallel builds.

* remake.c (update_file): Don't update double-colon target status
if we're still building targets.
(ftime_t): Don't propagate timestamps for double-colon targets that
we've not examined yet.
* tests/scripts/features/double_colon: Add parallel build tests.

Copyright-paperwork-exempt: yes

9 years ago* read.c (eval): [SV 47960] Skip record waiting files when ignoring.
Paul Smith [Sat, 21 May 2016 17:08:34 +0000 (13:08 -0400)] 
* read.c (eval): [SV 47960] Skip record waiting files when ignoring.

* tests/scripts/features/conditionals: Test this scenario.

9 years agoSeparate the GNU make load ABI from internal types.
Paul Smith [Sun, 1 May 2016 23:24:20 +0000 (19:24 -0400)] 
Separate the GNU make load ABI from internal types.

Create an internal type "floc" and convert all users to that type.
* gnumake.h (gmk_floc): Remove the offset field from this type.
* loadapi.c (gmk_eval): Convert gmk_floc to internal floc.

9 years agoFixes for enhanced GCC warnings.
Paul Eggert [Sun, 1 May 2016 19:52:58 +0000 (15:52 -0400)] 
Fixes for enhanced GCC warnings.

Move function prototypes into header files and out of .c files.
Use void argument lists for functions that accept no args.
Remove unused macros.  Make private functions static.  Align
types with printf format characters.

9 years agoFix compile issues with Windows and VMS.
Paul Smith [Sun, 1 May 2016 19:34:42 +0000 (15:34 -0400)] 
Fix compile issues with Windows and VMS.

* main.c (initialize_stopchar_map): isblank() is not part of C89.
Install bits for space and tab directly.
* makeint.h: Don't define vfork; autoconf handles this for us.
* vmsjobs.c: Rename NEXT_TOKEN to V_NEXT_TOKEN to avoid conflicts.
* dir.c (print_dir_data_base): Visual Studio C doesn't have int64_t.
* w32/subproc/sub_proc.c (process_begin): Missing arg to memset().
* build_w32.bat: Don't use obsolete Visual Studio flags.

9 years agoAllow compiling with an ISO C 1989/1990 compiler.
Paul Smith [Sun, 24 Apr 2016 15:27:57 +0000 (11:27 -0400)] 
Allow compiling with an ISO C 1989/1990 compiler.

* posixos.c (jobserver_post_child): Use C89 for loop syntax.
* remake.c (update_goal_chain): Ditto.
* variable.c (parse_variable_definition): Ditto.

9 years ago[SV 47942] Avoid random crashes in subordinate programs on MS-Windows
Eli Zaretskii [Tue, 17 May 2016 15:15:26 +0000 (18:15 +0300)] 
[SV 47942] Avoid random crashes in subordinate programs on MS-Windows

* w32/subproc/sub_proc.c (process_begin): Zero out startInfo
before using it.  Fixes crashes in Intel Fortran compiler invoked
by Make.

9 years agoFix the MS-Windows MinGW build
Eli Zaretskii [Sun, 24 Apr 2016 06:53:38 +0000 (09:53 +0300)] 
Fix the MS-Windows MinGW build

* build_w32.bat (GccCompile): Use -std=gnu99, as some code uses
C99 features ('for' loop initial declarations).

* dir.c (print_dir_data_base) [WINDOWS32]: Cast 'mtime' to
'int64_t', and use %I64d to print it, to avoid compile-time
warning about printing a 'time_t' value, which could be either
a 32-bit or a 64 bit integral type.

9 years ago* tests/scripts/features/output-sync: increase test timeout. 4.1.90
Paul Smith [Sat, 23 Apr 2016 15:21:36 +0000 (11:21 -0400)] 
* tests/scripts/features/output-sync: increase test timeout.

I'm getting random failures with a timeout of 10s; increase to 30s.

9 years ago* NEWS: Update for pre-release
Paul Smith [Mon, 11 Apr 2016 11:50:11 +0000 (07:50 -0400)] 
* NEWS: Update for pre-release

9 years ago* dep.h, makeint.h (show_goal_error): Move to makeint.h.
Paul Smith [Sun, 10 Apr 2016 21:22:57 +0000 (17:22 -0400)] 
* dep.h, makeint.h (show_goal_error): Move to makeint.h.

9 years ago[SV 46433] Show recipe line offsets in line number messages.
Paul Smith [Sun, 10 Apr 2016 21:12:48 +0000 (17:12 -0400)] 
[SV 46433] Show recipe line offsets in line number messages.

While displaying line numbers, show the relevant line number inside
the recipe not just the first line of the entire recipe.
Sample changes suggested by Brian Vandenberg <phantall@gmail.com>

* gnumake.h (gmk_floc): Add an 'offset' to track the recipe offset.
* read.c (eval, eval_makefile, eval_buffer): Initialize 'offset'.
(record_files, install_pattern_rule): Ditto.
* job.c (new_job, job_next_command): Update 'offset' based on the
line of the recipe we're expanding or invoking.
(child_error): Add 'offset' when showing the line number.
* function.c (func_shell_base): Ditto.
* output.c (error, fatal): Ditto.
* NEWS: Mention the new ability.
* tests/scripts/features/errors: Check the line number on errors.
* tests/scripts/functions/warning: Check the line number on warnings.
* tests/scripts/features/output-sync,
tests/scripts/features/parallelism, tests/scripts/functions/shell,
tests/scripts/functions/error: Update line numbers.

9 years ago* maintMakefile: Add a rule for storing preprocessor output.
Paul Smith [Sun, 10 Apr 2016 00:06:06 +0000 (20:06 -0400)] 
* maintMakefile: Add a rule for storing preprocessor output.

9 years ago[SV 102] Don't show unnecessary include file errors.
Paul Smith [Sat, 9 Apr 2016 23:49:27 +0000 (19:49 -0400)] 
[SV 102] Don't show unnecessary include file errors.

Delay the generation of error messages for included files until we
are sure that we can't rebuild that included file.
* dep.h (struct dep): Don't reuse "changed"; make a separate field
to keep "flags".  Get rid of dontcare and use the flag.
(struct goaldep): Create a new structure for goal prereqs
that tracks an errno value and the floc where the include happened.
Rework the structures to ensure they are supersets as expected.
In maintainer mode with GCC, use inline to get type checking.
* read.c (eval_makefile): Return a struct goaldep for the new
makefile.  Ensure errno is set properly to denote a failure.
(read_all_makefiles): Switch to goaldep and check errno.
(eval): Don't show included file errors; instead remember them.
* remake.c (update_goal_chain): Set global variables to the current
goaldep we're building, and the entire chain.
(show_goal_error): Check if the current failure is a consequence
of building an included makefile and if so print an error.
(complain): Call show_goal_error() on rule failure.
* job.c (child_error): Call show_goal_error() on child error.
* main.c (main): Switch from struct dep to goaldep.
* misc.c (free_dep_chain): Not used; make into a macro.
* tests/scripts/features/include: Update and include new tests.
* tests/scripts/options/dash-B, tests/scripts/options/dash-W,
tests/scripts/options/print-directory,
tests/scripts/variables/MAKE_RESTARTS: Update known-good-output.

9 years ago* job.c (child_error): Add filename length to output length.
Paul Smith [Sat, 9 Apr 2016 13:25:50 +0000 (09:25 -0400)] 
* job.c (child_error): Add filename length to output length.

Reported by Dale Stimson <dale@riyescott.com>

9 years agoPreserve the real value of -jN in MAKEFLAGS using jobserver.
Paul Smith [Mon, 4 Apr 2016 05:23:04 +0000 (01:23 -0400)] 
Preserve the real value of -jN in MAKEFLAGS using jobserver.

Previously if the jobserver was active, MAKEFLAGS would contain only
the -j option but not the number (not -j5 or whatever) so users
could not discover that value.  Allow that value to be provided in
MAKEFLAGS without error but still give warnings if -jN is provided
on the command line if the jobserver is already activated.

* NEWS: Discuss the new behavior.
* os.h, posixos.c, w32/w32os.c: Return success/failure from
jobserver_setup() and jobserver_parse_auth().
* main.c (main): Separate the command line storage of job slots (now
in arg_job_slots) from the control storage (in job_slots).  Make a
distinction between -jN flags read from MAKEFLAGS and those seen
on the command line: for the latter if the jobserver is enabled then
warn and disable it, as before.
* tests/scripts/features/jobserver: Add new testing.

9 years ago* tests/run_make_tests.pl: Add file/lineno info to .run file.
Paul Smith [Mon, 4 Apr 2016 05:16:13 +0000 (01:16 -0400)] 
* tests/run_make_tests.pl: Add file/lineno info to .run file.

9 years ago* maintMakefile: Fix logging of check-alt-config target.
Paul Smith [Mon, 4 Apr 2016 05:15:17 +0000 (01:15 -0400)] 
* maintMakefile: Fix logging of check-alt-config target.

9 years ago* job.c (child_execute_job): Fix $(shell...) under NO_OUTPUT_SYNC.
Paul Smith [Mon, 4 Apr 2016 05:13:43 +0000 (01:13 -0400)] 
* job.c (child_execute_job): Fix $(shell...) under NO_OUTPUT_SYNC.

* main.c (decode_output_sync_flags): Use NONE for NO_OUTPUT_SYNC.

9 years ago* main.c (main): Restrict disabling debugging for MAKEFILES.
Paul Smith [Sun, 3 Apr 2016 20:54:04 +0000 (16:54 -0400)] 
* main.c (main): Restrict disabling debugging for MAKEFILES.

9 years ago* Makefile.am, w32/Makefile.am: Fix *os.c for Windows builds.
Paul Smith [Sat, 2 Apr 2016 21:18:40 +0000 (17:18 -0400)] 
* Makefile.am, w32/Makefile.am: Fix *os.c for Windows builds.

Original change provided by Luke Allardyce <lukeallardyce@gmail.com>

9 years ago* make.texi: Confirm that CURDIR contains an absolute path.
Paul Smith [Sat, 2 Apr 2016 21:18:14 +0000 (17:18 -0400)] 
* make.texi: Confirm that CURDIR contains an absolute path.

9 years ago* docs/make.texi: [SV 47392] Add "Integrating make" chapter.
Paul Smith [Sat, 2 Apr 2016 20:33:41 +0000 (16:33 -0400)] 
* docs/make.texi: [SV 47392] Add "Integrating make" chapter.

9 years agoChange --jobserver-fds to more generic --jobserver-auth.
Paul Smith [Sat, 2 Apr 2016 20:29:48 +0000 (16:29 -0400)] 
Change --jobserver-fds to more generic --jobserver-auth.

* NEWS: Mention the change.
* main.c: Rename jobserver_fds variable to jobserver_auth and
--jobserver-fds option to --jobserver-auth.
* os.h, posixos.c, w32/w32os.c: Rename jobserver_parse_arg() and
jobserver_get_arg() to jobserver_parse_auth()/jobserver_get_auth().

9 years ago* tests/run_make_tests.pl: Preserve $make_command
Paul Smith [Wed, 23 Mar 2016 05:26:55 +0000 (01:26 -0400)] 
* tests/run_make_tests.pl: Preserve $make_command

* tests/scripts/options/dash-n: Use $make_command.  This fixes
a spurious failure when running tests with valgrind enabled.

9 years ago* variable.c: Clean up some memory leaks.
Paul Smith [Wed, 23 Mar 2016 05:26:04 +0000 (01:26 -0400)] 
* variable.c: Clean up some memory leaks.

9 years ago[SV 46995] Strip leading/trailing space from variable names
Paul Smith [Mon, 21 Mar 2016 04:36:55 +0000 (00:36 -0400)] 
[SV 46995] Strip leading/trailing space from variable names

* makeint.h: Change MAP_SPACE to MAP_NEWLINE, and add MAP_PATHSEP
and MAP_SPACE which is now MAP_BLANK|MAP_NEWLINE.  Create
NEW_TOKEN(), END_OF_TOKEN(), ISBLANK(), ISSPACE() macros.
* main.c (initialize_stopchar_map): Set MAP_NEWLINE only for
newline characters.
* Convert all uses of isblank() and isspace() to macros.
* Examine all uses of isblank() (doesn't accept newlines) and
change them wherever possible to ISSPACE() (does accept newlines).
* function.c (func_foreach): Strip leading/trailing space.
* variable.c (parse_variable_definition): Clean up.
* tests/scripts/functions/foreach: Test settings and errors.
* tests/scripts/functions/call: Rewrite to new-style.
* tests/scripts/misc/bs-nl: Add many more tests for newlines.

9 years ago* function.c (func_file): Support reading from files.
Paul Smith [Sat, 19 Mar 2016 21:26:08 +0000 (17:26 -0400)] 
* function.c (func_file): Support reading from files.

* NEWS: Add information about reading files.
* make.texi (File Function): Describe reading files.
* tests/scripts/functions/file: Test new features for $(file ...)

9 years ago* doc/make.texi (Setting Variables): Fix typo (add comma).
Paul Smith [Sat, 19 Mar 2016 21:25:21 +0000 (17:25 -0400)] 
* doc/make.texi (Setting Variables): Fix typo (add comma).

9 years ago* job.c (child_error): Combine file info with error message.
Paul Smith [Sat, 19 Mar 2016 21:24:00 +0000 (17:24 -0400)] 
* job.c (child_error): Combine file info with error message.

* tests/scripts/...: Update error message matches.

9 years ago* variable.c: Align type of variable_changenum.
Paul Smith [Sat, 19 Mar 2016 21:23:19 +0000 (17:23 -0400)] 
* variable.c: Align type of variable_changenum.

9 years ago[SV 45728] Detect changes in .VARIABLES more accurately.
Paul Smith [Sun, 13 Mar 2016 22:13:00 +0000 (18:13 -0400)] 
[SV 45728] Detect changes in .VARIABLES more accurately.

For performance, we only recompute .VARIABLES when (a) it's expanded
and (b) when its value will change from a previous expansion.  To
determine (b) we were checking the number of entries in the hash
table which used to work until we started undefining entries: now if
you undefine and redefine the same number of entries in between
expanding .VARIABLES, it doesn't detect any change.  Instead, keep
an increasing change number.
* variables.c: Add variable_changenum.
(define_variable_in_set, merge_variable_sets): Increment
variable_changenum if adding a new variable to the global set.
(undefine_variable_in_set): Increment variable_changenum if
undefining a variable from the global set.
(lookup_special_var): Test variable_changenum not the hash table.
* tests/scripts/variables/special: Test undefining variables.

9 years ago* main.c(main): Disable output sync without parallel builds.
Paul Smith [Sun, 13 Mar 2016 19:59:12 +0000 (15:59 -0400)] 
* main.c(main): Disable output sync without parallel builds.

9 years ago[SV 46581] Pre-define .LOADED to avoid warnings.
Paul Smith [Sun, 13 Mar 2016 07:02:00 +0000 (03:02 -0400)] 
[SV 46581] Pre-define .LOADED to avoid warnings.

* main.c (main): Pre-define .LOADED as a default-level variable.
* load.c (load_file): Set the value rather than append it.  Avoid
adding an extra initial whitespace.
* tests/scripts/features/load: Run with --warn-undefined-variables.

9 years ago[SV 44555] Use vfork() instead of fork() where available.
Paul Smith [Sun, 13 Mar 2016 06:12:07 +0000 (01:12 -0500)] 
[SV 44555] Use vfork() instead of fork() where available.

Testing has shown that vfork() is actually significantly
more efficient on systems where it's supported, even for
copy-on-write implementations.  If make is big enough,
duplicating the page tables is significant overhead.

* configure.ac: Check for fork/vfork.
* makeint.h: Include vfork.h and set up #define for it.
* os.h, posixos.c (get_bad_stdin): For children who can't use
the normal stdin file descriptor, get a broken one.
* job.c (start_job_command): Avoid so many ifdefs and simplify
the invocation of child_execute_job()
(child_execute_job): move the fork operation here so it can
return early for the parent process.  Switch to use vfork().
* function.c (func_shell_base): Use new child_execute_job() and
simplify ifdefs.
* job.h, main.c, remote-cstms.c, vmsjobs.c, w32os.c: Update
declarations and calls.

9 years ago* job.c (exec_command): [SV 47365] Show error on exec failure.
Paul Smith [Wed, 9 Mar 2016 05:18:57 +0000 (00:18 -0500)] 
* job.c (exec_command): [SV 47365] Show error on exec failure.

9 years ago[SV 46261] Use pselect() for jobserver where supported.
Paul Smith [Wed, 9 Mar 2016 04:07:14 +0000 (23:07 -0500)] 
[SV 46261] Use pselect() for jobserver where supported.

* Makefile.am, configure.ac: Check for pselect() and sys/select.h.
* main.c (main): Block SIGCHLD if we have pselect() support.
* posixos.c (jobserver_acquire): If we support pselect() then use
it to query the jobserver pipe, while also listening for SIGCHLD.
Also pselect() supports a timeout so avoid alarm() calls.

9 years agoClean up some compiler warnings.
Paul Smith [Mon, 7 Mar 2016 06:30:21 +0000 (01:30 -0500)] 
Clean up some compiler warnings.

* commands.c, commands.h: Use unsigned char for flags.
* dir.c: Use time_t and size_t, and char for a boolean value.
* job.c: Use unsigned and char.
* read.c: Return a signed type since -1 is a valid return code.

9 years agoExtract jobserver implementation into OS-specific files.
Paul Smith [Sun, 6 Mar 2016 18:29:43 +0000 (13:29 -0500)] 
Extract jobserver implementation into OS-specific files.

* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.

9 years ago[SV 46261] Add more EINTRLOOP wrappers.
Paul Smith [Sat, 5 Mar 2016 20:21:59 +0000 (15:21 -0500)] 
[SV 46261] Add more EINTRLOOP wrappers.

This cannot be a perfect solution because there are always other
possible places EINTR can happen, including external libraries
such as gettext, Guile etc.

9 years ago* strcache.c (add_hugestring): [SV 46832] Support huge strings.
Paul Smith [Mon, 29 Feb 2016 03:07:50 +0000 (22:07 -0500)] 
* strcache.c (add_hugestring): [SV 46832] Support huge strings.

The strcache was limited to strings of length 65535 or less,
because the length is kept in an unsigned short.  To support
huge strings add a new simple linked list, which we don't try
to hash.

9 years ago* strcache.c (add_string): [SV 47071] Handle huge initial string.
Paul Smith [Mon, 29 Feb 2016 02:32:18 +0000 (21:32 -0500)] 
* strcache.c (add_string): [SV 47071] Handle huge initial string.

If the very first string added to the string cache is more than
half the maximum size, we failed when moving the only strcache
buffer to the full list.

9 years ago[SV 47151] Exit with 1 when checking recursive make -q
Paul Smith [Mon, 29 Feb 2016 01:20:18 +0000 (20:20 -0500)] 
[SV 47151] Exit with 1 when checking recursive make -q

* job.h (struct child): New bit to mark recursive command lines.
* job.c (start_job_command): Set the recursive command line bit.
(reap_children): If the child is a recursive command and it exits
with 1 during question mode, don't print an error and exit with 1.
* tests/scripts/options/dash-q: Add a regression test.

9 years ago* main.c (define_makeflags): Add parens to avoid GCC warning.
Paul Smith [Mon, 29 Feb 2016 01:19:24 +0000 (20:19 -0500)] 
* main.c (define_makeflags): Add parens to avoid GCC warning.

9 years ago* tests/scripts/features/archives: Handle deterministic archives.
Paul Smith [Mon, 29 Feb 2016 01:11:45 +0000 (20:11 -0500)] 
* tests/scripts/features/archives: Handle deterministic archives.

Newer versions of binutils allow ar to be compiled to generate
"deterministic archives" by default: in this mode no timestamp
information is generated in the static archive, which utterly
breaks GNU make's archive updating capability.  Debian and Ubuntu
have turned this feature on by default in their distributions
which causes the regression tests to fail.

Update the regression tests to check for the availability of the
"U" option to ar which disables deterministic archives and allows
GNU make's archive support to work properly again.