From d78060bda6bb2ef2e1948bd6377204898dab2264 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 16 Dec 2025 14:43:57 +0100 Subject: [PATCH] Get a clean run from make --warn-undefined-variables Except in psasim, which I am not touching at this time. Signed-off-by: Gilles Peskine --- scripts/common.make | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/common.make b/scripts/common.make index 63be983cd4..5350d87efc 100644 --- a/scripts/common.make +++ b/scripts/common.make @@ -95,6 +95,16 @@ $(strip $(shell )) endef +# Ensure that `THREADING` is always defined. This lets us get a clean run +# with `make --warn-undefined-variables` without making the conditionals +# below more complex than they already are. At this stage, if `$(THREADING)` +# is empty, it means we don't know yet whether the threading implementation +# requires extra `LDFLAGS`. Once we've done the analysis, if `$(THREADING)` +# is empty, it will mean that no extra `LDFLAGS` are required, either +# because threading is disabled or because the threading implementation +# doesn't require any extra `LDFLAGS`. +THREADING ?= + ifdef WINDOWS_BUILD DLEXT=dll EXEXT=.exe @@ -107,7 +117,7 @@ else # Not building for Windows DLEXT ?= so EXEXT= SHARED_SUFFIX= - ifndef THREADING + ifeq ($(THREADING),) # Auto-detect configurations with pthread. # If the call to remove_enabled_options returns "control", the symbols # are confirmed set and we link with pthread. @@ -123,6 +133,8 @@ else # Not building for Windows endif endif +PERL ?= perl + ifdef WINDOWS PYTHON ?= python else