public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/Kbuild.include: Fix portability problem of "echo -e"
@ 2012-02-26 17:35 Bernhard Walle
  2012-02-26 17:48 ` Sam Ravnborg
  2012-02-28 23:37 ` Andreas Bießmann
  0 siblings, 2 replies; 7+ messages in thread
From: Bernhard Walle @ 2012-02-26 17:35 UTC (permalink / raw)
  To: mmarek; +Cc: lacombar, linux-kernel

"echo -e" is a GNU extension. When cross-compiling the kernel on a
BSD-like operating system (Mac OS X in my case), this doesn't work.

One could install a GNU version of echo, put that in the $PATH before
the system echo and use "/usr/bin/env echo", but the solution with
printf is simpler.

Since it is no disadvantage on Linux, I hope that gets accepted even if
cross-compiling the Linux kernel on another Unix operating system is
quite a rare use case.

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
---
 scripts/Kbuild.include |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index d897278..6a3ee98 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -104,7 +104,7 @@ as-option = $(call try-run,\
 # Usage: cflags-y += $(call as-instr,instr,option1,option2)
 
 as-instr = $(call try-run,\
-	/bin/echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))
+	printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))
 
 # cc-option
 # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
-- 
1.7.9


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

end of thread, other threads:[~2012-03-24 22:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-26 17:35 [PATCH] scripts/Kbuild.include: Fix portability problem of "echo -e" Bernhard Walle
2012-02-26 17:48 ` Sam Ravnborg
2012-02-26 17:51   ` Bernhard Walle
2012-02-26 21:05     ` Sam Ravnborg
2012-03-19 17:44       ` Bernhard Walle
2012-03-24 22:33         ` Michal Marek
2012-02-28 23:37 ` Andreas Bießmann

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