From 017fe2ec03a5494e84d6ece37fd631cc2c899f48 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Mon, 6 Aug 2012 18:36:15 +0200 Subject: [PATCH] configure: fix EGL check. This fixes the following error: checking EGL/egl.h presence... no configure: WARNING: EGL/egl.h: accepted by the compiler, rejected by the preprocessor! configure: WARNING: EGL/egl.h: proceeding with the compiler's result Signed-off-by: Gwenole Beauchesne --- configure.ac | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 72eac8e..2b2f259 100644 --- a/configure.ac +++ b/configure.ac @@ -246,25 +246,17 @@ AM_CONDITIONAL(USE_GLX, test "$USE_GLX" = "yes") # Check for EGL USE_EGL="no" -EGL_DEPS_CFLAGS="" -EGL_DEPS_LIBS="" if test "$enable_egl" = "yes"; then - saved_CFLAGS="$CFLAGS" + saved_CPPFLAGS="$CPPFLAGS" saved_LIBS="$LIBS" - PKG_CHECK_MODULES([EGL_DEPS], [egl], [], [EGL_DEPS_LIBS="-lEGL"]) - CFLAGS="$CFLAGS $EGL_DEPS_CFLAGS" + PKG_CHECK_MODULES([EGL_DEPS], [egl], [USE_EGL="yes"], [USE_EGL="no"]) + CPPFLAGS="$CPPFLAGS $EGL_DEPS_CFLAGS" LIBS="$LIBS $EGL_DEPS_LIBS" - AC_CHECK_HEADERS([EGL/egl.h], [USE_EGL="yes"], [USE_EGL="no"]) - - if test "x$USE_EGL" = "xyes"; then - AC_CHECK_LIB(EGL, eglGetDisplay, [USE_EGL="yes"], [USE_EGL="no"]) - fi - - CFLAGS="$saved_CFLAGS" + AC_CHECK_HEADERS([EGL/egl.h], [:], [USE_EGL="no"]) + AC_CHECK_LIB([EGL], [eglGetDisplay], [:], [USE_EGL="no"]) + CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" fi -AC_SUBST(EGL_DEPS_CFLAGS) -AC_SUBST(EGL_DEPS_LIBS) AM_CONDITIONAL(USE_EGL, test "$USE_EGL" = "yes") # We only need the headers, we don't link against the DRM libraries -- 2.7.4