From d9df92e22aca939857c5bc9ecb130ef22307ccc1 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Fri, 7 Apr 2006 08:36:49 +0200 Subject: kbuild: properly pass options to hostcc when doing make O=.. This fix a longstanding bug where proper options was not passed to hostcc in case of a make O=.. build. This bug showed up in (not yet merged) klibc, and is not known to have any counterpart in-kernel. Fixed by moving the flags macro to Kbuild.include so it can be used by both Makefile.lib and Makefile.host. Signed-off-by: Sam Ravnborg --- scripts/Kbuild.include | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts/Kbuild.include') diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 59620b1554e0..b0d067be7390 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -87,6 +87,11 @@ cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \ # $(Q)$(MAKE) $(build)=dir build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj +# Prefix -I with $(srctree) if it is not an absolute path +addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1) +# Find all -I options and call addtree +flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) + # If quiet is set, only print short version of command cmd = @$(echo-cmd) $(cmd_$(1)) -- cgit v1.2.3