]> git.ipfire.org Git - thirdparty/make.git/log
thirdparty/make.git
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.

9 years agoUpdate Copyright statements for the new year.
Paul Smith [Sun, 28 Feb 2016 17:55:20 +0000 (12:55 -0500)] 
Update Copyright statements for the new year.

9 years ago* doc/make.texi: [SV 47163] Fix typo in 'ifdef' documentation.
Paul Smith [Sun, 28 Feb 2016 17:41:41 +0000 (12:41 -0500)] 
* doc/make.texi: [SV 47163] Fix typo in 'ifdef' documentation.

9 years ago* doc/make.texi: [SV 35455] Add more uses for Empty Recipes.
Paul Smith [Sun, 28 Feb 2016 17:35:15 +0000 (12:35 -0500)] 
* doc/make.texi: [SV 35455] Add more uses for Empty Recipes.

9 years agoFix diagnostics on MS-Windows when environment is too large
Gisle Vanem [Sat, 7 Nov 2015 09:27:03 +0000 (11:27 +0200)] 
Fix diagnostics on MS-Windows when environment is too large

* w32/subproc/sub_proc.c (process_begin): Fix test of the error
cause when the environment block is too large.

Copyright-paperwork-exempt: yes.

9 years agoUpdate README.W32.template
Eli Zaretskii [Tue, 27 Oct 2015 18:51:43 +0000 (20:51 +0200)] 
Update README.W32.template

* README.W32.template: Update for latest developments.  Make it
clear we don't recommend using HAVE_CASE_INSENSITIVE_FS in
general.

9 years ago[SV 46304] Don't invoke C++ compiler on C sources on MS-Windows
Eli Zaretskii [Tue, 27 Oct 2015 18:47:27 +0000 (20:47 +0200)] 
[SV 46304] Don't invoke C++ compiler on C sources on MS-Windows

* default.c (default_variables) [HAVE_CASE_INSENSITIVE_FS]: Make
COMPILE.C and LINK.C be synonyms for COMPILE.c and LINK.c,
respectively.

10 years ago[SV 45838] When invoking w32 programs, don't use free'd memory.
Eli Zaretskii [Wed, 23 Sep 2015 08:42:53 +0000 (11:42 +0300)] 
[SV 45838] When invoking w32 programs, don't use free'd memory.

* w32/subproc/sub_proc.c (process_begin): Freeing argv[0] makes
the other argv[i] pointers invalid, so need to allocate a new
array and copy argv[i] for i != 0 first, replacing argv[0] with
the batch file name, before we can free argv[0].

10 years ago* implicit.c (pattern_search): [SV 43677] Mark files secondary.
Paul Smith [Mon, 13 Jul 2015 04:51:35 +0000 (00:51 -0400)] 
* implicit.c (pattern_search): [SV 43677] Mark files secondary.

In order to fix SV 12267 we were marking the prerequisites of
implicit (pattern) targets that existed elsewhere in the makefile
as precious to keep them from being deleted as intermediate files.
However this also keeps them from being deleted on error.  Instead
mark them as secondary.
* tests/scripts/targets/DELETE_ON_ERROR: Test DELETE_ON_ERROR.

10 years ago[SV 28092] Preserve the exit status of the $(shell...) function.
Paul Smith [Mon, 13 Jul 2015 01:03:24 +0000 (21:03 -0400)] 
[SV 28092] Preserve the exit status of the $(shell...) function.

Add a new variable .SHELLSTATUS which holds the exit status of the
last-invoked shell function or != assignment.

* NEWS, doc/make.texi: Document the change.
* function.c (shell_completed, msdos_openpipe, func_shell_base): Add
shell_completed() to handle the completion of the shell, by setting
.SHELLSTATUS.  Call it where needed.
* job.c (child_handler): Call shell_completed().
* tests/scripts/functions/shell: Add tests for .SHELLSTATUS.

10 years ago* tests/scripts/misc/fopen-fail: [SV 42390] Increase test timeout.
Paul Smith [Sun, 12 Jul 2015 22:05:50 +0000 (18:05 -0400)] 
* tests/scripts/misc/fopen-fail: [SV 42390] Increase test timeout.

