diff options
author | Alexandros Frantzis <alexandros.frantzis@linaro.org> | 2010-08-17 13:01:29 +0300 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-09-24 13:26:42 +0100 |
commit | 97501a409321e0541f554b43dabbb5e0841fca2c (patch) | |
tree | 1bd88c75f0d304e89faa865ae9edfc62c6211985 | |
parent | 9268d4c44514a2ed127eba228e3f485a4908d165 (diff) | |
download | clutter-97501a409321e0541f554b43dabbb5e0841fca2c.tar.gz |
Backport GLES 1.1 detection code from clutter 1.3.x.
Correctly detect various GLES v1.1 libraries (with or without additional
EGL libraries).
http://bugzilla.clutter-project.org/show_bug.cgi?id=2271
-rw-r--r-- | configure.ac | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/configure.ac b/configure.ac index 7151a13af..97a7b1dfe 100644 --- a/configure.ac +++ b/configure.ac @@ -155,41 +155,48 @@ AS_IF([test "x$CLUTTER_WINSYS" = "xeglnative" || AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering]) AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES1]) - AC_CHECK_HEADERS([GLES/egl.h], - [], - [AC_MSG_ERROR([Unable to locate required GLES headers])]) - - - # check for upper/lower case libgles_em - # The powervr sdk uses lower case. - AC_CHECK_LIB(GLES_CM, [eglInitialize], - [HAVE_LIBGLES=yes], - [HAVE_LIBGLES=no]) - - AS_IF([test "x$HAVE_LIBGLES" = "xyes"], - [GLES_LIBS="-lGLES_CM"], + PKG_CHECK_EXISTS([glesv1_cm], + [BACKEND_PC_FILES="$BACKEND_PC_FILES glesv1_cm" + NEED_SEPARATE_EGL=yes + ], + [ + AC_CHECK_HEADERS([$clutter_gl_header], + [], + [AC_MSG_ERROR([Unable to locate required GLES headers])]) + + # Check for a GLES 1.x Common Profile library with/without EGL. + # + # Note: historically GLES 1 libraries shipped with the + # EGL and GLES symbols all bundled in one library. Now + # the Khronos Implementers Guide defines two naming + # schemes: -lGLES_CM should be used for a library that + # bundles the GLES and EGL API together and -lGLESv1_CM + # would be used for a standalone GLES API. + AC_CHECK_LIB(GLES_CM, [eglInitialize], + [GLES_LIBS="$GLES_LIBS -lGLES_CM"], + [ + AC_CHECK_LIB(GLESv1_CM, [glFlush], + [GLES_LIBS="$GLES_LIBS -lGLESv1_CM" + NEED_SEPARATE_EGL=yes + ], + [AC_MSG_ERROR([Unable to locate required GLES 1.x Common Profile library])]) + ]) + ]) + + AS_IF([test "x$NEED_SEPARATE_EGL" = "xyes"], + [ + PKG_CHECK_EXISTS([egl], + [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [ - AC_CHECK_LIB(GLESv1_CM, [eglInitialize], - [HAVE_LIBGLES=yes], - [HAVE_LIBGLES=no]) - - AS_IF([test "x$HAVE_LIBGLES" = "xyes"], - [GLES_LIBS="-lGLESv1_CM"], - [ - AC_CHECK_LIB(gles_cm, [eglInitialize], - [HAVE_LIBGLES=yes], - [HAVE_LIBGLES=no]) - - AS_IF([test "x$HAVE_LIBGLES" = "xyes"], - [GLES_LIBS="-lgles_cm"], - [ - AC_MSG_ERROR([GLES library not found and egl backend requested.]) - ] - ) - ] - ) - ] - ) + AC_CHECK_HEADERS([GLES/egl.h], + [], + [AC_MSG_ERROR([Unable to locate required EGL headers])]) + + AC_CHECK_LIB(EGL, [eglInitialize], + [GLES_LIBS="$GLES_LIBS -lEGL"], + [AC_MSG_ERROR([Unable to locate required EGL library])]) + ]) + ]) ], [2*], |