Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [/bin/sh which ar]  should be [/bin/sh -c "which ar"]
@ 2007-07-08  4:35 Ulf Samuelsson
  2007-07-08 10:28 ` Bernhard Fischer
  0 siblings, 1 reply; 2+ messages in thread
From: Ulf Samuelsson @ 2007-07-08  4:35 UTC (permalink / raw)
  To: buildroot

When the host tools are determined in the top Makefile
(every time make us run) 
this fails 5 times with the error message:

/usr/bin/which: /usr/bin/which: cannot execute binary file

What happens inside the Makefile is that a command is run:
$ /bin/sh which ar
and the bash shell does not like this on my OpenSuSE 10.2 system
$ /bin/sh -c "which ar"
will do what we want, so I would like to apply the following patch
Any comments?

Index: Makefile
===================================================================
--- Makefile    (revision 19026)
+++ Makefile    (arbetskopia)
@@ -78,11 +78,11 @@
 ifndef HOSTLD
 HOSTLD:=ld
 endif
-HOSTAR:=$(shell $(CONFIG_SHELL) which $(HOSTAR) || type -p $(HOSTAR) ||
echo ar)
-HOSTAS:=$(shell $(CONFIG_SHELL) which $(HOSTAS) || type -p $(HOSTAS) ||
echo as)
-HOSTCC:=$(shell $(CONFIG_SHELL) which $(HOSTCC) || type -p $(HOSTCC) ||
echo gcc)
-HOSTCXX:=$(shell $(CONFIG_SHELL) which $(HOSTCXX) || type -p $(HOSTCXX)
|| echo g++)
-HOSTLD:=$(shell $(CONFIG_SHELL) which $(HOSTLD) || type -p $(HOSTLD) ||
echo ld)
+HOSTAR :=$(shell $(CONFIG_SHELL) -c "which $(HOSTAR)"  || type -p
$(HOSTAR)  || echo ar)
+HOSTAS :=$(shell $(CONFIG_SHELL) -c "which $(HOSTAS)"  || type -p
$(HOSTAS)  || echo as)
+HOSTCC :=$(shell $(CONFIG_SHELL) -c "which $(HOSTCC)"  || type -p
$(HOSTCC)  || echo gcc)
+HOSTCXX:=$(shell $(CONFIG_SHELL) -c "which $(HOSTCXX)" || type -p
$(HOSTCXX) || echo g++)
+HOSTLD :=$(shell $(CONFIG_SHELL) -c "which $(HOSTLD)"  || type -p
$(HOSTLD)  || echo ld)
 ifndef CFLAGS_FOR_BUILD
 CFLAGS_FOR_BUILD:=-g -O2
 endif

Best Regards
Ulf Samuelsson

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Buildroot] [/bin/sh which ar] should be [/bin/sh -c "which ar"]
  2007-07-08  4:35 [Buildroot] [/bin/sh which ar] should be [/bin/sh -c "which ar"] Ulf Samuelsson
@ 2007-07-08 10:28 ` Bernhard Fischer
  0 siblings, 0 replies; 2+ messages in thread
From: Bernhard Fischer @ 2007-07-08 10:28 UTC (permalink / raw)
  To: buildroot

On Sun, Jul 08, 2007 at 06:35:39AM +0200, Ulf Samuelsson wrote:
>When the host tools are determined in the top Makefile
>(every time make us run) 
>this fails 5 times with the error message:
>
>/usr/bin/which: /usr/bin/which: cannot execute binary file
>
>What happens inside the Makefile is that a command is run:
>$ /bin/sh which ar
>and the bash shell does not like this on my OpenSuSE 10.2 system
>$ /bin/sh -c "which ar"
>will do what we want, so I would like to apply the following patch
>Any comments?

ok, please apply.

Thanks,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-08 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-08  4:35 [Buildroot] [/bin/sh which ar] should be [/bin/sh -c "which ar"] Ulf Samuelsson
2007-07-08 10:28 ` Bernhard Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox