GNOME Bugzilla – Bug 738816
gl: gst-plugins-bad won't build without --with-opengl=yes
Last modified: 2014-10-20 11:06:18 UTC
I'm downloading and building GStreamer from source, and I got errors like "unknown type name GLuint". Looking through the source I found gstglapi.h which has some code like: /* OpenGL 2.0 for Embedded Systems */ #if GST_GL_HAVE_GLES2 #ifndef GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES 1 #endif # ifdef __APPLE__ # include <OpenGLES/ES2/gl.h> # include <OpenGLES/ES2/glext.h> # else # include <GLES2/gl2.h> # include <GLES2/gl2ext.h> # endif # if !GST_GL_HAVE_OPENGL # include <gst/gl/glprototypes/gstgl_gles2compat.h> # endif #endif /* OpenGL for desktop systems */ #if GST_GL_HAVE_OPENGL # ifdef __APPLE__ # include <OpenGL/OpenGL.h> # include <OpenGL/gl.h> # include <OpenGL/glu.h> # else # include <GL/gl.h> # include <GL/glu.h> # if __WIN32__ || _WIN32 # include <GL/glext.h> # endif # endif #endif I looked in configure.ac and found that if I add --with-opengl=yes, it would correctly #import <GL/gl.h> (which was already installed and that fixed the build for me. Presumably this is meant to be optional though, so this entire plugin shouldn't be built unless --with-opengl was specified in the configure script.
Without --with-opengl the configure checks are supposed to check if GLuint and friends are there... and otherwise will make sure that they are defined via gstgl_gles2compat.h. You'll have to check why these configure checks are not working as expected on your specific embedded system.
Hm this VM is Ubuntu 14.04 64-bit, so not exactly an obscure system. It's possible that I've done something weird to it though. I'll try to track it down.
gstgl_gles2compat.h doesn't define GLuint or any of the other similar types. This is the entire file: #ifndef __GST_GL_ES2__ #define __GST_GL_ES2__ #include <glib.h> G_BEGIN_DECLS /* SUPPORTED */ //FIXME: #define GL_RGB16 GL_RGB565 #define GL_RGB8 GL_RGB #define GL_RGBA8 GL_RGBA //END FIXME /* UNSUPPORTED */ #define GL_COLOR_ATTACHMENT1 0 #define GL_COLOR_ATTACHMENT2 0 #ifndef GL_TEXTURE_ENV #define GL_TEXTURE_ENV 0 #endif #ifndef GL_TEXTURE_ENV_MODE #define GL_TEXTURE_ENV_MODE 0 #endif #define GL_DEPTH24_STENCIL8 0 G_END_DECLS #endif (git master, 88b19bcf997b0f396737af5b5fc2fd9a3a9957eb) I tried git grep -e '\(typedef\|#define\) \+GLuint' and didn't get any results.
Right, GLchar and others are defined from configure checks in gstglconfig.h. GLuint is part of the GLES2 standard and defined in GLES2/gl2.h. Why isn't it for you? Or are you saying that you don't have GLES2 and also not desktop GL?
I have both GLES2/gl2.h and GL/gl.h. If I configure with --with-opengl=yes, it works fines. The problem is that by default (or --with-opengl=no), it doesn't even try to include either of those files.
I see, by default it should use whatever is available though. Can you provide your config log and how exactly it fails?
Created attachment 288888 [details] config.log
Created attachment 288889 [details] Make output (make > make.log 2>&1) configure succeeded, so here's the make output too.
Oh apparently config.log is something else. I can create another configure.log if config.log isn't enough.
Created attachment 288890 [details] config.log Here's another config.log since I don't know if I accidentally trampled part of it before.
Hm: configure:33968: WARNING: GLU is required with OpenGL support configure:34004: checking whether it is possible to include both GL and GLES2 headers configure:34023: gcc -std=gnu99 -c -g -O2 -Werror conftest.c >&5 conftest.c:80:22: fatal error: GL/glu.h: No such file or directory # include <GL/glu.h> ^ compilation terminated. So I installed libglu1-mesa-dev and that also makes the problem go away. So, configure is getting confused if I have GL/gl.h but not GL/glu.h?
Created attachment 288891 [details] [review] Patch to add a missing check for HAVE_GLU in configure.ac This patch fixes it for me. I do still get a warning though, but everything builds fine: configure:33968: WARNING: GLU is required with OpenGL support Maybe you can think of a better commit message..
commit eee5110fb4eb39d101c125c39a588754e8acb7ac Author: Brendan Long <self@brendanlong.com> Date: Mon Oct 20 02:27:15 2014 -0600 gl: Check for GLU before trying to use it in configure.ac https://bugzilla.gnome.org/show_bug.cgi?id=738816