git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] build: avoid possible confusion between GNU/XPG4 make on Solaris

From
Stefano Lattarini <stefano.lattarini@gmail.com>
Date
Mar 2, 2012, 09:41 UTC
Message-ID
<4F5095D6.6050401@gmail.com>
In-Reply-To
<87obsfcpnc.fsf@thomas.inf.ethz.ch>
On 03/02/2012 10:34 AM, Thomas Rast wrote:
Show 27 quoted lines
> 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
Previous: Thomas RastNext: Stefano Lattarini
Message 3 of 12 in “build: avoid possible confusion between GNU/XPG4 make on Solaris”
  1. build: avoid possible confusion between GNU/XPG4 make on SolarisStefano Lattarini, Mar 2, 2012
  2. Thomas RastMar 2, 2012
  3. Stefano LattariniMar 2, 2012
  4. build: avoid possible confusion between GNU/XPG4 make on SolarisStefano Lattarini, Mar 2, 2012
  5. Junio C HamanoMar 2, 2012
  6. Stefano LattariniMar 2, 2012
  7. Junio C HamanoMar 2, 2012
  8. configure: allow user to prevent $PATH "sanitization" on SolarisStefano Lattarini, Mar 9, 2012
  9. Junio C HamanoMar 9, 2012
  10. Junio C HamanoMar 9, 2012
  11. Stefano LattariniMar 9, 2012
  12. Junio C HamanoMar 9, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.