* Makefile.am (check-regression): Force ulimit -n for fopen-fail test.

10 years ago* job.c: [SV 43936] Check sigaction for error return.
Paul Smith [Sun, 12 Jul 2015 21:29:05 +0000 (17:29 -0400)] 
* job.c: [SV 43936] Check sigaction for error return.

10 years ago[SV 45049] Check for '$' being the last character in a string.
Paul Smith [Sun, 12 Jul 2015 17:25:16 +0000 (13:25 -0400)] 
[SV 45049] Check for '$' being the last character in a string.

* expand.c (variable_expand_string): Add a single '$' if '$' ends the
string.
* read.c (find_char_unquote, get_next_mword): Stop if '$' ends the
string.
* variable.c (parse_variable_definition): Ditto.

10 years ago* read.c (unescape_char): [SV 45050] Handle final backslashes.
Paul Smith [Sun, 12 Jul 2015 16:35:42 +0000 (12:35 -0400)] 
* read.c (unescape_char): [SV 45050] Handle final backslashes.

If the last thing in the string to be unescaped is a backslash,
stop without reading beyond the end of the string.

10 years ago* strcache.c: [SV 45275] Handle very long strings.
Paul Smith [Sat, 11 Jul 2015 21:21:22 +0000 (17:21 -0400)] 
* strcache.c: [SV 45275] Handle very long strings.

Our previous behavior for handling too-long strings involved
increasing the size of the default string cache buffer, but the
implementation was incomplete.  Instead, create a one-off large
string cache entry and add it directly to the full cache list
without changing the default buffer size.

10 years ago* job.c [RISCOS]: Remove logic that is no longer required.
Duncan Moore [Sun, 14 Jun 2015 13:34:18 +0000 (14:34 +0100)] 
* job.c [RISCOS]: Remove logic that is no longer required.

Signed-off-by: Paul Smith <psmith@gnu.org>
Copyright-paperwork-exempt: yes

10 years ago* remake.c (update_file): [SV 44742] Keep double-colon rule status.
Paul Smith [Sat, 11 Jul 2015 17:55:45 +0000 (13:55 -0400)] 
* remake.c (update_file): [SV 44742] Keep double-colon rule status.

Fix suggested by Everett Boyer <EvBoyer@aol.com>

10 years ago[SVN 45515] Check exit status of sub-make in subproc.bat
James Johnston [Fri, 10 Jul 2015 06:56:27 +0000 (09:56 +0300)] 
[SVN 45515] Check exit status of sub-make in subproc.bat

* subproc.bat: Exit when sub-make invocation fails.

Copyright-paperwork-exempt: yes

10 years ago[SV 45515] Ignore Windows-specific build artifacts
Eli Zaretskii [Fri, 10 Jul 2015 06:50:27 +0000 (09:50 +0300)] 
[SV 45515] Ignore Windows-specific build artifacts

* .gitignore: Ignore *.exe, *.dll.a, *.lib, *pdb, and a few more MSVC
specific artifacts.
Suggested by James Johnston <johnstonj.public@codenest.com>

10 years ago[SV 44348] Fix handling of shell widlcards on MS-Windows.
Eli Zaretskii [Sat, 28 Feb 2015 12:34:51 +0000 (14:34 +0200)] 
[SV 44348] Fix handling of shell widlcards on MS-Windows.

* job.c (construct_command_argv_internal): If shell wildcard
characters are found inside a string quoted with "..", give up the
fast route and go through the shell.  Fixes Savannah bug #44348.

10 years agoFix bs-nl handling, exit and Environment for VMS.
John Malmberg [Fri, 28 Nov 2014 03:28:30 +0000 (21:28 -0600)] 
Fix bs-nl handling, exit and Environment for VMS.

This fix required a complete rewrite of the command parser vmsjobs.c
child_execute_job.  The old parser had too many incorrect assumptions
about DCL commands and could not be repaired to extended.

The parser now more closely parses VMS commands and handles quoted
commands and redirection.  Command File mode has been improved, but can
not fully support bs-nl syntax.

