^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) feature_dir := $(srctree)/tools/build/feature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) ifneq ($(OUTPUT),)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) OUTPUT_FEATURES = $(OUTPUT)feature/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) $(shell mkdir -p $(OUTPUT_FEATURES))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) feature_check = $(eval $(feature_check_code))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) define feature_check_code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CC="$(CC)" CXX="$(CXX)" CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" CXXFLAGS="$(EXTRA_CXXFLAGS) $(FEATURE_CHECK_CXXFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(feature_dir) $(OUTPUT_FEATURES)test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) endef
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) feature_set = $(eval $(feature_set_code))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) define feature_set_code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) feature-$(1) := 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) endef
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) # Build the feature check binaries in parallel, ignore errors, ignore return value and suppress output:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) # Note that this is not a complete list of all feature tests, just
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) # those that are typically built on a fully configured system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) # [ Feature tests not mentioned here have to be built explicitly in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) # the rule that uses them - an example for that is the 'bionic'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) # feature check. ]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) FEATURE_TESTS_BASIC := \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) backtrace \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) dwarf \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) dwarf_getlocations \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) eventfd \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) fortify-source \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) sync-compare-and-swap \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) get_current_dir_name \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) gettid \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) glibc \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) libbfd \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) libbfd-buildid \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) libcap \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) libelf \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) libelf-getphdrnum \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) libelf-gelf_getnote \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) libelf-getshdrstrndx \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) libnuma \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) numa_num_possible_cpus \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) libperl \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) libpython \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) libslang \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) libslang-include-subdir \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) libcrypto \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) libunwind \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) pthread-attr-setaffinity-np \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) pthread-barrier \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) reallocarray \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) stackprotector-all \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) timerfd \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) libdw-dwarf-unwind \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) zlib \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) lzma \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) get_cpuid \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) bpf \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) sched_getcpu \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) sdt \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) setns \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) libaio \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) libzstd \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) disassembler-four-args \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) file-handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) # of all feature tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) FEATURE_TESTS_EXTRA := \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) bionic \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) compile-32 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) compile-x32 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) cplus-demangle \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) gtk2 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) gtk2-infobar \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) hello \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) libbabeltrace \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) libbfd-liberty \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) libbfd-liberty-z \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) libopencsd \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) libunwind-x86 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) libunwind-x86_64 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) libunwind-arm \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) libunwind-aarch64 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) libunwind-debug-frame \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) libunwind-debug-frame-arm \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) libunwind-debug-frame-aarch64 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) cxx \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) llvm \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) llvm-version \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) clang \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) libbpf \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) libpfm4 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) libdebuginfod
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) FEATURE_TESTS ?= $(FEATURE_TESTS_BASIC)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) ifeq ($(FEATURE_TESTS),all)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) FEATURE_TESTS := $(FEATURE_TESTS_BASIC) $(FEATURE_TESTS_EXTRA)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) FEATURE_DISPLAY ?= \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) dwarf \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) dwarf_getlocations \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) glibc \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) libbfd \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) libbfd-buildid \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) libcap \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) libelf \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) libnuma \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) numa_num_possible_cpus \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) libperl \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) libpython \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) libcrypto \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) libunwind \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) libdw-dwarf-unwind \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) zlib \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) lzma \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) get_cpuid \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) bpf \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) libaio \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) libzstd \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) disassembler-four-args
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) # Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) # If in the future we need per-feature checks/flags for features not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) # mentioned in this list we need to refactor this ;-).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) set_test_all_flags = $(eval $(set_test_all_flags_code))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) define set_test_all_flags_code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) FEATURE_CHECK_CFLAGS-all += $(FEATURE_CHECK_CFLAGS-$(1))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) FEATURE_CHECK_LDFLAGS-all += $(FEATURE_CHECK_LDFLAGS-$(1))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) endef
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) $(foreach feat,$(FEATURE_TESTS),$(call set_test_all_flags,$(feat)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) # Special fast-path for the 'all features are available' case:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) $(call feature_check,all,$(MSG))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) # Just in case the build freshly failed, make sure we print the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) # feature matrix:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) ifeq ($(feature-all), 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) # test-all.c passed - just set all the core feature flags to 1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) $(foreach feat,$(FEATURE_TESTS),$(call feature_set,$(feat)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) # test-all.c does not comprise these tests, so we need to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) # for this case to get features proper values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) $(call feature_check,compile-32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) $(call feature_check,compile-x32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) $(call feature_check,bionic)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) $(call feature_check,libbabeltrace)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) $(foreach feat,$(FEATURE_TESTS),$(call feature_check,$(feat)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) # Print the result of the feature test:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) feature_print_status = $(eval $(feature_print_status_code)) $(info $(MSG))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) define feature_print_status_code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) ifeq ($(feature-$(1)), 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) MSG = $(shell printf '...%30s: [ \033[32mon\033[m ]' $(1))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) MSG = $(shell printf '...%30s: [ \033[31mOFF\033[m ]' $(1))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) endef
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) feature_print_text = $(eval $(feature_print_text_code)) $(info $(MSG))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) define feature_print_text_code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) MSG = $(shell printf '...%30s: %s' $(1) $(2))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) endef
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) # generates feature value assignment for name, like:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) # $(call feature_assign,dwarf) == feature-dwarf=1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) feature_assign = feature-$(1)=$(feature-$(1))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) FEATURE_DUMP := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) feature_dump_check = $(eval $(feature_dump_check_code))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) define feature_dump_check_code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) ifeq ($(findstring $(1),$(FEATURE_DUMP)),)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) $(2) := 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) endef
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) # First check if any test from FEATURE_DISPLAY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) # and set feature_display := 1 if it does
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) $(foreach feat,$(FEATURE_DISPLAY),$(call feature_dump_check,$(call feature_assign,$(feat)),feature_display))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) # Now also check if any other test changed,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) # so we force FEATURE-DUMP generation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) $(foreach feat,$(FEATURE_TESTS),$(call feature_dump_check,$(call feature_assign,$(feat)),feature_dump_changed))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) # The $(feature_display) controls the default detection message
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) # output. It's set if:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) # - detected features differes from stored features from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) # last build (in $(FEATURE_DUMP_FILENAME) file)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) # - one of the $(FEATURE_DISPLAY) is not detected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) # - VF is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) ifeq ($(feature_dump_changed),1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) $(shell rm -f $(FEATURE_DUMP_FILENAME))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) $(foreach feat,$(FEATURE_TESTS),$(shell echo "$(call feature_assign,$(feat))" >> $(FEATURE_DUMP_FILENAME)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) feature_display_check = $(eval $(feature_check_display_code))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) define feature_check_display_code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) ifneq ($(feature-$(1)), 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) feature_display := 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) endef
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) $(foreach feat,$(FEATURE_DISPLAY),$(call feature_display_check,$(feat)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) ifeq ($(VF),1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) feature_display := 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) feature_verbose := 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) ifeq ($(feature_display),1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) $(info )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) $(info Auto-detecting system features:)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) $(foreach feat,$(FEATURE_DISPLAY),$(call feature_print_status,$(feat),))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) ifneq ($(feature_verbose),1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) $(info )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) ifeq ($(feature_verbose),1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) TMP := $(filter-out $(FEATURE_DISPLAY),$(FEATURE_TESTS))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) $(foreach feat,$(TMP),$(call feature_print_status,$(feat),))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) $(info )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) endif