git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Lattarini <stefano.lattarini@gmail.com>
To: Thomas Rast <trast@inf.ethz.ch>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH] build: avoid possible confusion between GNU/XPG4 make on Solaris
Date: Fri, 02 Mar 2012 10:41:42 +0100	[thread overview]
Message-ID: <4F5095D6.6050401@gmail.com> (raw)
In-Reply-To: <87obsfcpnc.fsf@thomas.inf.ethz.ch>

On 03/02/2012 10:34 AM, Thomas Rast wrote:
> Stefano Lattarini <stefano.lattarini@gmail.com> writes:
> 
>> +# FIXME: this is ugly, and which(1) is quite unportable.  Find a better
>> +# 	 way to obtain the same effect.
>> +MAKE := $(shell set $(MAKE); m1=$$1; shift; \
>> +                m2=`which $$m1 2>/dev/null` && test -n "$$m2" || m2=$$m1; \
>> +                echo "$$m2 $$*")
> 
> There's 'command -v make'.  'man 1p command' on my system (opensuse
> installs a bunch of POSIX reference material) says
> 
>        -v     (On  systems  supporting  the  User  Portability Utilities
>               option.) Write a string to standard output that  indicates
>               the pathname or command that will be used by the shell, in
>               the current shell execution environment (see Shell  Execu-
>               tion  Environment  ),  to  invoke command_name, but do not
>               invoke command_name.
> 
>                * Utilities, regular  built-in  utilities,  command_names
>                  including  a  slash  character, and any implementation-
>                  defined functions that are found using the  PATH  vari-
>                  able  (as  described in Command Search and Execution ),
>                  shall be written as absolute pathnames.
> 
> So perhaps enough systems including Solaris "support the User
> Portability Utilities option", and you can use this?
> 
Thanks, I had completely forgotten about this "trick".  It works correctly
with both /bin/sh and /bin/ksh on all of NetBSD 5.1, OpenBSD 5.0 and
Solaris 10, as well as with bash (4.1.5) and dash (0.5.5.1) on my Debian
unstable.  I will post an updated patch later today (or this evening).

Regards,
  Stefano

  reply	other threads:[~2012-03-02  9:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02  9:13 [RFC/PATCH] build: avoid possible confusion between GNU/XPG4 make on Solaris Stefano Lattarini
2012-03-02  9:34 ` Thomas Rast
2012-03-02  9:41   ` Stefano Lattarini [this message]
2012-03-02 10:18     ` [PATCH v2] " Stefano Lattarini
2012-03-02 18:35 ` [RFC/PATCH] " Junio C Hamano
2012-03-02 19:00   ` Stefano Lattarini
2012-03-02 19:46     ` Junio C Hamano
2012-03-09 12:43   ` [PATCH] configure: allow user to prevent $PATH "sanitization" " Stefano Lattarini
2012-03-09 16:29     ` Junio C Hamano
2012-03-09 19:46     ` Junio C Hamano
2012-03-09 21:46       ` Stefano Lattarini
2012-03-09 21:59         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F5095D6.6050401@gmail.com \
    --to=stefano.lattarini@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=trast@inf.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).