From 96b498a6d01de87d585621c5a093c716ba69a5d2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 29 Jun 2021 09:27:44 +0200 Subject: [PATCH] Framework: stop guessing build parameters Either we can figure them out at runtime or they were passed by the build system previously. Out of band builds are no longer supported, but can be fixed by specifying the relevant variables like the build would. --- Mk/defaults.mk | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Mk/defaults.mk b/Mk/defaults.mk index 1422232d2..b6fac0244 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -51,6 +51,13 @@ PLUGIN_FLAVOUR?= Base .endif .endif +VERSIONBIN= ${LOCALBASE}/sbin/opnsense-version + +.if exists(${VERSIONBIN}) +_PLUGIN_ABI!= ${VERSIONBIN} -a +PLUGIN_ABI?= ${_PLUGIN_ABI} +.endif + PHPBIN= ${LOCALBASE}/bin/php .if exists(${PHPBIN}) @@ -65,9 +72,11 @@ _PLUGIN_PYTHON!=${PYTHONLINK} -V PLUGIN_PYTHON?= ${_PLUGIN_PYTHON:[2]:S/./ /g:[1..2]:tW:S/ //} .endif -PLUGIN_ABI?= 21.1 -PLUGIN_PHP?= 74 -PLUGIN_PYTHON?= 37 +.for REPLACEMENT in ABI PHP PYTHON +. if empty(PLUGIN_${REPLACEMENT}) +. error Cannot build without PLUGIN_${REPLACEMENT} set +. endif +.endfor REPLACEMENTS= PLUGIN_ABI \ PLUGIN_ARCH \