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
Thomas Rast <trast@inf.ethz.ch>
Date
Mar 2, 2012, 09:34 UTC
Message-ID
<87obsfcpnc.fsf@thomas.inf.ethz.ch>
In-Reply-To
<df98ed215324f521f3aaff7fa4ba41ba2a1894dc.1330679536.git.stefano.lattarini@gmail.com>
Stefano Lattarini <stefano.lattarini@gmail.com> writes:
Show 5 quoted lines
> +# 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?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Stefano LattariniNext: Stefano Lattarini
Message 2 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.