diff --git a/hook/meson.build b/hook/meson.build index e8f859e..8c82394 100644 --- a/hook/meson.build +++ b/hook/meson.build @@ -29,7 +29,7 @@ libhook_dep = [ libhook_inc = [] -if cc.has_function('gbm_create_device', dependencies : mali) +if has_gbm # Add hooks to support new GBM APIs libhook_inc += include_directories('..' / gbm_headers.keys()[0]) libhook_cflags += '-DHAS_GBM' @@ -40,7 +40,7 @@ if cc.has_function('gbm_create_device', dependencies : mali) endforeach endif -if cc.has_function('eglCreateContext', dependencies : mali) +if has_egl # Add hooks to support default winsys libhook_inc += include_directories('../include') libhook_cflags += '-DHAS_EGL' diff --git a/meson.build b/meson.build index 71f5943..7ea428e 100644 --- a/meson.build +++ b/meson.build @@ -52,11 +52,10 @@ is_utgard = gpu.split('-')[0] == 'utgard' is_px3se = gpu == 'utgard-400' and subversion == 'r3p0' # Parse platforms -has_gbm = run_command('grep', '-wq', 'gbm_create_device', default_lib, +has_gbm = cc.has_function('gbm_create_device', dependencies : mali) +has_x11 = run_command('grep', '-wq', 'libxcb.so', default_lib, check : false).returncode() == 0 -has_x11 = run_command('grep', '-wq', 'XSync', default_lib, - check : false).returncode() == 0 -has_wayland = run_command('grep', '-wq', 'wl_egl_window_create', default_lib, +has_wayland = run_command('grep', '-wq', 'libwayland-client.so', default_lib, check : false).returncode() == 0 message('Using ' + default_lib + ' with' + (has_x11 ? ' x11' : '') + @@ -89,6 +88,12 @@ foreach require : requires dependency(require) endforeach +# The hook library is for hacking GBM/EGL/X11 APIs +has_egl = cc.has_function('eglCreateContext', dependencies : mali) +if not has_gbm and not has_egl and not has_x11 + build_hook = false +endif + if wrappers_opts.auto() and is_utgard wrappers = false warning('Wrappers are disabled for utgard by default')