Hi,

The attached patch modifies configure to generate assignments in
config.make with the = operator instead of ?=.  That's to prevent
build settings from being overridden through the environment, which
might be surprising/dangerous.

All the best.
Mario
-- 
https://parenteses.org/mario
>From ff753ca1723d4c9f069081c558e6a1ee90fc9e78 Mon Sep 17 00:00:00 2001
From: Mario Domenech Goulart <[email protected]>
Date: Thu, 14 May 2026 16:45:05 +0200
Subject: [PATCH] configure: Make config.make settings not overridable through
 the environment

Setting build parameters with ?= in config.make makes it possible to
override them though the environment, which can cause surprises and
even be dangerous.

This change uses = for assigments in config.make, which prevents
settings in config.make from being overridden through the environment.

Build settings configured in config.make can still be overridden in
make invocations as command line arguments (e.g., make PREFIX=...).
---
 configure | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/configure b/configure
index d09a045f..5672f80a 100755
--- a/configure
+++ b/configure
@@ -258,22 +258,22 @@ else
 fi
 
 echo "# GENERATED BY configure" > config.make
-echo "PLATFORM ?= $platform" >> config.make
-echo "PREFIX ?= $prefix" >> config.make
-test -n "$debug" && echo "DEBUGBUILD ?= 1" >> config.make
-test -n "$static" && echo "STATICBUILD ?= 1" >> config.make
-test -n "$CC" && echo "C_COMPILER ?= $cccmd" >> config.make
-test -n "$linker" && echo "LINKER ?= $linker" >> config.make
-test -n "$CFLAGS" && echo "C_COMPILER_OPTIMIZATION_OPTIONS ?= $CFLAGS" >> config.make
-test -n "$host" && echo "HOSTSYSTEM ?= $host" >> config.make
-test -n "$target" && echo "TARGETSYSTEM ?= $target" >> config.make
-test -n "$pprefix" && echo "PROGRAM_PREFIX ?= $pprefix" >> config.make
-test -n "$psuffix" && echo "PROGRAM_SUFFIX ?= $psuffix" >> config.make
-test -n "$tprefix" && echo "TARGET_PREFIX ?= $tprefix" >> config.make
-test -n "$srcdir" && echo "SRCDIR ?= $srcdir" >> config.make
-test -n "$vardir" && echo "VARDIR ?= $vardir" >> config.make
-test -n "$chicken" && echo "CHICKEN ?= $chicken" >> config.make
-test -n "$pobjs" && echo "PROFILE_OBJECTS ?= $pobjs" >> config.make
+echo "PLATFORM = $platform" >> config.make
+echo "PREFIX = $prefix" >> config.make
+test -n "$debug" && echo "DEBUGBUILD = 1" >> config.make
+test -n "$static" && echo "STATICBUILD = 1" >> config.make
+test -n "$CC" && echo "C_COMPILER = $cccmd" >> config.make
+test -n "$linker" && echo "LINKER = $linker" >> config.make
+test -n "$CFLAGS" && echo "C_COMPILER_OPTIMIZATION_OPTIONS = $CFLAGS" >> config.make
+test -n "$host" && echo "HOSTSYSTEM = $host" >> config.make
+test -n "$target" && echo "TARGETSYSTEM = $target" >> config.make
+test -n "$pprefix" && echo "PROGRAM_PREFIX = $pprefix" >> config.make
+test -n "$psuffix" && echo "PROGRAM_SUFFIX = $psuffix" >> config.make
+test -n "$tprefix" && echo "TARGET_PREFIX = $tprefix" >> config.make
+test -n "$srcdir" && echo "SRCDIR = $srcdir" >> config.make
+test -n "$vardir" && echo "VARDIR = $vardir" >> config.make
+test -n "$chicken" && echo "CHICKEN = $chicken" >> config.make
+test -n "$pobjs" && echo "PROFILE_OBJECTS = $pobjs" >> config.make
 
 echo
 echo "now run ${mkcmd} to build the system"
-- 
2.47.3

  • [PATCH] configure: Make config.... Mario Domenech Goulart via Chicken-hackers

Reply via email to