From 026ad193aa4e39845f5dd3667ae3eb7958ab7091 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 23 Nov 2017 17:12:11 +0000 Subject: [PATCH] build-sys: Use PKG_CHECK_VAR for libepoxy EGL support checking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If libepoxy is installed in a non-standrad location AC_CHECK_HEADERS_ONCE will fail to find the header. I did it this way because trying to get AC_CHECK_HEADERS_ONCE to find it involved setting and unsetting CFLAGS. Reviewed-by: Marc-André Lureau Signed-off-by: Jakob Bornecrantz --- configure.ac | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5ffd448..c0c4abf 100644 --- a/configure.ac +++ b/configure.ac @@ -89,7 +89,7 @@ if test "x$build_tests" = "xyes"; then fi AC_CHECK_FUNCS_ONCE([eventfd]) -AC_CHECK_HEADERS_ONCE([sys/uio.h epoxy/egl.h]) +AC_CHECK_HEADERS_ONCE([sys/uio.h]) AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"]) AM_CONDITIONAL(BUILD_TESTS, [test "x$build_tests" = "xyes"]) @@ -101,6 +101,13 @@ if test "x$os_win32" = xno; then fi PKG_CHECK_MODULES([EPOXY], [epoxy]) +PKG_CHECK_VAR(epoxy_has_egl, [epoxy], [epoxy_has_egl]) +AS_IF([test "x$epoxy_has_egl" = "x1"], [ + epoxy_has_egl=yes + AC_DEFINE([HAVE_EPOXY_EGL_H], [1], [Libepoxy has EGL support.]) +],[ + epoxy_has_egl=no +]) AC_ARG_WITH([glx], AS_HELP_STRING([--with-glx], [Build with the x11/glx backend])) AS_IF([test "x$with_glx" = "xyes"], [ @@ -109,6 +116,7 @@ AS_IF([test "x$with_glx" = "xyes"], [ ]) AM_CONDITIONAL([WITH_GLX], [test "x$with_glx" = "xyes"]) + AC_SUBST([DEFINES]) AC_CONFIG_FILES([ virglrenderer.pc @@ -130,6 +138,7 @@ AC_MSG_NOTICE([ win32: $os_win32 glx: $with_glx + egl: $epoxy_has_egl debug: $enable_debug tests: $build_tests