[Libva] [PATCH 05/16] always use egl for wayland

Zhao, Halley halley.zhao at intel.com
Thu Jun 28 03:09:14 PDT 2012


How about this one?

1. since AC_CHECK_HEADERS/AC_CHECK_LIB are not reliable, we should use PKG_CHECK_MODULES first. 
   AC_CHECK_HEADERS still can be used in case some egl package doesn't provide pc file.
2. HAVE_EGL is introduced to differentiate from USE_EGL

thanks


diff --git a/configure.ac b/configure.ac
index dcd27fe..7caa98c 100755
--- a/configure.ac
+++ b/configure.ac
@@ -198,16 +198,23 @@ AC_SUBST(GL_DEPS_LIBS)
 AM_CONDITIONAL(USE_GLX, test "$USE_GLX" = "yes")
 
 # Check for EGL
+HAVE_EGL="no"
 USE_EGL="no"
 EGL_DEPS_CFLAGS=""
 EGL_DEPS_LIBS=""
-if test "$enable_egl" = "yes"; then
+PKG_CHECK_MODULES([EGL_DEPS], [egl], [HAVE_EGL="yes"], [])
+if test "$HAVE_EGL" = "no"; then
     AC_CHECK_HEADERS([EGL/egl.h])
     AC_CHECK_LIB(EGL, eglGetDisplay, [
-        USE_EGL="yes"
+        HAVE_EGL="yes"
         EGL_DEPS_LIBS="-lEGL"
     ])
 fi
+if test "$enable_egl" = "yes"; then
+    if test "$HAVE_EGL" = "yes"; then
+        USE_EGL="yes"
+    fi
+fi
 AC_SUBST(EGL_DEPS_CFLAGS)
 AC_SUBST(EGL_DEPS_LIBS)
 AM_CONDITIONAL(USE_EGL, test "$USE_EGL" = "yes")
@@ -219,10 +226,10 @@ WAYLAND_DRM_CFLAGS=""
 WAYLAND_DRM_LIBS=""
 if test "$enable_wayland" = "yes"; then
     PKG_CHECK_MODULES([WAYLAND], [wayland-client], [USE_WAYLAND=1], [])
-    if test "$USE_EGL" = "yes"; then
+    if test "$HAVE_EGL" = "yes"; then
         USE_WAYLAND_DRM=1
         WAYLAND_DRM_CFLAGS="$DRM_CFLAGS"
-       WAYLAND_DRM_LIBS="$DRM_LIBS $EGL_DEPS_LIBS"
+        WAYLAND_DRM_LIBS="$DRM_LIBS $EGL_DEPS_LIBS"
     fi
 fi
 AC_DEFINE_UNQUOTED(USE_WAYLAND, $USE_WAYLAND,

> -----Original Message-----
> From: Gwenole Beauchesne [mailto:gb.devel at gmail.com]
> Sent: Thursday, June 28, 2012 5:16 PM
> To: Zhao, Halley
> Cc: libva at lists.freedesktop.org
> Subject: Re: [Libva] [PATCH 05/16] always use egl for wayland
> 
> Hi,
> 
> 2012/6/28 Zhao, Halley <halley.zhao at intel.com>:
> 
> > libegl-mesa-dev is not installed in my system, while there are lib
> and dev files in $WLD from mesa.
> > So egl check fails but it is still ok to build VA/Wayland.
> 
> If EGL check fails but you still need to -lEGL to build VA/Wayland,
> then the EGL check was broken. :) It was, so I propagated several
> patches we had to staging.
> 
> Thanks,
> Gwenole.


More information about the Libva mailing list