summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2011-08-30 16:48:31 +0100
committerDamien Lespiau <damien.lespiau@intel.com>2011-08-30 16:48:31 +0100
commitc50263f81c233fbbf93f464848384de98787ae66 (patch)
tree43e5f5dd9b893105415bfe6a46258eb9070ca6fd
parent10d5638b3ce3a0c9473d9f4eeb29edc006819af6 (diff)
downloadclutter-gst-c50263f81c233fbbf93f464848384de98787ae66.tar.gz
build: Link against -lGL when we know it's safe to
We are using a gl call (glGetIntergerv). However, detecting wich GL headers and library to use is getting impossible (as nowedays, cogl even has a runtime selection of which library should be dlopened, so it could be either one of flavours of the GLES1 DSO or the GLES2 DSO, or the Big GL one). So, really, we should not have any direct GL call in clutter-gst. The solution is coming, but in the mean time, just link against -lGL when it's safe to assume so.
-rw-r--r--clutter-gst/Makefile.am1
-rw-r--r--configure.ac22
2 files changed, 23 insertions, 0 deletions
diff --git a/clutter-gst/Makefile.am b/clutter-gst/Makefile.am
index 06f2248..812f197 100644
--- a/clutter-gst/Makefile.am
+++ b/clutter-gst/Makefile.am
@@ -82,6 +82,7 @@ lib_LTLIBRARIES = libclutter-gst-@CLUTTER_GST_MAJORMINOR@.la
libclutter_gst_@CLUTTER_GST_MAJORMINOR@_la_LIBADD = @CLUTTER_GST_LIBS@ $(GST_LIBS)
libclutter_gst_@CLUTTER_GST_MAJORMINOR@_la_LDFLAGS = \
$(CLUTTER_GST_LT_LDFLAGS) \
+ $(GL_LDFLAGS) \
-export-dynamic \
-export-symbols-regex "^clutter_gst.*" \
-rpath $(libdir)
diff --git a/configure.ac b/configure.ac
index a0d2fdb..782caf0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,6 +147,28 @@ pkg_modules="gstreamer-$GST_MAJORMINOR >= $GSTREAMER_REQ_VERSION gstreamer-plugi
PKG_CHECK_MODULES(GST, [$pkg_modules])
dnl ========================================================================
+dnl GL inclusion and link. We depend on GL for the single glGetIntegerv()
+dnl call. The end goal is to get rid of it, but we can't just yet.
+
+dnl For now, we assume Clutter/Cogl includes the GL headers (whatever they
+dnl are). By the time they don't do that, we'll hopefully won't have any
+dnl direct GL dependency.
+
+dnl As for linking against -lGL, I believe Clutter always end up puttin libGL
+dnl in its exported CFLAGS, except when compiling against the NVidia library
+dnl (which does not have the 'gl' .pc file. For now, let's just add -lGL when
+dnl we are using the glx flavour, That should fix the vast majority of the
+dnl issues
+
+dnl Why don't we "just" link against GL? check the cogl/clutter configure.ac :)
+dnl Hopefully this will be enough for the time being.
+
+clutter_soname=`$PKG_CONFIG --variable soname_infix clutter-1.0`
+AS_CASE([$clutter_soname],
+ [glx], [AC_CHECK_LIB([GL], [glGetIntegerv], [GL_LDFLAGS="-lGL"])])
+AC_SUBST([GL_LDFLAGS])
+
+dnl ========================================================================
m4_define([maintainer_flags_default], [yes])
AC_ARG_ENABLE([maintainer-flags],