help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to use a different /bin/sh with GNU Make?


From: David Boyce
Subject: Re: how to use a different /bin/sh with GNU Make?
Date: Thu, 15 Oct 2015 05:49:50 -0700

It may still be possible to work around these issues via e.g. the environment.

MAKEFLAGS='SHELL=//bin/sh’ make

This does two things:

1. By putting the setting in the environment it may survive through
intermediate scripts (I thought make did this internally anyway but am
not positive).
2. The extraneous slash in //bin/sh defeats the string match, making a
modification of the binary unnecessary.

On Wed, Oct 14, 2015 at 9:15 PM, Mark Galeck <address@hidden> wrote:
> All right, after all I will have to modify Make source code.
>
> David's idea is very good... for recursive Make systems.
>
> Unfortunately in practice, a system like does not just have Make calls
> itself recursively, that would be too simple :)
>
> It has Make call various scripts, which then may call Make and so on and so
> forth...  Really, the only fool-proof way in such cases, to change the
> shell, is to replace /bin/sh and, it looks like, hack Make a little bit to
> make it always call the shell.
>
> Paul gave me the hack, unfortunately, it is for 4.1, when I tried to do the
> similar thing for 3.81, it did not work.  I can't use 4.1 because it
> segfaults for me.
>
> Have to understand 3.81 code better...
>
> Thank you everybody for your help
>
>
>
>
> ________________________________
> From: David Boyce <address@hidden>
> To: Mark Galeck <address@hidden>
> Cc: Reinier Post <address@hidden>; "address@hidden"
> <address@hidden>
> Sent: Tuesday, October 13, 2015 12:23 PM
> Subject: Re: how to use a different /bin/sh with GNU Make?
>
> I haven’t followed this whole thread, so apologies if I missed
> something, but you should be able to simply override SHELL on the
> command line and it will propagate into child makes. Example below.
> Also, for the debugging you’re trying to do: there’s an old series
> called “Ask Mr Make” (google it) with lots of useful techniques. I
> think his article “Tracing Rule Execution”
> (http://www.cmcrossroads.com/article/tracing-rule-execution-gnu-make)
> might be illuminating about ways to do this without hacking make or
> /bin/sh.
>
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]