summaryrefslogtreecommitdiff
path: root/job.h
AgeCommit message (Collapse)AuthorFilesLines
2014-10-20[SV 42447]: VMS simulate exporting symbolsJohn Malmberg1-0/+1
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-30Update Copyright statements for 2014.Paul Smith1-1/+1
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-29Fix build failures on EMX for output-sync support.Paul Smith1-1/+1
2013-09-23Fix broken w32 build due to OUTPUT_SYNC -> NO_OUTPUT_SYNC inversion.Eli Zaretskii1-1/+1
w32/compat/posixfcn.c: Fix the forgotten OUTPUT_SYNC conditional. job.h: Ditto, but in a comment.
2013-09-21Invert the #define for output-sync: turn it off with NO_OUTPUT_SYNCPaul Smith1-7/+6
2013-09-21Ensure that stderr from shell functions in recipes is synced.Paul Smith1-3/+10
2013-09-12Enhance the output sync mode.Paul Smith1-13/+9
Create a new file, output.c, and collect functions that generate output there. We introduce a new global context specifying where output should go (to stdout or to a sync file), and the lowest level output generator chooses where to write output based on that context. This allows us to set the context globally, and all operations that write output (including functions like $(info ...) etc.) will use it. Removed the "--trace=dir" capability. It was too confusing. If you have directory tracking enabled then output sync will print the enter/leave message for each synchronized block. If you don't want that, disable directory tracking.
2013-07-14Notify the compiler that exec_command() won't return.Paul Smith1-2/+2
2013-05-27Porting to VMS, from Hartmut Becker.Paul Smith1-0/+4
2013-05-17Update source file format: remove TABs, use GNU coding styles.Paul Smith1-28/+29
2013-05-17Update copyright for changes in 2013.Paul Smith1-1/+1
2013-04-28Add support for per-job output sync.Paul Smith1-5/+3
A new flag to the -O/--output-sync, "job", selects a per-job (that is, per line of a recipe) output synchronization. To support this move the close of the temp file out of the sync_output() function and don't do it until we free the child, since we may call sync_output() multiple times in a given recipe. When we set up for a new temp file, if we're in per-job mode we truncate the file and seek to the beginning to re-use it for every job.
2013-04-27Support --output-sync on MS-Windows.Eli Zaretskii1-1/+46
w32/compat/posixfcn.c: New file, with emulations of Posix functions and Posix functionality for MS-Windows. w32/subproc/sub_proc.c: Include io.h. (process_noinherit): New function, forces a file descriptor to not be inherited by child processes. (process_easy): Accept two additional arguments, and use them to set up the standard output and standard error handles of the child process. w32/include/sub_proc.h (process_easy): Adjust prototype. (process_noinherit): Add prototype. read.c [WINDOWS32]: Include windows.h and sub_proc.h. makeint.h (LOCALEDIR) [WINDOWS32}: Define to NULL if not defined. This is needed because the MS-Windows build doesn't have a canonical place for LOCALEDIR. (WIN32_LEAN_AND_MEAN) [WINDOWS32]: Define, to avoid getting from windows.h header too much stuff that could conflict with the code. main.c <sync_mutex>: New static variable. <switches>: Add support for "--sync-mutex" switch. (decode_output_sync_flags): Decode the --sync-mutex= switch. (prepare_mutex_handle_string) [WINDOWS32]: New function. (main): Add "output-sync" to .FEATURES. job.h (CLOSE_ON_EXEC) [WINDOWS32]: Define to call process_noinherit. (F_GETFD, F_SETLKW, F_WRLCK, F_UNLCK, struct flock) [WINDOWS32]: New macros. (RECORD_SYNC_MUTEX): New macro, a no-op for Posix platforms. (sync_handle_t): New typedef. job.c <sync_handle>: Change type to sync_handle_t. (FD_NOT_EMPTY): Seek to the file's end. Suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>. (pump_from_tmp_fd) [WINDOWS32]: Switch to_fd to binary mode for the duration of this function, and then change back before returning. (start_job_command) [WINDOWS32]: Support output_sync mode on MS-Windows. Use a system-wide mutex instead of locking stdout/stderr. Call process_easy with two additional arguments: child->outfd and child->errfd. (exec_command) [WINDOWS32]: Pass two additional arguments, both -1, to process_easy, to adjust for the changed function signature. function.c (windows32_openpipe) [WINDOWS32]: This function now returns an int, which is -1 if it fails and zero otherwise. It also calls 'error' instead of 'fatal', to avoid exiting prematurely. (func_shell_base) [WINDOWS32]: Call perror_with_name if windows32_openpipe fails, now that it always returns. This avoids a compiler warning that error_prefix is not used in the MS-Windows build. config.h.W32.template (OUTPUT_SYNC): Define. build_w32.bat: Add w32/compat/posixfcn.c to compilation and linking commands. From Frank Heckenbach <f.heckenbach@fh-soft.de>: job.c (sync_output): Don't discard the output if acquire_semaphore fails; instead, dump the output unsynchronized.
2013-04-16Create an open_tmpfd() function to return temp files by FD. Use it.Paul Smith1-4/+0
2013-04-14Rename the "parallel-sync" option to "output-sync".Paul Smith1-7/+7
2013-04-14Initial patch for output synchronization. See Savannah bug #33138.Frank Heckenbach1-0/+8
Based on work by David Boyce <David.S.Boyce@gmail.com>.
2012-10-28Rearrange elements to reduce struct size on 64bit architectures.Paul Smith1-7/+5
2012-03-05Simplify copyrights using ranges of years.Paul Smith1-3/+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-2/+2
2010-07-13Update copyrights for 2010.Paul Smith1-1/+2
2010-07-12Add the beginning of the .ONESHELL special feature.Paul Smith1-0/+1
Original patch by David Boyce. Modified by Paul Smith.
2009-11-16Add VMS enhancements from Hartmut Becker.Paul Smith1-0/+1
2009-10-25Update copyright years.Paul Smith1-1/+1
2007-10-10Fixes from Eli Zaretskii:Paul Smith1-1/+2
Fix to allow quoted directories in PATH. Fix for Savannah bug #20549.
2007-07-04* Update to GPLv3Paul Smith1-4/+4
* 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-12/+12
2006-02-11Last of the copyright updates.Paul Smith1-2/+2
2006-02-11Update copyright and license notices on all files.Paul Smith1-13/+11
Added new file strcache.c to various non-UNIX makefiles and build scripts.
2006-02-08Fixed Savannah bug #15641.Boris Kolpackov1-0/+1
2005-05-03Fix problems with losing tokens in the jobserver, reported by GrantPaul Smith1-0/+2
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...
2003-03-24Add support for OS/2, contributed by Andreas Buening <andreas.buening@nexgo.de>Paul Smith1-0/+21
Also a small patch from Hartmut Becker <Hartmut.Becker@compaq.com> for VMS.
1999-08-23* Fix jobserver algorithm again.Paul Smith1-1/+0
* A couple of nits. * Fix considered pruning for double-colon rules.
1999-04-25* Add new jobserver feature.Paul Smith1-2/+3
* Small updates to the manual * E.Zaretskii fix for new DJGPP version.
1999-03-05* Update FSF address info in copyright notices.Paul Smith1-1/+2
* Update maintainers build process; remove GNUmakefile. Require builders to run automake && autoreconf by hand. * Use AC_SUBST_FILE to get the maintMakefile included, rather than GNU make's include directive, which conflicts with automake 1.4's include directive.
1998-10-03Checkpoint changes. Bug fixes, mostly.Paul Smith1-1/+1
1998-07-30GNU make release 3.77.Paul Smith1-1/+2
1996-06-22Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>Roland McGrath1-1/+2
* job.c (start_job_command): Call block_sigs. (block_sigs): New function, broken out of start_job_command. (reap_children): Block fatal signals around removing dead child from chain and adjusting job_slots_used. * job.h: Declare block_sigs.
1996-05-13Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>Roland McGrath1-0/+4
* job.h: No envp on Amiga
1996-03-20Tue Mar 19 20:21:34 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>Roland McGrath1-7/+20
Merged VMS port from Klaus Kaempf <kkaempf@didymus.rmi.de>. * make.h (PARAMS): New macro. * config.h-vms: New file. * makefile.com: New file. * makefile.vms: New file. * readme.vms: New file. * vmsdir.h: New file. * vmsfunctions.c: New file. * vmsify.c: New file. * file.h: Renamed to filedef.h to avoid conflict with VMS system hdr. * ar.c: Added prototypes and changes for VMS. * commands.c: Likewise. * commands.h: Likewise. * default.c: Likewise. * dep.h: Likewise. * dir.c: Likewise. * expand.c: Likewise. * file.c: Likewise. * function.c: Likewise. * implicit.c: Likewise. * job.c: Likewise. * job.h: Likewise. * main.c: Likewise. * make.h: Likewise. * misc.c: Likewise. * read.c: Likewise. * remake.c: Likewise. * remote-stub.c: Likewise. * rule.c: Likewise. * rule.h: Likewise. * variable.c: Likewise. * variable.h: Likewise. * vpath.c: Likewise. * compatMakefile (srcs): Rename file.h to filedef.h.
1994-03-23entered into RCSRoland McGrath1-1/+2
1993-10-14Formerly job.h.~6~Roland McGrath1-1/+1
1993-02-01Formerly job.h.~5~Roland McGrath1-0/+11
1993-01-06Formerly job.h.~4~Roland McGrath1-1/+2
1992-04-21Formerly job.h.~3~Roland McGrath1-2/+1
1992-04-21Formerly job.h.~2~Roland McGrath1-0/+17
1991-03-23Initial revisionRoland McGrath1-0/+34