diff options
Diffstat (limited to 'make_helpers/build_macros.mk')
-rw-r--r-- | make_helpers/build_macros.mk | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index 0c82a715a..9bf26f083 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -104,6 +104,12 @@ define ld_option $(shell if $(LD) $(1) -v >/dev/null 2>&1; then echo $(1); fi ) endef +# Convenience function to check for a given compiler option. A call to +# $(call cc_option, --no-XYZ) will return --no-XYZ if supported by the compiler +define cc_option + $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null >/dev/null 2>&1; then echo $(1); fi ) +endef + # CREATE_SEQ is a recursive function to create sequence of numbers from 1 to # $(2) and assign the sequence to $(1) define CREATE_SEQ |