From dca6e5e039f5acea6a1e33718b81b32ee46a6b4a Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Mon, 5 May 2014 20:06:29 +1000 Subject: [PATCH] gl: check if we can include both GL and GLES2 headers at the same time If we cannot, then default to GL over GLES2 unless GLES2 is required. --- configure.ac | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/configure.ac b/configure.ac index 6259b31154..6f2c230a04 100644 --- a/configure.ac +++ b/configure.ac @@ -812,6 +812,42 @@ else fi fi +dnl check if we can include both GL and GLES2 at the same time +if test "x$HAVE_GL" = "xyes" -a "x$HAVE_GLES2" = "xyes"; then + GL_INCLUDES=" +# include +# include +# if __APPLE__ +# include +# include +# else +# include +# include +# if __WIN32__ || _WIN32 +# include +# endif +# endif +" + AC_MSG_CHECKING([whether it is possible to include both GL and GLES2 headers]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$GL_INCLUDES]], [[ + #if !defined(GL_FALSE) + #error Failed to include GL headers + #endif + ]])],[ AC_MSG_RESULT(yes) + ],[AC_MSG_RESULT(no) + if test "x$NEED_GLES2" = "xyes"; then + if test "x$NEED_OPENGL" = "xyes"; then + AC_MSG_ERROR([Cannot seem to include both GL and GLES2 headers. Try disabling one API]) + fi + AC_MSG_WARN([Disabling Desktop GL support]) + HAVE_OPENGL=no + else + AC_MSG_WARN([Disabling GL|ES 2.0 support]) + HAVE_GLES2=no + fi + ]) +fi + #dnl Check for OpenGL, GLU echo host is $host case $host in