[cogl/wip/wayland-compositor: 7/18] egl: check or EGL/eglext.h



commit 9a5d9e142d969f9fe15574eb47ef455a3b101b26
Author: Robert Bragg <robert linux intel com>
Date:   Tue May 24 21:33:22 2011 +0100

    egl: check or EGL/eglext.h
    
    While running configure we now check for EGL/eglext.h and if found we
    will substitute an inclusion in cogl-defines.h.

 cogl/cogl-defines.h.in |    7 +------
 configure.ac           |   24 +++++++++++++++++-------
 2 files changed, 18 insertions(+), 13 deletions(-)
---
diff --git a/cogl/cogl-defines.h.in b/cogl/cogl-defines.h.in
index 5baa3b9..0822689 100644
--- a/cogl/cogl-defines.h.in
+++ b/cogl/cogl-defines.h.in
@@ -36,15 +36,10 @@ G_BEGIN_DECLS
 @COGL_DEFINES@
 
 #ifdef COGL_HAS_EGL_SUPPORT
-#ifdef COGL_HAS_GLES1
-#include <GLES/gl.h>
- COGL_GLES1_EGL_INCLUDE@
-#else
-#include <EGL/egl.h>
+ COGL_EGL_INCLUDES@
 #define NativeDisplayType EGLNativeDisplayType
 #define NativeWindowType EGLNativeWindowType
 #endif
-#endif
 
 G_END_DECLS
 
diff --git a/configure.ac b/configure.ac
index e99d257..863f2c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -363,11 +363,17 @@ AS_IF([test "x$enable_gles1" = "xyes"],
             AC_CHECK_HEADERS([GLES/egl.h EGL/egl.h])
 
             AS_IF([test "x$ac_cv_header_GLES_egl_h" = "xyes"],
-                  [COGL_GLES1_EGL_INCLUDE="#include <GLES/egl.h>"],
-                  [AS_IF([test "x$ac_cv_header_EGL_egl_h" = "xyes"],
-                         [COGL_GLES1_EGL_INCLUDE="#include <EGL/egl.h>"],
-                         [AC_MSG_ERROR([Unable to locate EGL header])])])
-            AC_SUBST([COGL_GLES1_EGL_INCLUDE])
+                  [COGL_EGL_INCLUDES="#include <GLES/egl.h>"],
+                  [test "x$ac_cv_header_EGL_egl_h" = "xyes"],
+                  [
+                    COGL_EGL_INCLUDES="#include <EGL/egl.h>"
+                    AC_CHECK_HEADERS([EGL/eglext.h],
+                                     [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDE
+#include <EGL/eglext.h>"],
+                                     [])
+                  ],
+                  [AC_MSG_ERROR([Unable to locate EGL header])])
+            AC_SUBST([COGL_EGL_INCLUDES])
 
             # Check for a GLES 1.x Common Profile library with/without EGL.
             #
@@ -679,7 +685,7 @@ AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"],
           [COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES egl"],
           [
             AC_CHECK_HEADERS(
-              [EGL/egl.h],
+              [EGL/egl.h EGL/eglext.h],
               [],
               [AC_MSG_ERROR([Unable to locate required EGL headers])])
 
@@ -690,7 +696,11 @@ AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"],
             COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"
           ]
           )
-        ])
+
+        COGL_EGL_INCLUDES="#include <EGL/egl.h>
+#include <EGL/eglext.h>"
+        AC_SUBST([COGL_EGL_INCLUDES])
+      ])
 
 AS_IF([test "x$NEED_EGL" = "xyes"],
       [



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]