# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/mesa/mesa.conf # Copyright (C) 2008 - 2024 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-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 else var_append mesonopt ' ' -Dinstall-intel-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 ',' "swrast,d3d12,nouveau,r600,virgl,zink" [ "$arch_sizeof_char_p" = 8 ] && var_append galdrv ',' "i915" case "$arch" in alpha) var_remove galdrv ',' "i915" ;; sparc) 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 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" [ "$arch_sizeof_char_p" = 8 ] && var_append vuldrv ',' "intel" case $arch_machine in sparc) var_remove galdrv ',' "r300,radeonsi" var_remove vuldrv ',' "amd" var_remove mesonopt ' ' '-Dgallium-xa=enabled' ;; superh) var_remove mesonopt ' ' '-Dgallium-xa=enabled' ;; powerpc) var_remove galdrv ',' "llvmpipe" ;; arm*) var_append galdrv ',' "asahi,etnaviv,freedreno,kmsro,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'