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.
This commit is contained in:
Robert Bragg 2011-05-24 21:33:22 +01:00
parent 52aada8442
commit c9f1541de0
2 changed files with 18 additions and 13 deletions

View File

@ -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

View File

@ -369,11 +369,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.
#
@ -662,7 +668,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])])
@ -673,6 +679,10 @@ 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"],