# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/mesa/mesa.conf # Copyright (C) 2008 - 2025 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 # --- T2-COPYRIGHT-END --- if atstage cross; then # translate native llvm-config libraries to sysroot var_append GCC_WRAPPER_FILTER '|' "sed 's,$root/TOOLCHAIN.*libLLVM\(.*\)\.[as].*,-lLLVM\1,'" # remove native llvm-config include var_append GCC_WRAPPER_REMOVE ' ' -I$root/TOOLCHAIN/cross/include var_append GCC_WRAPPER_REMOVE ' ' -isystem$root/TOOLCHAIN/cross/include var_append GCC_WRAPPER_REMOVE ' ' -L$root/TOOLCHAIN/cross/lib var_append mesonopt ' ' -Dintel-clc=system var_append mesonopt ' ' -Dmesa-clc=system else var_append mesonopt ' ' -Dinstall-intel-clc=true var_append mesonopt ' ' -Dinstall-mesa-clc=true fi # atomics crash on i486 GCC_WRAPPER_INSERT="${GCC_WRAPPER_INSERT/i486/i586}" # binutils complains about corrupted Thin archives, so disable for now: [ $arch_machine = powerpc64 ] && hook_add inmake 5 "sed -i s/csrDT/csrD/ objs/build.ninja" var_append GCC_WRAPPER_REMOVE ' ' '-Werror=int-conversion' # at least x32 :-/ galdrv= vuldrv= platforms= # drm pkginstalled libx11 && var_append platforms ',' 'x11' && var_append GCC_WRAPPER_INSERT ' ' "-c?-I$root`pkgprefix includedir libx11`:-L$root`pkgprefix libdir libx11`" pkginstalled wayland && var_append platforms ',' wayland pkginstalled libglvnd && var_append mesonopt ' ' -Dglvnd=enabled if pkginstalled libdrm; then var_append mesonopt ' ' '-Dosmesa=true -Dgbm=enabled' var_append mesonopt ' ' '-Degl=enabled -Dglx=auto' var_append mesonopt ' ' '-Dplatforms=$platforms -Dgles1=enabled -Dgles2=enabled' var_append mesonopt ' ' '-Dvideo-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec' var_append galdrv ',' "softpipe,nouveau,r600,virgl,zink" pkginstalled directx-headers && var_append galdrv ',' "d3d12" && var_append GCC_WRAPPER_APPEND ' ' -I$root$includedir/wsl/stubs [ "$arch_sizeof_char_p" = 8 ] && var_append galdrv ',' i915 case "$arch_machine" in alpha) var_remove galdrv ',' i915 ;; sparcv*) var_remove dridrv ',' "r100,r200,nouveau" var_remove galdrv ',' "r600,nouveau" ;; superh) var_remove galdrv ',' "r600,nouveau" ;; x86) var_remove galdrv ',' i915 var_append galdrv ',' svga ;; x86_64) var_append galdrv ',' "svga,crocus" ;; esac else var_append mesonopt ' ' '-Ddri3=disabled -Dglx=disabled' fi pkginstalled libxshmfence || var_append mesonopt ' ' -Ddri3=disabled if pkginstalled llvm; then var_append mesonopt ' ' '-Dllvm=enabled -Dshared-llvm=enabled' var_append galdrv ',' llvmpipe var_append vuldrv ',' swrast if pkginstalled libdrm; then var_append mesonopt ' ' -Dgallium-xa=enabled var_append galdrv ',' "iris,r300,radeonsi" var_append vuldrv ',' "amd,imagination-experimental,virtio" pkginstalled rustc && var_append vuldrv ',' nouveau if pkginstalled rustc; then var_append mesonopt ' ' -Dgallium-rusticl=true atstage native || var_append GCC_WRAPPER_FILTER '|' "sed s,$sysroot/TOOLCHAIN/cross/lib/libclang-cpp.so,-lclang-cpp," fi [ "$arch_sizeof_char_p" = 8 ] && var_append vuldrv ',' intel case $arch_machine in armv5*) var_remove vuldrv ',' virtio ;; sparcv*) var_remove galdrv ',' "r300,radeonsi" var_remove vuldrv ',' amd var_remove vuldrv ',' nouveau var_remove mesonopt ' ' -Dgallium-xa=enabled ;; superh) var_remove mesonopt ' ' -Dgallium-xa=enabled ;; arm*) var_append galdrv ',' "asahi,etnaviv,freedreno,lima,panfrost,tegra,v3d,vc4" var_append vuldrv ',' "broadcom,freedreno" ;; alpha|ia64) vuldrv= ;; esac fi else var_append mesonopt ' ' -Dllvm=false fi pkginstalled vulkan-headers || var_remove galdrv ',' zink if atstage cross; then var_remove galdrv ',' asahi # TODO: asahi_clc fi # TODO: find out where -lunwind is added in rustc or llvm/clang [ "$SDECFG_LIBC" = musl ] && hook_add inmake 5 "sed -i 's/-lunwind //g' objs/build.ninja" var_append mesonopt ' ' -Dvulkan-drivers=$vuldrv var_append mesonopt ' ' -Dgallium-drivers=$galdrv var_append mesonopt ' ' -Dshared-glapi=enabled