mesa-21.3.9 build problem: wayland-client.h: No such file or directory
I'm trying to compile mesa-21.3.9 from source tarball on openSUSE Leap 15.4.
meson setup --prefix=/opt/mesa-21.3.9/ ../../build/mesa-21.3.9/
cd ../../build/mesa-21.3.9/
ninja -C ./
This fails with:
[780/2450] Compiling C object src/intel/vulkan/libanv_per_hw_ver80.a.p/genX_gpu_memcpy.c.o
FAILED: src/intel/vulkan/libanv_per_hw_ver80.a.p/genX_gpu_memcpy.c.o
cc -Isrc/intel/vulkan/libanv_per_hw_ver80.a.p -Isrc/intel/vulkan -I../../source/mesa-21.3.9/src/intel/vulkan -Iinclude -I../../source/mesa-21.3.9/include -Isrc -I../../source/mesa-21.3.9/src -Isrc/mapi -I../../source/mesa-21.3.9/src/mapi -Isrc/mesa -I../../source/mesa-21.3.9/src/mesa -I../../source/mesa-21.3.9/src/gallium/include -Isrc/compiler -I../../source/mesa-21.3.9/src/compiler -Isrc/intel -I../../source/mesa-21.3.9/src/intel -Isrc/compiler/nir -I../../source/mesa-21.3.9/src/compiler/nir -Isrc/vulkan/util -I../../source/mesa-21.3.9/src/vulkan/util -Isrc/vulkan/wsi -I../../source/mesa-21.3.9/src/vulkan/wsi -Isrc/intel/genxml -I/usr/include/libdrm -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c11 -O2 -g -ffunction-sections -fdata-sections -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="21.3.9"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DUSE_ELF_TLS -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DHAVE_XCB_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_UINT128 -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_QSORT_R -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="13.0.1"' -DLLVM_IS_SHARED=1 -DDRAW_LLVM_AVAILABLE -DMESA_EXECMEM -DHAVE_LIBUNWIND -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_OPENMP -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DVK_USE_PLATFORM_WAYLAND_KHR -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -DVK_USE_PLATFORM_XLIB_XRANDR_EXT -DVK_USE_PLATFORM_DISPLAY_KHR -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wimplicit-fallthrough -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -fno-common -Werror=format -Wformat-security -fPIC -Wno-override-init -msse2 -mstackrealign -DGFX_VERx10=80 -MD -MQ src/intel/vulkan/libanv_per_hw_ver80.a.p/genX_gpu_memcpy.c.o -MF src/intel/vulkan/libanv_per_hw_ver80.a.p/genX_gpu_memcpy.c.o.d -o src/intel/vulkan/libanv_per_hw_ver80.a.p/genX_gpu_memcpy.c.o -c ../../source/mesa-21.3.9/src/intel/vulkan/genX_gpu_memcpy.c
In file included from ../../source/mesa-21.3.9/src/vulkan/util/vk_alloc.h:30:0,
from ../../source/mesa-21.3.9/src/intel/vulkan/anv_private.h:66,
from ../../source/mesa-21.3.9/src/intel/vulkan/genX_gpu_memcpy.c:24:
../../source/mesa-21.3.9/include/vulkan/vulkan.h:41:10: fatal error: wayland-client.h: No such file or directory
#include <wayland-client.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
The wayland-client.h file is present in /usr/include/wayland/
ls -l /usr/include/wayland/wayland-client.h
-rw-r--r-- 1 root root 1573 May 7 2022 /usr/include/wayland/wayland-client.h
pkg-config for module wayland-client outputs the proper include directory:
pkg-config --cflags wayland-client
-I/usr/include/wayland
Adding -I/usr/include/wayland to the cc command line makes the compilation succeed. Is the build system missing the information that target genX_gpu_memcpy.c.o indirectly includes wayland-client.h and thus needs the proper -I command line parameter?