summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2015-12-15 19:25:16 -0500
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2015-12-15 19:28:22 -0500
commit4c19b415bd75accbb13cb4a4149e6858f6f37f9c (patch)
treedb207ddfa831a37df1819a7e6fac88d5994470bc /configure.ac
parent34faa2d79aceef25ba9a5452a62c8afbe5365257 (diff)
downloadgstreamer-plugins-bad-4c19b415bd75accbb13cb4a4149e6858f6f37f9c.tar.gz
gl: Allow using non-system mesa with both GL and GLES
GCC automatically disable redundance warnings for system headers. As soon as we start using a non-system installed mesa, we would start having issues. The test for both wasn't setting any flags, so it would work but then fail at runtime. This is being fixed by disabling in the code (where needed only) that GCC warning. The test is also fixed to avoid the false positive we had.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 9 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index f2d3c2483..0119ec224 100644
--- a/configure.ac
+++ b/configure.ac
@@ -816,6 +816,10 @@ 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="
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored \"-Wredundant-decls\"
+#endif
#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES 1
#endif
@@ -839,11 +843,12 @@ if test "x$HAVE_GL" = "xyes" -a "x$HAVE_GLES2" = "xyes"; then
# include <GL/glext.h>
# endif
# endif
+int main (int argc, char **argv) { return 0; }
"
AC_MSG_CHECKING([whether it is possible to include both GL and GLES2 headers])
- save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $ERROR_CFLAGS"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$GL_INCLUDES]], [[
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $GL_CFLAGS $GLES2_CFLAGS $WARNING_CFLAGS $ERROR_CFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$GL_INCLUDES]], [[
#if !defined(GL_FALSE)
#error Failed to include GL headers
#endif
@@ -861,7 +866,7 @@ if test "x$HAVE_GL" = "xyes" -a "x$HAVE_GLES2" = "xyes"; then
HAVE_GLES2=no
fi
])
- CPPFLAGS="$save_CPPFLAGS"
+ CFLAGS="$save_CFLAGS"
fi
#dnl Check for OpenGL