After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 738816 - gl: gst-plugins-bad won't build without --with-opengl=yes
gl: gst-plugins-bad won't build without --with-opengl=yes
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-19 15:22 UTC by Brendan Long
Modified: 2014-10-20 11:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
config.log (364.47 KB, text/plain)
2014-10-20 07:59 UTC, Brendan Long
  Details
Make output (make > make.log 2>&1) (92.97 KB, text/plain)
2014-10-20 08:00 UTC, Brendan Long
  Details
config.log (362.97 KB, text/plain)
2014-10-20 08:08 UTC, Brendan Long
  Details
Patch to add a missing check for HAVE_GLU in configure.ac (744 bytes, patch)
2014-10-20 08:29 UTC, Brendan Long
committed Details | Review

Description Brendan Long 2014-10-19 15:22:57 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.
Comment 1 Sebastian Dröge (slomo) 2014-10-19 18:29:38 UTC
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.
Comment 2 Brendan Long 2014-10-20 07:00:03 UTC
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.
Comment 3 Brendan Long 2014-10-20 07:31:32 UTC
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.
Comment 4 Sebastian Dröge (slomo) 2014-10-20 07:35:23 UTC
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?
Comment 5 Brendan Long 2014-10-20 07:41:08 UTC
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.
Comment 6 Sebastian Dröge (slomo) 2014-10-20 07:50:10 UTC
I see, by default it should use whatever is available though.

Can you provide your config log and how exactly it fails?
Comment 7 Brendan Long 2014-10-20 07:59:26 UTC
Created attachment 288888 [details]
config.log
Comment 8 Brendan Long 2014-10-20 08:00:20 UTC
Created attachment 288889 [details]
Make output (make > make.log 2>&1)

configure succeeded, so here's the make output too.
Comment 9 Brendan Long 2014-10-20 08:03:51 UTC
Oh apparently config.log is something else. I can create another configure.log if config.log isn't enough.
Comment 10 Brendan Long 2014-10-20 08:08:39 UTC
Created attachment 288890 [details]
config.log

Here's another config.log since I don't know if I accidentally trampled part of it before.
Comment 11 Brendan Long 2014-10-20 08:16:07 UTC
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?
Comment 12 Brendan Long 2014-10-20 08:29:56 UTC
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..
Comment 13 Sebastian Dröge (slomo) 2014-10-20 11:06:15 UTC
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