Re: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-04 Thread Masahiro Yamada
On Tue, Jun 4, 2019 at 6:01 PM David Laight wrote: > > From: Masahiro Yamada > > Sent: 04 June 2019 04:31 > ... > > > > > You could use: > > > > > $(shell sh -c "command -v $(c)gcc") > > > > > or maybe: > > > > > $(shell command$${x:+} -v $(c)gcc) > > > > > > > > > > > > How about

RE: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-04 Thread David Laight
From: Masahiro Yamada > Sent: 04 June 2019 04:31 ... > > > > You could use: > > > > $(shell sh -c "command -v $(c)gcc") > > > > or maybe: > > > > $(shell command$${x:+} -v $(c)gcc) > > > > > > > > > How about this? > > > > > > $(shell : ~; command -v $(c)gcc) > > > >

Re: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-03 Thread Masahiro Yamada
On Mon, Jun 3, 2019 at 9:43 PM David Laight wrote: > > From: Masahiro Yamada > > Sent: 03 June 2019 12:45 > > On Mon, Jun 3, 2019 at 8:16 PM David Laight wrote: > > > > > > From: Masahiro Yamada > > > > Sent: 03 June 2019 11:49 > > > > > > > > To print the pathname that will be used by shell in

Re: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-03 Thread Masahiro Yamada
On Mon, Jun 3, 2019 at 10:09 PM David Laight wrote: > > From: Masahiro Yamada > > Sent: 03 June 2019 12:38 > > Hi David, > > > > On Mon, Jun 3, 2019 at 8:14 PM David Laight wrote: > > > > > > From: Masahiro Yamada > > > > Sent: 03 June 2019 11:49 > > > > > > > > To print the pathname that will

RE: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-03 Thread David Laight
From: Masahiro Yamada > Sent: 03 June 2019 12:38 > Hi David, > > On Mon, Jun 3, 2019 at 8:14 PM David Laight wrote: > > > > From: Masahiro Yamada > > > Sent: 03 June 2019 11:49 > > > > > > To print the pathname that will be used by shell in the current > > > environment, 'command -v' is a

RE: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-03 Thread David Laight
From: Masahiro Yamada > Sent: 03 June 2019 12:45 > On Mon, Jun 3, 2019 at 8:16 PM David Laight wrote: > > > > From: Masahiro Yamada > > > Sent: 03 June 2019 11:49 > > > > > > To print the pathname that will be used by shell in the current > > > environment, 'command -v' is a standardized way. [1]

Re: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-03 Thread Masahiro Yamada
On Mon, Jun 3, 2019 at 8:16 PM David Laight wrote: > > From: Masahiro Yamada > > Sent: 03 June 2019 11:49 > > > > To print the pathname that will be used by shell in the current > > environment, 'command -v' is a standardized way. [1] > > > > 'which' is also often used in scripting, but it is not

Re: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-03 Thread Masahiro Yamada
Hi David, On Mon, Jun 3, 2019 at 8:14 PM David Laight wrote: > > From: Masahiro Yamada > > Sent: 03 June 2019 11:49 > > > > To print the pathname that will be used by shell in the current > > environment, 'command -v' is a standardized way. [1] > > > > 'which' is also often used in scripting,

RE: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-03 Thread David Laight
From: Masahiro Yamada > Sent: 03 June 2019 11:49 > > To print the pathname that will be used by shell in the current > environment, 'command -v' is a standardized way. [1] > > 'which' is also often used in scripting, but it is not portable. All uses of 'which' should be expunged. It is a bourne

RE: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-03 Thread David Laight
From: Masahiro Yamada > Sent: 03 June 2019 11:49 > > To print the pathname that will be used by shell in the current > environment, 'command -v' is a standardized way. [1] > > 'which' is also often used in scripting, but it is not portable. > > When I worked on commit bd55f96fa9fc ("kbuild:

RE: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-03 Thread Alexey Brodkin
e > ; Masahiro > Yamada ; linux-snps-...@lists.infradead.org > Subject: [PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix [snip] > Fixes: bd55f96fa9fc ("kbuild: refactor cc-cross-prefix implementation") > Cc: linux-stable # 5.1 > Reported-

[PATCH] kbuild: use more portable 'command -v' for cc-cross-prefix

2019-06-03 Thread Masahiro Yamada
To print the pathname that will be used by shell in the current environment, 'command -v' is a standardized way. [1] 'which' is also often used in scripting, but it is not portable. When I worked on commit bd55f96fa9fc ("kbuild: refactor cc-cross-prefix implementation"), I was eager to use