X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=scripts%2FKbuild.include;h=6ec1809a2b373ce54cf00e09bcd96fa616948ff6;hb=e1603156ff96672375970f460716d37a50c63fae;hp=b0d067be739056089fbb09a357bbacc5c0daf6b4;hpb=7d219aab70e6951ab82c27c202cac05016696723;p=oweals%2Fbusybox.git diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index b0d067be7..6ec1809a2 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -61,6 +61,12 @@ as-option = $(shell if $(CC) $(CFLAGS) $(1) -Wa,-Z -c -o /dev/null \ cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) +# hostcc-option +# Usage: hostcflags-y += $(call hostcc-option, -march=winchip-c6, -march=i586) + +hostcc-option = $(shell if $(HOSTCC) $(HOSTCFLAGS) $(1) -S -o /dev/null -xc /dev/null \ + > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) + # cc-option-yn # Usage: flag := $(call cc-option-yn, -march=winchip-c6) cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ @@ -73,7 +79,7 @@ cc-option-align = $(subst -functions=0,,\ # cc-version # Usage gcc-ver := $(call cc-version, $(CC)) -cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \ +cc-version = $(shell PATH="$(PATH)" $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \ $(if $(1), $(1), $(CC))) # cc-ifversion @@ -99,7 +105,7 @@ cmd = @$(echo-cmd) $(cmd_$(1)) objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o))) ### -# if_changed - execute command if any prerequisite is newer than +# if_changed - execute command if any prerequisite is newer than # target, or command line has changed # if_changed_dep - as if_changed, but uses fixdep to reveal dependencies # including used config symbols