make-alpha
[Top][All Lists]
Advanced

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

Re: .ONESHELL enhancement?


From: David Boyce
Subject: Re: .ONESHELL enhancement?
Date: Fri, 25 Sep 2009 13:38:53 -0400

On Wed, Sep 23, 2009 at 3:01 PM, Paul Smith <address@hidden> wrote:
> GNU make already has a method for determining
> if a value for SHELL is a POSIX-y shell or not, used to decide whether
> to even attempt to use the fast path.  I think that method would
> continue to be used unchanged here.

I don't think that works exactly as you describe. In my experience the
fast path is suppressed when SHELL is assigned to, period, regardless
of the value which is assigned. And here's a demo I just ran on
Solaris (where /usr/xpg4/bin/sh is the definitive POSIX-y shell).

.PHONY: all

#SHELL := /usr/xpg4/bin/sh

all:
        /bin/date

% truss -texec -f -a make
19758:  execve("/opt/csw/bin/gmake", 0x0804738C, 0x08047394)  argc = 1
19758:   argv: make
/bin/date
19759:  execve("/bin/date", 0x08093460, 0x080932C0)  argc = 1
19759:   argv: /bin/date
Fri Sep 25 11:55:35 EDT 2009
19758:      Received signal #18, SIGCLD [caught]
19758:        siginfo: SIGCLD CLD_EXITED pid=19759 status=0x0000

[Now edit the Makefile and enable the SHELL= line]

% truss -texec -f -a make
19762:  execve("/opt/csw/bin/gmake", 0x0804738C, 0x08047394)  argc = 1
19762:   argv: make
/bin/date
19763:  execve("/usr/xpg4/bin/sh", 0x08093460, 0x080932C0)  argc = 3
19763:   argv: /usr/xpg4/bin/sh -c /bin/date
19763:  execve("/bin/date", 0x0808EE7C, 0x0808EE88)  argc = 1
19763:   argv: /bin/date
Fri Sep 25 11:56:07 EDT 2009
19762:      Received signal #18, SIGCLD, in waitid() [caught]
19762:        siginfo: SIGCLD CLD_EXITED pid=19763 status=0x0000

There may be a way of determining whether $(SHELL) is POSIX-y but
either it's not used for fast path or it's not working right.

> .ONESHELL and .POSIX wouldn't be at all related _directly_.

Actually they are, in the sense that the spec says you're only
guaranteed POSIX behavior if you (a) include .POSIX and (b) don't
include any nonstandard special targets. Thus the presence of
.ONESHELL explicitly sets you free from POSIX requirements even if
.POSIX is present too.

DSB




reply via email to

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