VMS Unix shell simulation has been improved.

* commands.c: vms_comma_separator is now a run-time setting.
* function.c: vms_comma_separator is now a run-time setting.
* function.c(func_basename_dir) now reports "[]" or "./" based on
  VMS crtl runtime setting.
* job.c(start_job_command): VMS Handle empty commands propery.
* main.c: Add VMS environment variables for run-time settings.
  * vms_legacy_behavior - Force older behavior.
  * vms_comma_separator - Commas or spaces for separators.
  * vms_unix_simulation - Enhanced Posix shell simulation features.
  * Detect if VMS CRTL is set to report Unix paths instead of VMS.
  * ':' and '>' are also MAP_DIRSEP on VMS.
* makeint.h: Add VMS run-time option variables.
* readme.vms: Update to current behavior.
* variable.c(define_variable_in_set): Fix VMS Environment variable
  lookup.
* variable.c(define_automatic_variables): Remove some VMS specific
  automatic variables and use the Unix ones instead.
* vms_export_symbol.c: Set max symbol size correctly.
* vmsjobs.c: child_execute_job() complete rewrite of VMS comand
  parsing.
* vmsjobs.c(build_vms_cmd): VMS commmand building with shell simulation.

Signed-off-by: Paul Smith <psmith@gnu.org>
10 years agoFix $(shell) on hosts with 64-bit pid_t.
Christian Boos [Sat, 27 Dec 2014 08:55:01 +0000 (10:55 +0200)] 
Fix $(shell) on hosts with 64-bit pid_t.

* function.c: Use pid_t for shell_function_pid.
* job.c: Likewise.

Copyright-paperwork-exempt: yes

10 years ago* main.c (main): [SV 43434] Handle NULL returns from ttyname().
Paul Smith [Mon, 20 Oct 2014 05:54:56 +0000 (01:54 -0400)] 
* main.c (main): [SV 43434] Handle NULL returns from ttyname().

10 years ago* tests/scripts/features/archives: [SV 43405] override AR variable.
Benedikt Morbach [Sun, 12 Oct 2014 08:11:17 +0000 (10:11 +0200)] 
* tests/scripts/features/archives: [SV 43405] override AR variable.

Copyright-paperwork-exempt: yes

10 years agoFix VMS implicit rules and UNIX paths.
John Malmberg [Wed, 8 Oct 2014 00:23:47 +0000 (19:23 -0500)] 
Fix VMS implicit rules and UNIX paths.

This fixes VMS implicit rules and UNIX style pathname handling.
It also fixes some of the VMS style pathname handling, more work
there will be needed later.
TODO: There are other case insensitive platforms besides VMS.
We need to find out why there is extra VMS code for this.  This
indicates either the extra VMS code is not needed, or the case
insensitive support may not be complete on the other case
insensitive platforms.

* default.c: Add missing definitions to default_suffix_rules[] and
default_variables[].
TODO: As it is important that VMS DCL mode definitions must always
be a superset of UNIX definitions, a better way of maintaining the
VMS DCL mode definitions should be devised.
* dir.c (downcase_inplace): Add a reentrant downcase() routine.
Add future support for VMS 8.2+ _USE_STD_STAT macro which will
disable a lot of VMS specific code from compiling.
(dir_file_exists_p): vmsify filename only if directory name has VMS
directory delimiters.
(file_exists_p): Handle both VMS and UNIX directories.
(file_impossible): Handle both VMS and Unix directories.  Track
whether a VMS format path is needed for the return value.
* file.c (lookup_file): Check if vmsify is needed; handle UNIX paths.
* implicit.c (pattern_search): Enable UNIX paths.
* read.c (parse_file_seq): Enable UNIX paths.
* remake.c (f_mtime): Fix gpath_search call for VMS paths.
* rule.c (count_implicit_rule): Enable UNIX paths, Fix VMS paths.
* vpath.c (selective_vpath_search): Enable UNIX paths.

10 years agoUpdate README.VMS and move news to the NEWS file
John Malmberg [Wed, 15 Oct 2014 12:19:42 +0000 (07:19 -0500)] 
Update README.VMS and move news to the NEWS file

