nixpkgs/pkgs/development/tools/build-managers/meson/setup-hook.sh

43 lines
1.3 KiB
Bash
Raw Normal View History

mesonConfigurePhase() {
runHook preConfigure
if [ -z "${dontAddPrefix-}" ]; then
mesonFlags="--prefix=$prefix $mesonFlags"
fi
# Build release by default.
2018-02-26 11:33:00 +00:00
if [ -n "@isCross@" ]; then
crossMesonFlags="--cross-file=@crossFile@/cross-file.conf"
fi
# See multiple-outputs.sh and mesons coredata.py
mesonFlags="\
--libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \
--bindir=${!outputBin}/bin --sbindir=${!outputBin}/sbin \
--includedir=${!outputInclude}/include \
--mandir=${!outputMan}/share/man --infodir=${!outputInfo}/share/info \
--localedir=${!outputLib}/share/locale \
-Dauto_features=${mesonAutoFeatures:-enabled} \
2019-06-19 02:47:25 +01:00
-Dwrap_mode=${mesonWrapMode:-nodownload} \
$mesonFlags"
mesonFlags="${crossMesonFlags+$crossMesonFlags }--buildtype=${mesonBuildType:-plain} $mesonFlags"
echo "meson flags: $mesonFlags ${mesonFlagsArray[@]}"
2018-02-26 11:33:00 +00:00
CC=@cc@/bin/cc CXX=@cc@/bin/c++ meson build $mesonFlags "${mesonFlagsArray[@]}"
cd build
if ! [[ -v enableParallelBuilding ]]; then
enableParallelBuilding=1
echo "meson: enabled parallel building"
fi
runHook postConfigure
}
if [ -z "${dontUseMesonConfigure-}" -a -z "${configurePhase-}" ]; then
setOutputFlags=
configurePhase=mesonConfigurePhase
fi