Commit graph

2455 commits

Author SHA1 Message Date
Paul Smith
fda00f88d3 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.
2017-06-04 18:37:20 -04:00
Enrique Olaizola
d9d4e06084 * tests/run_make_tests.pl: [SV 50902] Find Perl modules 2017-06-04 10:19:57 -04:00
Eli Zaretskii
a95cb30ab5 [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.
2017-01-11 20:43:41 +02:00
Paul Smith
d351c1fef2 * 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.
2016-12-28 09:25:51 -05:00
Paul Smith
3daaa4dd3e * 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.
2016-12-28 09:25:34 -05:00
Martin Dorey
a359e32eb5 * job.c (child_execute_job): [SV 49938] Avoid spurious GCC warning. 2016-12-26 14:09:38 -05:00
Martin Dorey
bee153c762 * main.c (main): [SV 49935] Fix uninitialized variable. 2016-12-26 13:26:44 -05:00
Paul Smith
c5ccc4930c [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.
2016-12-26 09:01:59 -05:00
Paul Smith
45bf0e3a67 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.
2016-12-26 09:01:59 -05:00
Paul Smith
c6966b3238 [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.
2016-12-26 09:01:59 -05:00
Paul Smith
0029ea8941 * main.c (main): [SV 40234] Show correct error message. 2016-12-26 09:01:59 -05:00
Christoph Schulz
053d49367c * main.c (switches): [SV 48809] Accept obsolete jobserver flag. 2016-12-26 09:01:59 -05:00
Paul Smith
80861cce43 * read.c (get_next_mword): [SV 49865] Make fallthrough explicit. 2016-12-26 09:01:59 -05:00
Paul Smith
72af7ce8af [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.
2016-12-26 09:01:58 -05:00
Paul Smith
e4a9c9b825 [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.
2016-12-26 08:59:58 -05:00
Paul Smith
3d7c17c5a9 [SV 49116] Check potential null pointer dereference.
* w32/subproc/sub_proc.c (make_command_line): Simplify cygwin shell
check for correctness.
2016-12-25 18:18:45 -05:00
Jaak Ristioja
9c487cc537 * expand.c (variable_append): [SV 49113] Possible null ptr deref 2016-12-25 18:18:45 -05:00
Jaak Ristioja
1c9790e6f5 * w32/*/dirent.*: [SV 49111] Remove unused telldir() 2016-12-25 18:18:45 -05:00
Paul Smith
b13dcfe501 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.
2016-12-25 18:18:45 -05:00
Paul Smith
212cb00923 * po/Makevars, makeint.h, debug.h: Add xgettext C format flags. 2016-12-25 18:18:45 -05:00
Paul Smith
ac90d80b2a * po/LINGUAS: Added Serbian translation. 2016-12-25 18:18:45 -05:00
Paul Smith
a3f6e49705 * README.template: Clarify some items in the README 2016-12-25 18:18:45 -05:00
Paul Smith
db72ca1b7d * doc/make.texi: [SV 48951] Fix documentation typo. 2016-12-25 18:18:45 -05:00
Paul Smith
8d0aff7e81 * maintMakefile: Update default GPG ID for new key. 2016-12-25 18:18:03 -05:00
Paul Smith
bc9d72beb0 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.
2016-12-14 17:56:24 -05:00
Eli Zaretskii
d3bba301ce * NEWS: Mention the extended support for -jN on MS-Windows. 2016-11-12 11:03:14 +02:00
Marc Ullman
15066b73f4 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.
2016-11-12 10:53:28 +02:00
Eli Zaretskii
7ed37f0166 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.
2016-10-09 16:09:52 +03:00
Eli Zaretskii
912a0df127 Update the Guile version tested with the MS-Windows build. 2016-10-06 22:41:47 +03:00
Eli Zaretskii
0b41373312 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.
2016-10-06 22:39:14 +03:00
Paul Smith
6f339b22eb * 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.
2016-06-24 20:50:42 -04:00
Paul Smith
e26560508c * Update to pre-release version 4.2.90. 2016-06-24 20:50:40 -04:00
Paul Smith
9ab8af7cd8 GNU Make release 4.2.1. 2016-06-10 19:02:10 -04:00
Paul Smith
f522852f07 * maintMakefile: TP recommends rsync for retrieving PO files. 2016-06-06 08:32:00 -04:00
Jeremy Devenport
a3d8c086d5 * main.c (main): [SV 48009] Reset stack limit for make re-exec.
Copyright-paperwork-exempt: yes
2016-05-31 03:17:26 -04:00
Paul Smith
4762480ae9 [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.
2016-05-31 03:17:26 -04:00
Paul Smith
ef6c059e1e * DELETE_ON_ERROR: [SV 48061] Use "exit 1" for portability.
Reported by Joel Fredrikson <Joel.Fredrikson@it.uu.se>
2016-05-31 03:17:26 -04:00
Paul Smith
cf4ed2ebe8 * w32/pathstuff.c: [SV 47996] Use ISBLANK() not isblank(). 2016-05-31 03:17:26 -04:00
Eli Zaretskii
5a4f9a67a3 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.
2016-05-28 12:53:02 +03:00
Luke Allardyce
2987163ac4 [SV 48037] Fix MinGW build with Posix configury tools
* w32/Makefile.am (libw32_a_CPPFLAGS): Add -I$(srcdir)/glob.

Copyright-paperwork-exempt: yes
2016-05-27 22:39:55 +03:00
Paul Smith
ec61980122 GNU Make release 4.2. 2016-05-22 09:25:55 -04:00
Joe Crayne
9bb994e831 [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
2016-05-21 17:34:45 -04:00
Paul Smith
e2ebea35f1 * read.c (eval): [SV 47960] Skip record waiting files when ignoring.
* tests/scripts/features/conditionals: Test this scenario.
2016-05-21 16:22:32 -04:00
Paul Smith
c73ed7dd1c 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.
2016-05-21 16:22:32 -04:00
Paul Eggert
ba8383efd8 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.
2016-05-21 16:22:25 -04:00
Paul Smith
6f7fb050b4 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.
2016-05-21 16:21:31 -04:00
Paul Smith
45200a42d3 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.
2016-05-21 14:30:37 -04:00
Eli Zaretskii
4c9e10fd94 [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.
2016-05-17 18:15:26 +03:00
Eli Zaretskii
6e640321fd 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.
2016-04-24 09:53:38 +03:00
Paul Smith
7241d136f4 * tests/scripts/features/output-sync: increase test timeout.
I'm getting random failures with a timeout of 10s; increase to 30s.
2016-04-23 11:21:36 -04:00