* NEWS: Merge in VMS history.
* README.VMS: Remove VMS history, document current behavior and
known issues.

10 years ago[SV 41758]: Fix archive support for VMS.
John Malmberg [Fri, 12 Sep 2014 03:39:34 +0000 (22:39 -0500)] 
[SV 41758]: Fix archive support for VMS.

Upated to match change to run_make_tests and some future fixes to
make on VMS.

* arscan.c: Use ANSI compatible pragmas instead of VAX C extensions.
* tests/scripts/features/archives: Fix tests to use VMS rules and
answers when running on VMS and using DCL as a shell.
* tests/scripts/features/vpath3: Fix epected answer on test when
run on VMS.
* tests/scripts/vms/library: (New) Test the VMS library rules that
are not tested by existing tests.

10 years ago[SV 42447]: VMS simulate exporting symbols
John Malmberg [Sun, 14 Sep 2014 01:20:22 +0000 (20:20 -0500)] 
[SV 42447]: VMS simulate exporting symbols

This also includes fixing the most of the exit handling code for VMS.

Self tests:
 Previously about 94 Tests in 36 categories fail.
 Now about 45 tests in 22 categories fail.

Because some tests do not properly clean up, the number of tests that
fail can vary by one or two test cases between consecutive runs.

* Makefile.am: Add new VMS files.
* job.c: add prototype for vms_strsignal().
* job.c: (child_error): Remove VMS specific code as no longer needed.
* job.c: (reap_children): The VMS specific code was setting the
status to 0 instead of setting it to the proper exit status.
* job.h: Add vms_launch_status to struct child.
* main.c: (main): Use environment variables for options to use MCR
* instead of a foreign command, and to always use command files for
subprocesses.
For VMS use (set_program_name) routine which is common to ports of
other GNU packages to VMS to set the program name used internally.
Use (vms_putenv_symbol) to set up symbols to be visible in child
programs, including recursive make launched by execve()
Start of Bash shell detection code for VMS.
* makefile.com: Need nested_include=none for building on VMS search
lists.  Add vms_progname, vms_exit, and vms_export_symbol.
* makefile.vms: Need nested_include=none for building on VMS search
lists.  Add vms_progname, vms_exit, vms_export_symbol.
* makeint.h: Make sure non-standard "VMS" macro is defined.  Add
prototypes for new VMS routines.  Remove VMS-specific failure codes.
* vmsjobs.c: Add VMS POSIX exit code constants.
(_is_unixy_shell): Detect Bash shell.
(vms_strsignal): simulate strsignal() on VMS.
(vmsHandleChildTerm): fix to properly report failed LIB$SPAWN() exit
status codes.  Remove code that duplicated code in job.c.
(child_execute_job): Export environment symbols before spawning a
child and restore afterward unless option to use command files for
subprocesses is set.  Improve handling of UNIX null commands ":".
* vms_exit.c: Provides vms_exit() to detect if an exit code is UNIX
or VMS, and converts the UNIX code into a VMS exit code.
* vms_export_symbol.c: Routines to create DCL symbols that work like
shell aliases or exported shell symbols and clean them up on exit.
* vms_export_symbol_test.com: Unit test for vms_export_symbol.c
* vms_progname.c: New file: VMS specific replace for progname.c that
is used in some GNU projects.

10 years agoSet up for running tests on VMS.
John Malmberg [Tue, 7 Oct 2014 02:46:34 +0000 (21:46 -0500)] 
Set up for running tests on VMS.

* run_make_tests.pl: set $port_type to be 'VMS-DCL' when the test are
run from the VMS DCL Interpreter.  When the tests are run from GNV
on VMS, the $port_type will be 'UNIX'.
* run_make_tests.com: VMS search list support.  This is needed for
using a search list such as prj_root = lcl_root:,vms_root:,src_root:
for building and testing.

11 years ago* configure.ac, NEWS, README.git: Set up for the next release.
Paul Smith [Thu, 9 Oct 2014 06:06:53 +0000 (02:06 -0400)] 
* configure.ac, NEWS, README.git: Set up for the next release.

