[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to use a different /bin/sh with GNU Make?
From: |
Mark Galeck |
Subject: |
Re: how to use a different /bin/sh with GNU Make? |
Date: |
Wed, 21 Oct 2015 10:35:27 +0000 (UTC) |
>All you have to do is change the list of UNIX shells to be empty:
diff --git a/job.c b/job.c
index 244def0..4b345b6 100644
--- a/job.c
+++ b/job.c
@@ -423,6 +423,7 @@ is_bourne_compatible_shell (const char *path)
??? Forgive me, but I made the change to empty list of unix shell (to the git
version of Make 4.1 with Paul's patch to take care of NULL ttyname) . Then,
each simple recipe command, like, "touch foobar", goes through the line
execvp (argv[0], argv);
(around line 2500 of job.c)
Here argv is the array "touch" "foobar" . The shell /bin/sh does not know
about this call to execvp at all...
In case of a more complicated command, the situation appears even more strange.
If a recipe command is
touch foobar; touch foobar1
then we call execvp as well, this time on the array of words of
"bin/sh -c touch foobar; touch foobar1"
This is strange, because here, /bin/sh will know about "touch foobar" but will
not know about "touch foobar1".
I want to apologize - this thread was started because I thought, the manual
says that for each recipe line, a new shell process is spawned. Actually, the
manual says that, but later in parenthesis, in the next sentence, says "in
practice, we take shortcuts that do not affect the results). I never read the
second sentence... I mean, perhaps the whole paragraph should be constructed
better, but I should have read everything.
I am just writing this for the record so someone else who tries to plug a
different /bin/sh and finds this thread, is not stumped.
Mark