summaryrefslogtreecommitdiff
path: root/vmsjobs.c
AgeCommit message (Collapse)AuthorFilesLines
2015-01-27Fix bs-nl handling, exit and Environment for VMS.John Malmberg1-485/+995
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>
2014-10-20[SV 42447]: VMS simulate exporting symbolsJohn Malmberg1-90/+120
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.
2014-09-30* job.c: fix make action continuation lines.Hartmut Becker1-45/+51
* vmsjobs.c: fix writing DCL command files when trimming (white spaces and $ signs) especially after a split (command continuation).
2014-09-07Enhance VMS exporting make environment variables.Hartmut Becker1-1/+28
* 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.
2014-09-07Enhance/fix VMS ONESHELL implementation and command executionHartmut Becker1-87/+257
* 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.
2014-09-07Enhance/fix VMS exit code handling.Hartmut Becker1-3/+5
* commands.c, function.c, hash.c, job.c, main.c, output.c: use MAKE exit codes. * makeint.h: encode make exit codes so that they are VMS compatible. * job.c: check child exit code for VMS style exit codes. * vmsjobs.c: save and return VMS style exit code.
2014-09-07Enhance/fix VMS multi-line support.Hartmut Becker1-26/+30
* job.c: split the command line at a newline. * default.c, vmsjobs.c: change ECHO variable to a pseudo builtin, which ensures that the VMS/DCL ECHO ("write sys$output") is used and is correctly quoted. * vmsjobs.c: remove unused builtin 'rm'.
2013-11-23[SV 40361] Don't use vsnprintf(), which is an ISO C99 function.Paul Smith1-2/+2
* output.c (error, fatal, message): Take an extra argument specifying how many bytes are used by the formatted arguments. (get_buffer): New function that allocates the requested buffer size. Remove msc_vsnprintf(), vfmtconcat(), and fmtconcat() as unneeded. * makeint.h: Declare various helper macros for generating output. * *.c: Change all error(), fatal(), message() calls to use the macros, or pass the extra length argument directly.
2013-09-14Support the -Orecurse option properly.Paul Smith1-367/+362
In this mode we still collect all the output from a given target and dump it at once. However we don't treat recursive lines any differently from non-recursive lines. Also we don't print enter/leave messages after every dump. However we do ensure that we always print them once to stdout, so the parent make will collect it properly.
2013-07-14Modify the update_status field in struct file to be an enum.Paul Smith1-2/+2
Makes the code a little clearer/cleaner, and solves a problem on systems where a char is unsigned by default.
2013-05-27Porting to VMS, from Hartmut Becker.Paul Smith1-2/+2
2013-05-17Update copyright for changes in 2013.Paul Smith1-1/+1
2012-03-05Simplify copyrights using ranges of years.Paul Smith1-2/+1
The new GNU Maintainer's Manual allows the use of year ranges in certain situations; take advantage of this simplification.
2012-03-04Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines.Paul Smith1-1/+1
Fixes Savannah bug #34530.
2012-01-16Update copyright notices.Paul Smith1-1/+1
2010-07-13Update copyrights for 2010.Paul Smith1-1/+1
2009-11-16Add VMS enhancements from Hartmut Becker.Paul Smith1-41/+82
2009-10-25Update copyright years.Paul Smith1-1/+1
2007-07-04* Update to GPLv3Paul Smith1-5/+5
* Update copyright to 2007 * Fix download URL for translation files (thanks to Thiemo Seufer)
2006-04-07Code cleanup: Remove all references to PARAMS() & ansi2knr.Paul Smith1-1/+1
2006-02-11Last of the copyright updates.Paul Smith1-2/+2
2006-02-11Update copyright and license notices on all files.Paul Smith1-3/+16
Added new file strcache.c to various non-UNIX makefiles and build scripts.
2005-06-10Fixes for VMS from Hartmut Becker.Paul Smith1-4/+8
2005-05-03Fix problems with losing tokens in the jobserver, reported by GrantPaul Smith1-0/+667
Taylor. There are two forms of this: first, it was possible to lose tokens when using -j and -l at the same time, because waiting jobs were not checked when determining whether any jobs were outstanding. Second, if you had an exported recursive variable that contained a $(shell ...) function there is a possibility to lose tokens, since a token was taken but the child list was not updated until after the shell function was complete. To resolve this I introduced a new variable that counted the number of tokens we have obtained, rather than checking whether there were any children on the list. I also added some sanity checks to make sure we weren't writing back too many or not enough tokens. And, the master make will drain the token pipe before exiting and compare the count of tokens at the end to what was written there at the beginning. Also: * Ensure a bug in the environment (missing "=") doesn't cause make to core. * Rename the .DEFAULT_TARGET variable to .DEFAULT_GOAL, to match the terminology in the documentation and other variables like MAKECMDGOALS. * Add documentation of the .DEFAULT_GOAL special variable. Still need to document the secondary expansion stuff...