11 years agoGNU Make release 4.1. 4.1
Paul Smith [Sun, 5 Oct 2014 16:18:08 +0000 (12:18 -0400)] 
GNU Make release 4.1.

11 years agoFix Cygwin compilation error.
Eli Zaretskii [Thu, 2 Oct 2014 15:11:43 +0000 (18:11 +0300)] 
Fix Cygwin compilation error.

* job.c (construct_command_argv_internal) [HAVE_DOS_PATHS]: Fix
initializer for sh_chars_sh.
Reported by Denis Excoffier<cygwin@Denis-Excoffier.org>.

11 years agoFix last commit.
Gisle Vanem [Wed, 1 Oct 2014 17:43:12 +0000 (20:43 +0300)] 
Fix last commit.

11 years ago* makeint.h (ftruncate): Define also for __WATCOMC__.
Gisle Vanem [Wed, 1 Oct 2014 17:41:28 +0000 (20:41 +0300)] 
* makeint.h (ftruncate): Define also for __WATCOMC__.

Copyright-paperwork-exempt: yes.

11 years agoAvoid compilation warnings.
Eli Zaretskii [Wed, 1 Oct 2014 15:34:29 +0000 (18:34 +0300)] 
Avoid compilation warnings.

* main.c (find_and_set_default_shell, main) [WINDOWS32]: Declare
variables 'const char *' to avoid compiler warnings.
* job.c (construct_command_argv_internal) [!NDEBUG]: Declare 'end'
and set it only if NDEBUG is not defined, to avoid compiler
warnings.

11 years agoTreat redirection of standard handles on Windows as it is done on Unix.
Eli Zaretskii [Wed, 1 Oct 2014 15:26:28 +0000 (18:26 +0300)] 
Treat redirection of standard handles on Windows as it is done on Unix.

* job.c (start_job_command) [WINDOWS32]: Compute outfd and errfd
as on Posix platforms, and pass the results to process_easy.
* function.c (windows32_openpipe) [WINDOWS32]: Accept an
additional argument ERRFD and use it for redirecting the standard
error handle passed to the subprocess.
(func_shell_base) [WINDOWS32]: Pass the computed errfd to
windows32_openpipe.

11 years agoUpdate Copyright statements for 2014.
Paul Smith [Tue, 30 Sep 2014 12:33:21 +0000 (08:33 -0400)] 
Update Copyright statements for 2014.

11 years ago* tests/scripts/features/load: Avoid unused variable warnings.
Paul Smith [Tue, 30 Sep 2014 13:31:39 +0000 (09:31 -0400)] 
* tests/scripts/features/load: Avoid unused variable warnings.

11 years ago* loadapi.c (gmk_eval): Use C90 syntax.
Paul Smith [Tue, 30 Sep 2014 12:32:06 +0000 (08:32 -0400)] 
* loadapi.c (gmk_eval): Use C90 syntax.

11 years ago* job.c: fix make action continuation lines.
Hartmut Becker [Thu, 18 Sep 2014 21:49:49 +0000 (23:49 +0200)] 
* job.c: fix make action continuation lines.

* vmsjobs.c: fix writing DCL command files when trimming (white
  spaces and $ signs) especially after a split (command continuation).

11 years ago* configure.ac: Fix spacing in helptext of customs
Bernhard Reutner-Fischer [Mon, 15 Sep 2014 11:03:44 +0000 (13:03 +0200)] 
* configure.ac: Fix spacing in helptext of customs

Copyright-paperwork-exempt: yes

11 years agoSupport MAKE_TERMOUT and MAKE_TERMERR on MS-Windows.
Eli Zaretskii [Mon, 15 Sep 2014 16:51:41 +0000 (19:51 +0300)] 
Support MAKE_TERMOUT and MAKE_TERMERR on MS-Windows.

* w32/compat/posixfcn.c (isatty, ttyname): New functions.
* config.h.W32.template (HAVE_TTYNAME): Define.  Add a prototype
for ttyname.

