diff mbox series

[1/2] kbuild: add host-cc-option helper

Message ID 20240312-gcc-plugins-gmp-v1-1-c5e082437b9e@linutronix.de (mailing list archive)
State Rejected
Headers show
Series gcc-plugins: disable plugins when gmp.h is unavailable | expand

Commit Message

Thomas Weißschuh March 12, 2024, 3:03 p.m. UTC
This helper works the same as cc-option but for the host compiler.
It will be used by the gcc-plugins configuration to check for the gmp.h
header.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 scripts/Kconfig.include | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
index 3ee8ecfb8c04..84368e23b072 100644
--- a/scripts/Kconfig.include
+++ b/scripts/Kconfig.include
@@ -27,6 +27,10 @@  failure = $(if-success,$(1),n,y)
 # Return y if the compiler supports <flag>, n otherwise
 cc-option = $(success,trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$/tmp.o)
 
+# $(host-cc-option,<flag>)
+# Return y if the host compiler supports <flag>, n otherwise
+host-cc-option = $(success,trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(HOSTCC) -Werror $(HOSTCFLAGS) $(1) -c -x c /dev/null -o .tmp_$$/tmp.o)
+
 # $(ld-option,<flag>)
 # Return y if the linker supports <flag>, n otherwise
 ld-option = $(success,$(LD) -v $(1))