while setting up a child process. This prevents the major sources of
list inconsistencies that may result from doing list manipulations
from a signal handler.
XXX - all Lst_*() operations are at risk; look for ways to avoid touching
so much global state from the signal handlers.
- don't block the signal we're about to send to ourselves to
take the default action for
- restore the signal handler for the current signal
- remove duplicate sigprocmask() call
As a result, restoring the SIGTSTP handler in JobContinueSig() is no longer
necessary.
make sure that the dir actually exists. In compat mode the corresponding
chdir simply fails and all is well - the issue only arises when playing
tricky games with the value of .CURDIR.
Reviewed: christos
1. make -dx turns on DEBUG_SHELL which causes sh -x to be used where
possible.
2. PrintOnError() is now called when make is stopping due to an error.
This routine reports the curdir and the value of any variables listed
in MAKE_PRINT_VAR_ON_ERROR.
3. Variables set via command line, are propagated to child-makes via
MAKEFLAGS. This behaviour appears to be necessary for POSIX (according
to the GNU folk anyway).
4. Do not reset MAKEFILE when reading ".depend" as this rather eliminates the
usefulness of ${MAKEFILE}.
5. Added ${.newline} as a simple means of being able to include \n in the
result of a :@ loop expansion.
6. Set ${MAKE_VERSION} if defined. Need to come up with a useful value.
Reviewed: christos
- install SIGCONT handler which reestablishes SIGTSTP handler and then calls
JobRestartJobs() to restart all the suspended jobs.
- when SIGTSTP is handled, call JobCatchChildren() so *** Suspended messages
get printed before make stops rather than after.
Add -N flag to *really* not execute any commands (useful when using
the -d flags to debug usr/src/Makefile)
Document -N
Update documentation of -n to mention that it still executes commands
for targets marked .MAKE so that the -N/-n distinction is clear.
use -j; all make's in a recursive build cooperate to limit the total
number of jobs, using a token-passing scheme.
The current token passing algorithm is similar to the one implemented
by gmake; there is a single pipe which is inherited through the entire
process hierarchy; tokens are obtained by reading a byte from the
"read end" of the pipe, and are returned by writing them to the "write
end". This exact algorithm is likely to change in the future.
Implementation details:
- Use the new trace facility to allow measurement of the
effectiveness of different token-passing schemes
- Get a token in MakeStartJobs(), return it in Make_Update()
- Eliminate Job_Full() and the jobFull global since they are
redundant with token system.
- Add an "internal" -J option (to pass the token pipe fd's down to
submakes) and a -T option for tracing.
- Change how compatMake is forced so that -j means something when
inherited by submakes.
- When waiting for a token, poll the token-passing pipe as well as
the output pipes of existing jobs.
poll() for parallel make:
- Make the poll() code behave more like the select() code: sleep for
a bit waiting for output rather than busy-wait (eww).
- Install a no-op SIGCHLD handler so that poll/select wake up early
(with -1/EINTR) when a child exits.
- Change the default sleep time from 500ms to 5 seconds since we now
wake up promptly when a child exits.
try to open tfile many times, passing bad strings to mkstemp
2. remove extra semicolon after the MESSAGE macro
3. more error checking
4. be more careful about setting things to NULL after freeing.
5. fix a comment that does not apply anymore
Firstly, we ignore getenv("PWD") if MAKEOBJDIRPREFIX is set so that we always
get the same value for .CURDIR regardless of how make was invoked.
Second, when executing a command we check if it is ${.MAKE} or ${.MAKE:T}
without a preceeding chdir, if so we insert a chdir(${.CURDIR}) so that
the Makefile will be found by the child make. Note that this behaviour is
dissabled if MAKEOBJDIRPREFIX is not set or if NOCHECKMAKECHDIR is set.
See the comments in main.c for more detail.
With these two changes, one can successfully build usr/src using MAKEOBJDIRPREFIX
allowing the src to be mounted from a CD-ROM.