From 3530354d5d5da1248cc6636dbf3837294f0a2121 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Thu, 12 May 2011 14:59:44 +0100 Subject: [PATCH] build: Fix the GLES headers check GLES/glext.h and GLES2/gl2ext.h need to include GLES/gl.h and GLES2/gl2.h respectively to get the GL types. This used to work as autoconf used to only do a preprocessor pass in AC_CHECK_HEADER(S), but now it also tries to compile a small test program and thus the test failed. --- configure.ac | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 8a8404c9f..d7d0d08af 100644 --- a/configure.ac +++ b/configure.ac @@ -325,9 +325,16 @@ AS_IF([test "x$enable_gles1" = "xyes"], NEED_EGL=yes ], [ - AC_CHECK_HEADERS([$cogl_gl_headers], - [], - [AC_MSG_ERROR([Unable to locate required GLES headers])]) + # We have to check the two headers independently as GLES/glext.h + # needs to include GLES/gl.h to have the GL types defined (eg. + # GLenum). + AC_CHECK_HEADER([GLES/gl.h], + [], + [AC_MSG_ERROR([Unable to locate GLES/gl.h])]) + AC_CHECK_HEADER([GLES/glext.h], + [], + [AC_MSG_ERROR([Unable to locate GLES/glext.h])], + [#include ]) # Check for a GLES 1.x Common Profile library with/without EGL. # @@ -374,11 +381,16 @@ AS_IF([test "x$enable_gles2" = "xyes"], PKG_CHECK_EXISTS([glesv2], [COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES glesv2"], [ - AC_CHECK_HEADERS([$cogl_gl_headers], - [], - [AC_MSG_ERROR([Unable to locate required GLES headers])], - [[#include - ]]) + # We have to check the two headers independently as GLES2/gl2ext.h + # needs to include GLES2/gl2.h to have the GL types defined (eg. + # GLenum). + AC_CHECK_HEADER([GLES2/gl2.h], + [], + [AC_MSG_ERROR([Unable to locate GLES2/gl2.h])]) + AC_CHECK_HEADER([GLES2/gl2ext.h], + [], + [AC_MSG_ERROR([Unable to locate GLES2/gl2ext.h])], + [#include ]) COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lGLESv2" ])