replace the %d with getpid().
Allows the trace files for different make process is a big recursive make
to be written to different files - and have a slight chance of being useful.
globbing.
The old behaviour was the perform variable expansion and globbing on the
output of both the variable expansion and globbing. Which allows some very
strange behaviour if, for example, globbed filenames contain $ symbols.
Unconditionally add new nodes from these expansions even if the names are
already children. The .WAIT code needs the order of children preserved.
Rename 'allsrc' to 'curSrcs' so that the variable passed to ParseDoSrc (etc)
has the same name as the local in the calling routine, rather than a name
that seems to imply a more global and persistent list.
loop continue part. Remove the 'free(line)' from teh end of the loop body,
change the gotos into continues and collapse out some 'else if's.
All in the name of code transparency. No functional changes.
(Almost all the debug output went there, but some went to stderr.)
Split the parsing of -d (debug flags) out into its own routine.
Allow the output filename to be changed by specifying -dF<file> to create
a log file, or -dF+<file> to append to it. <file> may be stdout or stderr.
Also change so that -d-<flags> acts on <flags> locally but doesn't copy
them to MAKEFLAGS so they aren't inherited by child makes.
I'm not 100% happy with the command line syntax for the above, so they are
currently undocumented.
entries, so allocate at startup.
Use an 'int jobPipe[2]' within the job structure, and create pipes directly
into it. Common up the code that creates all the pipes - making them all
non-block on the read side in the process.
Call Job_CatchChildren() directly from Job_CatchOutput() so that it only
gets called when a child actually exits.
NB: Something causes a 'pregnant pause' if (for example) you call 'nbmake obj'
in src/tools. Introduced between netbsd 3 and 4.
shell. To use this, build with -D_PATH_DEFSHELLDIR=\"/path/to/dir\"
-D_BASENAME_DEFSHELL=\"shell\".
* Change the order of entries in shells[]. Now DEFSHELL defaults to 0,
and shells[0] describes the default shell. This will be "sh" in the
usual case.
* If _BASENAME_DEFSHELL is defined, insert an additional entry above
"sh" in the shells[] array, making this new entry shells[0]. The
new entry is assumed to refer to an sh-compatible shell with a
non-standard name. (Tested using _PATH_DEFSHELLDIR="/usr/pkg/bin" and
_BASENAME_DEFSHELL="bash".)
* In the shells[] entry for "sh", test defined(MAKE_NATIVE) &&
defined(__NetBSD__) to decide whether we can use the "q" flag.
OK sjg, christos
messages whan make itself is suspended (ie by ^Z) before make actually
suspends, supress the messages during this sequence.
This means we don't care that they would be output after the suspend
and we can stop attempting to reap child status from withing the signal
handler (which doesn't work for recursive parallel makes).
The code simplification means that we can remove much of the code that
blocked signals - since the signal handlers (expect that for ^C and friends)
now do almost no work.
If there are any undead ones set a flag so we don't report the 'Child (pid)
not in table' message when they die - it is impossible to (portably) find
the childrens pids.
This happens when make is run as 'make -f- ... <<EOF' and the shell uses
a child of (what will be) make to write the data into a pipe.
- Send each type of signal to its own handler.
- Only call JobFinish when a process exits, in particular don't 'fake up'
'exitstatus' for jobs being continued, nor call it for suspends.
- When a job is stopped, use an entire variable to remember the fact, so
we know we need to send a SIGCONT. Don't change any other state.
- In order to report '*** [job3] Suspended' before we suspend ourselves we
have to call waitpid() from the signal handler - where we don't want to
process job termination events. Save the exit status and process later.
The code now handles:
- jobs that suspend themselves
- jobs exiting while suspended
- jobs that don't actually suspend at all
Hoewever it still does printfs() from the signal handler, and I haven't yet
stopped it thrashing the signal mask.
with a table that is malloced with 'maxJobs' entries.
Add a 'job_state' field to the Job type that exactly follows which of
the old lists the job was on (or not).
Change all the code that scanned the lists to scan the array.
No logic changes in this commit.
(Soon we'll no longer need to lock out signals for the changes to job
statuses that are done from signal handlers now that there is no linked list.)
This cuts Var_Parse in half! and allows the modifier logic to
be used recursively - when getting modifiers via variables.
Add new unit-test, to check that certain error cases are handled
correctly.
compiler error when building buf.c with -O2, so reduce optimization
level to -O1 for this single file.
To be documented in docs/HACKS, discussed with skrll.