From f3316f132bc73b59c24b31216a45561561ff5ba8 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 22 Dec 2023 18:30:37 +0100 Subject: [PATCH] Correct name and documentation of preprocessor symbol check function It's not remove_unset_options, it's remove_enabled_options (or keep_disabled_options). Signed-off-by: Gilles Peskine --- scripts/common.make | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/common.make b/scripts/common.make index 6d2fbc3e2b..2f27d0ef52 100644 --- a/scripts/common.make +++ b/scripts/common.make @@ -31,19 +31,19 @@ ifdef WINDOWS WINDOWS_BUILD=1 endif -## Usage: $(call remove_unset_options,PREPROCESSOR_INPUT) -## Remove the preprocessor symbols that are not set in the current configuration +## Usage: $(call remove_enabled_options,PREPROCESSOR_INPUT) +## Remove the preprocessor symbols that are set in the current configuration ## from PREPROCESSOR_INPUT. Also normalize whitespace. ## Example: -## $(call remove_unset_options,MBEDTLS_FOO MBEDTLS_BAR) +## $(call remove_set_options,MBEDTLS_FOO MBEDTLS_BAR) ## This expands to an empty string "" if MBEDTLS_FOO and MBEDTLS_BAR are both -## disabled, to "MBEDTLS_FOO" if MBEDTLS_BAR is enabled but MBEDTLS_FOO is +## enabled, to "MBEDTLS_FOO" if MBEDTLS_BAR is enabled but MBEDTLS_FOO is ## disabled, etc. ## ## This only works with a Unix-like shell environment (Bourne/POSIX-style shell ## and standard commands) and a Unix-like compiler (supporting -E). In ## other environments, the output is likely to be empty. -define remove_unset_options +define remove_enabled_options $(strip $(shell exec 2>/dev/null; { echo '#include '; echo $(1); } | @@ -66,11 +66,11 @@ else # Not building for Windows SHARED_SUFFIX= ifndef THREADING # Auto-detect configurations with pthread. - # If the call to remove_unset_options returns "control", the symbols + # If the call to remove_enabled_options returns "control", the symbols # are confirmed set and we link with pthread. # If the auto-detection fails, the result of the call is empty and # we keep THREADING undefined. - ifeq (control,$(call remove_unset_options,control MBEDTLS_THREADING_C MBEDTLS_THREADING_PTHREAD)) + ifeq (control,$(call remove_enabled_options,control MBEDTLS_THREADING_C MBEDTLS_THREADING_PTHREAD)) THREADING := pthread endif endif