1 # shellcheck shell=bash disable=SC2206
3 mesonConfigurePhase
() {
6 : ${mesonBuildDir:=build}
10 if [ -z "${dontAddPrefix-}" ]; then
11 flagsArray
+=("--prefix=$prefix")
14 # See multiple-outputs.sh and meson’s coredata.py
16 "--libdir=${!outputLib}/lib"
17 "--libexecdir=${!outputLib}/libexec"
18 "--bindir=${!outputBin}/bin"
19 "--sbindir=${!outputBin}/sbin"
20 "--includedir=${!outputInclude}/include"
21 "--mandir=${!outputMan}/share/man"
22 "--infodir=${!outputInfo}/share/info"
23 "--localedir=${!outputLib}/share/locale"
24 "-Dauto_features=${mesonAutoFeatures:-enabled}"
25 "-Dwrap_mode=${mesonWrapMode:-nodownload}"
26 "--buildtype=${mesonBuildType:-plain}"
29 concatTo flagsArray mesonFlags mesonFlagsArray
31 echoCmd
'mesonConfigurePhase flags' "${flagsArray[@]}"
33 meson setup
"$mesonBuildDir" "${flagsArray[@]}"
34 cd "$mesonBuildDir" ||
{ echoCmd
'mesonConfigurePhase' "could not cd to $mesonBuildDir"; exit 1; }
36 if ! [[ -v enableParallelBuilding
]]; then
37 enableParallelBuilding
=1
38 echoCmd
'mesonConfigurePhase' "enabled parallel building"
41 if [[ ${checkPhase-ninjaCheckPhase} = ninjaCheckPhase
&& -z $dontUseMesonCheck ]]; then
42 checkPhase
=mesonCheckPhase
44 if [[ ${installPhase-ninjaInstallPhase} = ninjaInstallPhase
&& -z $dontUseMesonInstall ]]; then
45 installPhase
=mesonInstallPhase
55 concatTo flagsArray mesonCheckFlags mesonCheckFlagsArray
57 if [ -z "${dontAddTimeoutMultiplier:-}" ]; then
58 flagsArray
+=("--timeout-multiplier=0")
61 echoCmd
'mesonCheckPhase flags' "${flagsArray[@]}"
62 meson
test --no-rebuild --print-errorlogs "${flagsArray[@]}"
72 if [[ -n "$mesonInstallTags" ]]; then
73 flagsArray
+=("--tags" "$(concatStringsSep "," mesonInstallTags)")
75 concatTo flagsArray mesonInstallFlags mesonInstallFlagsArray
77 echoCmd
'mesonInstallPhase flags' "${flagsArray[@]}"
78 meson
install --no-rebuild "${flagsArray[@]}"
83 if [ -z "${dontUseMesonConfigure-}" ] && [ -z "${configurePhase-}" ]; then
84 # shellcheck disable=SC2034
86 configurePhase
=mesonConfigurePhase