Follow-up Comment #2, bug #67750 (group make):
> I've suggested in the past that this list become makefile-overridable
That would work too. But I imagine you're probably more interested in
defining the behavior for _your_ shell than providing a new list.
> I've been reduced to making a symlink rksh -> mdsh and invoking it under that
> name in .ONESHELL environments
Yeah, I did something similar at first; I set my shell to "bashx" (which make
did not recognize as a POSIX-style shell) which I used as a wrapper for the
real bash. (Again because I wanted to use bash but without make manipulating
the multi-line recipe string.) That worked for me too, but in the end I
thought the "/usr/bin/env /bin/bash -c ..." work-around felt a little
cleaner.
I guess in your case it's easier to work around with a symlink. (I was
thinking you could also do something sneaky with putting mdsh in .SHELLFLAGS
instead of SHELL, but I'm having trouble getting make to cooperate :-p )
Of course, I guess if all you want to do is avoid the extra [@+-] characters
getting passed to your shell, you could also just remove them manually from
internal lines in your multi-line recipes.
> I think both your problem and mine could be at least partially alleviated by
> allowing the makefile to say what it considers a POSIX shell.
Agreed; but I would emphasize that the whole concept of "POSIX-style shell or
not" is flawed, since POSIX shells can legitimately contain text where leading
whitespace or [@+-] characters are meaningful.
So my perspective is that a makefile author should be able to specify whether
the multi-line .ONESHELL program text is passed VERBATIM or whether leading
special prefix chars (and whitespace) should be REMOVED from each line. It
seems artificial to present the issue as having to do with the shell being
POSIX-style or not.
So, for my case, specify .ONESHELL_VERBATIM to disable recipe mangling for
shells that appear to be POSIX-style, or for your case, specify
.ONESHELL_REMOVE_LEADING_SPECIAL_PREFIX_CHARS to enable it for shells that
don't appear to be.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67750>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
