-
-
Save karolherbst/7e279214faaac6fb5fb03fa4e50ebfce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PATH=/home/kherbst/local/bin/:/home/kherbst/.cargo/bin/:$PATH | |
arch=${MESA_ARCH:-} | |
type=debug | |
drivers=${MESA_DRIVERS:-local} | |
meson=system | |
cl=${MESA_CL:-icd} | |
cross=${MESA_CROSS_FILE:-} | |
tests=${MESA_TESTS:-true} | |
#export CC=clang | |
#export CXX=clang++ | |
case $type in | |
debug) | |
export CFLAGS='-fno-common -fno-inline-functions -fno-optimize-sibling-calls -fno-omit-frame-pointer -ggdb3 -g3 -O0' | |
export RUSTFLAGS='-C debuginfo=2 -C opt-level=0' | |
debug=true | |
optimization=0 | |
;; | |
reldebug) | |
export CFLAGS='-mtune=native -march=native -ggdb3 -g3' | |
export RUSTFLAGS='-C debuginfo=2 -C opt-level=3' | |
debug=true | |
optimization=3 | |
;; | |
release) | |
export CFLAGS='-mtune=native -march=native' | |
export RUSTFLAGS='-C debuginfo=0 -C opt-level=3' | |
debug=false | |
optimization=3 | |
;; | |
*) | |
echo "unkown build type $type" | |
exit 1 | |
;; | |
esac | |
export CXXFLAGS=$CFLAGS | |
case $drivers in | |
all) | |
gallium_drivers="kmsro, radeonsi, r300, r600, nouveau, freedreno, swrast, v3d, vc4, etnaviv, tegra, svga, virgl, swr, panfrost, iris, lima, zink" | |
dri_drivers="i915, i965, r100, r200, nouveau" | |
vulkan_drivers="amd, freedreno, intel" | |
;; | |
gallium) | |
gallium_drivers="kmsro, radeonsi, r300, r600, nouveau, freedreno, swrast, v3d, vc4, etnaviv, tegra, svga, virgl, swr, panfrost, iris, lima, zink" | |
dri_drivers="" | |
vulkan_drivers="" | |
;; | |
local) | |
gallium_drivers="nouveau, iris, swrast" | |
dri_drivers="" | |
vulkan_drivers="intel" | |
tools="nouveau" | |
;; | |
nv) | |
gallium_drivers="nouveau" | |
dri_drivers="" | |
vulkan_drivers="" | |
tools="nouveau" | |
;; | |
sw) | |
gallium_drivers="swrast" | |
dri_drivers="" | |
vulkan_drivers="" | |
tools="" | |
;; | |
*) | |
echo "unkown driver selection $drivers" | |
exit 1 | |
;; | |
esac | |
case $meson in | |
local) | |
meson=/home/kherbst/git/meson/meson.py | |
;; | |
system) | |
meson=meson | |
;; | |
*) | |
echo "unkown meson selection $meson" | |
exit 1 | |
;; | |
esac | |
mkdir build$arch 2>/dev/null | |
cd build$arch | |
if [ ! -f build.ninja ]; then | |
meson="${meson} setup .." | |
else | |
meson="${meson} configure" | |
fi | |
$meson \ | |
-Dpkg_config_path="/home/kherbst/local/lib64/pkgconfig/,/home/kherbst/local/share/pkgconfig/" \ | |
-Ddebug=$debug \ | |
-Doptimization=$optimization \ | |
-Dshader-cache=true \ | |
-Dgallium-opencl=$cl \ | |
-Dgallium-rusticl=true \ | |
-Dopencl-spirv=true \ | |
-Dllvm=true \ | |
-Dshared-llvm=true \ | |
-Dgallium-drivers="$gallium_drivers" \ | |
-Ddri-drivers="$dri_drivers" \ | |
-Dvulkan-drivers="$vulkan_drivers" \ | |
-Ddri3=true \ | |
-Degl=true \ | |
-Dgallium-nine=false \ | |
-Dgallium-omx=disabled \ | |
-Dgallium-va=false \ | |
-Dgallium-vdpau=false \ | |
-Dgallium-xa=false \ | |
-Dgallium-xvmc=false \ | |
-Dlmsensors=false \ | |
-Dplatforms="wayland,x11" \ | |
-Dbuild-tests=$tests \ | |
-Dtools="$tools" \ | |
-Dvalgrind=false \ | |
-Db_sanitize=none \ | |
--backend ninja \ | |
--prefix=/home/kherbst/local | |
ninja $@ | |
ret=$? | |
cd .. | |
exit $ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment