X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=scripts%2FKbuild.include;h=6ec1809a2b373ce54cf00e09bcd96fa616948ff6;hb=e1603156ff96672375970f460716d37a50c63fae;hp=a7fb4d521255ec0310341a81afc4a11382689db5;hpb=f7996f3b700a22797565e9aa57e251e6e3ac1e4d;p=oweals%2Fbusybox.git diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index a7fb4d521..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