From 08e74485c6fea7f800e8f24191b74b7d38dc8897 Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Thu, 22 Jul 2021 11:20:00 +0800 Subject: [PATCH] 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 --- fixup_nox11.sh | 10 ++++++++++ meson.build | 12 ++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100755 fixup_nox11.sh diff --git a/fixup_nox11.sh b/fixup_nox11.sh new file mode 100755 index 0000000..4096df1 --- /dev/null +++ b/fixup_nox11.sh @@ -0,0 +1,10 @@ +#!/bin/sh -e + +[ $# -lt 1 ] && { + echo "usage: $0 " + exit 1 +} + +HEADER="${MESON_INSTALL_DESTDIR_PREFIX:-/usr}/$1" + +sed -i 's/MESA_EGL_NO_X11_HEADERS/__unix__/g' "$HEADER" diff --git a/meson.build b/meson.build index 252cbde..8ac2ff8 100644 --- a/meson.build +++ b/meson.build @@ -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