11 years ago* loadapi.c (gmk_eval): [SV 43221] Preserve var buff content for eval.
Paul Smith [Mon, 15 Sep 2014 13:38:02 +0000 (09:38 -0400)] 
* loadapi.c (gmk_eval): [SV 43221] Preserve var buff content for eval.

11 years ago* main.c, NEWS, doc/make.text: Rename MAKE_TTY* to MAKE_TERM*
Paul Smith [Mon, 15 Sep 2014 13:30:40 +0000 (09:30 -0400)] 
* main.c, NEWS, doc/make.text: Rename MAKE_TTY* to MAKE_TERM*

11 years ago* main.c (main): Set MAKE_TTYOUT and MAKE_TTYERR.
Paul Smith [Sun, 14 Sep 2014 05:03:19 +0000 (01:03 -0400)] 
* main.c (main): Set MAKE_TTYOUT and MAKE_TTYERR.

* configure.ac: Test for isatty() and ttyname()
* makeint.h: provide a substitute for ttyname() if it's not available.
* config.ami.template, config.h-vms.template, config.h.W32.template:
define/undefine HAVE_ISATTY/HAVE_TTYNAME macros.
* NEWS, doc/make.texi: Document these new variables.

11 years ago* tests/config-flags.pm.in, tests/scripts/features/archives: [SV 43046]
Paul Smith [Mon, 8 Sep 2014 00:12:12 +0000 (20:12 -0400)] 
* tests/config-flags.pm.in, tests/scripts/features/archives: [SV 43046]

Use the "ar" program detected by configure when running the test suite.

11 years ago* doc/make.texi: Clarify implicit rule lookup of phony targets
Paul Smith [Mon, 8 Sep 2014 00:02:31 +0000 (20:02 -0400)] 
* doc/make.texi: Clarify implicit rule lookup of phony targets

Reported by Frank Heckenbach <f.heckenbach@fh-soft.de>

11 years agoFix and enhance VMS library support.
Hartmut Becker [Thu, 4 Sep 2014 19:04:52 +0000 (21:04 +0200)] 
Fix and enhance VMS library support.

* ar.c: fix VMS library search for members, which do not have
suffixes, aka filename extensions.
* arscan.c: fix time conversion and library callback routines.
* default.c: more suffixes and automatically create the VMS library
if it doesn't exists.

11 years agoEnhance VMS exporting make environment variables.
Hartmut Becker [Wed, 3 Sep 2014 21:39:25 +0000 (23:39 +0200)] 
Enhance VMS exporting make environment variables.

* config.h-vms.template: add feature macro USE_DCL_COM_FILE to always
write a DCL command file, enabled by default.
* vmsjobs.c: with USE_DCL_COM_FILE enabled write make variables as DCL
symbol assignments into the command file.  This enables printing
directory and make level info for recursive use of make. This also
enables forced DCL symbol substitution in the actions.

11 years agoFix VMS automatic variable expansion
Hartmut Becker [Wed, 3 Sep 2014 17:27:17 +0000 (19:27 +0200)] 
Fix VMS automatic variable expansion

* function.c: add VMS code to func_notdir_suffix and func_basename_dir
to work on comma separated lists; this fixes the expansion of
$(^D), $(+D) and the F variants for VMS.

11 years ago* main.c [VMS]: Say that parallel jobs (-j) are not supported on VMS
Hartmut Becker [Sun, 31 Aug 2014 22:29:19 +0000 (00:29 +0200)] 
* main.c [VMS]: Say that parallel jobs (-j) are not supported on VMS

11 years agoEnhance/fix VMS ONESHELL implementation and command execution
Hartmut Becker [Sun, 31 Aug 2014 21:52:25 +0000 (23:52 +0200)] 
Enhance/fix VMS ONESHELL implementation and command execution

* job.c, vmsjobs.c: fix some double quote and new line handling;
implement ONESHELL with writing multiple lines into one DCL command
procedure; in ONESHELL allow VMS/make internal redirection only on the
first line; fix the created DCL command procedure, which didn't abort
on errors; return correct exit status from the DCL command procedure;
preserve current procedure verification; make the generated command
procedure more robust.