meson: Force MESA_EGL_NO_X11_HEADER for non-x11 winsys

Not all users would use the cflags from pkgconfig.

Change-Id: If66570b4fba51c70f2e01bd4911714d78b7a8b7e
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen
2021-07-22 11:20:00 +08:00
parent cd3d4f7cf5
commit 08e74485c6
2 changed files with 16 additions and 6 deletions

10
fixup_nox11.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh -e
[ $# -lt 1 ] && {
echo "usage: $0 <path of eglplatform.h>"
exit 1
}
HEADER="${MESON_INSTALL_DESTDIR_PREFIX:-/usr}/$1"
sed -i 's/MESA_EGL_NO_X11_HEADERS/__unix__/g' "$HEADER"

View File

@@ -194,7 +194,6 @@ foreach name, values : map
wrapper_libs = values[1]
headers = values[2]
pkg_version = values[3]
mali_cflags = []
wrapper_ldflags = []
is_opencl_icd = opencl_icd and name == 'OpenCL'
@@ -202,10 +201,6 @@ foreach name, values : map
continue
endif
if name == 'egl' and platform != 'x11'
mali_cflags += '-DMESA_EGL_NO_X11_HEADERS'
endif
foreach wrapper, version : wrapper_libs
wrapper_ldflags += '-l' + wrapper
@@ -247,7 +242,6 @@ foreach name, values : map
pkgconfig.generate(
libraries : ['-L${libdir} -lmali', wrapper_ldflags],
requires : requires,
extra_cflags : mali_cflags,
version : pkg_version,
name : name,
description : 'Mali GPU User-Space Binary Driver Wrappers')
@@ -293,3 +287,9 @@ if not wrappers
# Fixup wrappers
meson.add_install_script('fixup_wrappers.sh', get_option('libdir'))
endif
if platform != 'x11'
# Fixup EGL header
meson.add_install_script('fixup_nox11.sh',
get_option('includedir') / 'EGL' / 'eglplatform.h')
endif