build: change CONFIG to CONFIGDIR/CONFIGDIRPREFIX approach

Always require build.conf since /dev/null does not work anymore
due to omission of embedded language versions.

The top view CONFIGDIR is not the low level CONFIGDIR in the
build scripts, but for lack of refactoring noise and a catchy
naming scheme let's just leave it where it is.
This commit is contained in:
Franco Fichtner 2021-02-01 16:35:18 +01:00
parent d8761679ed
commit ba3d075c6e
3 changed files with 18 additions and 14 deletions

View File

@ -55,11 +55,10 @@ lint: lint-steps lint-composite
TOOLSDIR?= /usr/tools
TOOLSBRANCH?= master
CONFIGDIR?= ${TOOLSDIR}/config
SETTINGS?= 21.1
CONFIG?= ${TOOLSDIR}/config/${SETTINGS}/build.conf
.-include "${CONFIG}"
.include "${CONFIGDIR}/${SETTINGS}/build.conf"
# Bootstrap the build options if not set:
@ -92,16 +91,16 @@ PORTSREFURL?= https://git-01.md.hardenedbsd.org/HardenedBSD/hardenedbsd-ports.gi
PORTSREFDIR?= /usr/hardenedbsd-ports
PORTSREFBRANCH?=master
PLUGINSENV?= PLUGIN_PHP=${PHP} PLUGIN_ABI=${SETTINGS} PLUGIN_PYTHON=${PYTHON}
PLUGINSENV?= PLUGIN_PHP=${PHP} PLUGIN_ABI=${ABI} PLUGIN_PYTHON=${PYTHON}
PLUGINSDIR?= /usr/plugins
PLUGINSBRANCH?= stable/${SETTINGS}
PLUGINSBRANCH?= stable/${ABI}
PORTSDIR?= /usr/ports
PORTSBRANCH?= master
COREDIR?= /usr/core
COREBRANCH?= stable/${SETTINGS}
COREENV?= CORE_PHP=${PHP} CORE_ABI=${SETTINGS} CORE_PYTHON=${PYTHON}
COREBRANCH?= stable/${ABI}
COREENV?= CORE_PHP=${PHP} CORE_ABI=${ABI} CORE_PYTHON=${PYTHON}
SRCDIR?= /usr/src
SRCBRANCH?= stable/${SETTINGS}
SRCBRANCH?= stable/${ABI}
EXTRABRANCH?= #master
# A couple of meta-targets for easy use and ordering:
@ -149,7 +148,7 @@ ${STEP}: lint-steps
-m ${MIRRORS:Ox:[1]} -o "${STAGEDIRPREFIX}" -c ${SPEED} \
-b ${SRCBRANCH} -B ${PORTSBRANCH} -e ${PLUGINSBRANCH} \
-g ${TOOLSBRANCH} -E ${COREBRANCH} -G ${PORTSREFBRANCH} \
-H "${COREENV}" -u "${UEFI:tl}" -U "${SUFFIX}" \
-H "${COREENV}" -u "${UEFI:tl}" -U "${SUFFIX}" -i ${CONFIGDIR} \
-V "${ADDITIONS}" -O "${GITBASE}" -r "${SERVER}" \
-q "${VERSIONS}" -h "${PLUGINSENV}" -I "${UPLOADDIR}" \
-D "${EXTRABRANCH}" -A "${PORTSREFURL}" ${${STEP}_ARGS}

View File

@ -47,7 +47,7 @@ All build steps are invoked via make(1):
Available early build options are:
* CONFIG: reads the below from the specified file
* CONFIGDIR: reads settings from the specified directory
* SETTINGS: the name of the requested config directory
Available build options are:
@ -71,8 +71,9 @@ Available build options are:
How to specify build options via configuration file
---------------------------------------------------
The default CONFIG file is under "config/SETTINGS/build.conf".
It can also be overrided by "/dev/null".
The configuration file is required at "CONFIGDIR/SETTINGS/build.conf".
Its contents can be modified to adapt a non-standard build environment
and to avoid excessive Makefile arguments. Use with care.
How to run individual or composite build steps
----------------------------------------------

View File

@ -28,7 +28,7 @@
set -e
OPTS="A:a:B:b:C:c:D:d:E:e:F:f:G:g:H:h:I:K:k:L:l:m:n:O:o:P:p:q:R:r:S:s:T:t:U:u:v:V:"
OPTS="A:a:B:b:C:c:D:d:E:e:F:f:G:g:H:h:I:i:K:k:L:l:m:n:O:o:P:p:q:R:r:S:s:T:t:U:u:v:V:"
while getopts ${OPTS} OPT; do
case ${OPT} in
@ -96,6 +96,9 @@ while getopts ${OPTS} OPT; do
I)
export UPLOADDIR=${OPTARG}
;;
i)
export CONFIGDIRPREFIX=${OPTARG}
;;
L)
if [ -n "${OPTARG}" ]; then
export PRODUCT_SIGNCMD=${OPTARG}
@ -178,6 +181,7 @@ done
shift $((${OPTIND} - 1))
CHECK_MISSING="
CONFIGDIRPREFIX
COREBRANCH
COREDIR
PLUGINSBRANCH
@ -227,7 +231,7 @@ MACHTYPE=${MACHTYPE} PWD=${PWD} GROUP=${GROUP} HOST=${HOST} \
EDITOR=${EDITOR} PAGER=${PAGER} ABI_FILE=${ABI_FILE}"
# define build and config directories
export CONFIGDIR="${TOOLSDIR}/config/${PRODUCT_SETTINGS}"
export CONFIGDIR="${CONFIGDIRPREFIX}/${PRODUCT_SETTINGS}"
export DEVICEDIR="${TOOLSDIR}/device"
export PACKAGESDIR="/.pkg"