gtk, qt: more specifically define the compile time requirements

Otherwise we could include headers/configurations that will
never been installed.

https://bugzilla.gnome.org/show_bug.cgi?id=754732
This commit is contained in:
Matthew Waters 2015-09-10 00:07:18 +10:00
parent 85745d2f63
commit 38d360675c
3 changed files with 43 additions and 24 deletions

View file

@ -2617,16 +2617,31 @@ HAVE_GTK3_GL="no"
translit(dnm, m, l) AM_CONDITIONAL(USE_GTK3, true) translit(dnm, m, l) AM_CONDITIONAL(USE_GTK3, true)
AG_GST_CHECK_FEATURE(GTK3, [Gtk+ elements], gtk, [ AG_GST_CHECK_FEATURE(GTK3, [Gtk+ elements], gtk, [
PKG_CHECK_MODULES(GTK3, gtk+-3.0, [ PKG_CHECK_MODULES(GTK3, gtk+-3.0, [
AC_DEFINE([HAVE_GTK3], 1, [Define if Gtk+ 3.0 is installed]) AC_DEFINE([HAVE_GTK3], 1, [Define if Gtk+ 3.0 is installed])
HAVE_GTK3="yes" HAVE_GTK3="yes"
], [ ], [
HAVE_GTK3="no" HAVE_GTK3="no"
]) ])
PKG_CHECK_MODULES(GTK3_GL, gtk+-3.0 >= 3.15.0, [ PKG_CHECK_MODULES(GTK3_GL, gtk+-3.0 >= 3.15.0, [
GDK_WINDOWING="no"
if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then
PKG_CHECK_MODULES(GTK3_X11, gtk+-x11-3.0, [
GTK3_CFLAGS="$GTK3_CFLAGS $GTK3_X11_CFLAGS"
GTK3_LIBS="$GTK3_LIBS $GTK3_X11_LIBS"
GDK_WINDOWING="yes"
], [AC_MSG_NOTICE([Could not find Gtk X11 integration])])
fi
if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
PKG_CHECK_MODULES(GTK3_WAYLAND, gtk+-wayland-3.0, [
GTK3_CFLAGS="$GTK3_CFLAGS $GTK3_WAYLAND_CFLAGS"
GTK3_LIBS="$GTK3_LIBS $GTK3_WAYLAND_LIBS"
GDK_WINDOWING="yes"
], [AC_MSG_NOTICE([Could not find Gtk Wayland integration])])
fi
if test "x$GDK_WINDOWING" = "xyes"; then
AC_DEFINE([HAVE_GTK3_GL], 1, [Define if Gtk+ 3.0 GL is installed]) AC_DEFINE([HAVE_GTK3_GL], 1, [Define if Gtk+ 3.0 GL is installed])
if test "x$HAVE_GL" = "xyes"; then HAVE_GTK3_GL="yes"
HAVE_GTK3_GL="yes" fi
fi
], [ ], [
HAVE_GTK3_GL="no" HAVE_GTK3_GL="no"
]) ])
@ -2648,19 +2663,23 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
else else
HAVE_QT="yes" HAVE_QT="yes"
HAVE_QT_WINDOWING="no" HAVE_QT_WINDOWING="no"
PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [ if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then
AC_DEFINE([HAVE_QT_X11], [], [Define if Qt X11 integration is installed]) PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [
AC_DEFINE([HAVE_QT_X11], [], [Define if Qt X11 integration is installed])
QT_CFLAGS="$QT_CFLAGS $QT_X11_CFLAGS" QT_CFLAGS="$QT_CFLAGS $QT_X11_CFLAGS"
QT_LIBS="$QT_LIBS $QT_X11_LIBS" QT_LIBS="$QT_LIBS $QT_X11_LIBS"
HAVE_QT_WINDOWING="yes" HAVE_QT_WINDOWING="yes"
], [AC_MSG_NOTICE([Could not find Qt X11 integration])]) ], [AC_MSG_NOTICE([Could not find Qt X11 integration])])
PKG_CHECK_MODULES(QT_WAYLAND, Qt5WaylandClient, [ fi
AC_DEFINE([HAVE_QT_WAYLAND], [], if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
[Define if Qt Wayland integration is installed]) PKG_CHECK_MODULES(QT_WAYLAND, Qt5WaylandClient, [
QT_CFLAGS="$QT_CFLAGS $QT_WAYLAND_CFLAGS" AC_DEFINE([HAVE_QT_WAYLAND], [],
QT_LIBS="$QT_LIBS $QT_WAYLAND_LIBS" [Define if Qt Wayland integration is installed])
HAVE_QT_WINDOWING="yes" QT_CFLAGS="$QT_CFLAGS $QT_WAYLAND_CFLAGS"
], [AC_MSG_NOTICE([Could not find Qt Wayland integration])]) QT_LIBS="$QT_LIBS $QT_WAYLAND_LIBS"
HAVE_QT_WINDOWING="yes"
], [AC_MSG_NOTICE([Could not find Qt Wayland integration])])
fi
if test "x$HAVE_QT_WINDOWING" = "xno"; then if test "x$HAVE_QT_WINDOWING" = "xno"; then
AC_MSG_WARN([Could not find any Qt Windowing integration]) AC_MSG_WARN([Could not find any Qt Windowing integration])
HAVE_QT="no" HAVE_QT="no"

View file

@ -27,13 +27,13 @@
#include "gtkgstglwidget.h" #include "gtkgstglwidget.h"
#include <gst/video/video.h> #include <gst/video/video.h>
#if GST_GL_HAVE_WINDOW_X11 && defined (GDK_WINDOWING_X11) #if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (GDK_WINDOWING_X11)
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#include <gst/gl/x11/gstgldisplay_x11.h> #include <gst/gl/x11/gstgldisplay_x11.h>
#include <gst/gl/x11/gstglcontext_glx.h> #include <gst/gl/x11/gstglcontext_glx.h>
#endif #endif
#if GST_GL_HAVE_WINDOW_WAYLAND && defined (GDK_WINDOWING_WAYLAND) #if GST_GL_HAVE_WINDOW_WAYLAND && GST_GL_HAVE_PLATFORM_EGL && defined (GDK_WINDOWING_WAYLAND)
#include <gdk/gdkwayland.h> #include <gdk/gdkwayland.h>
#include <gst/gl/wayland/gstgldisplay_wayland.h> #include <gst/gl/wayland/gstgldisplay_wayland.h>
#endif #endif
@ -418,13 +418,13 @@ gtk_gst_gl_widget_init (GtkGstGLWidget * gst_widget)
display = gdk_display_get_default (); display = gdk_display_get_default ();
#if GST_GL_HAVE_WINDOW_X11 && defined (GDK_WINDOWING_X11) #if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (GDK_WINDOWING_X11)
if (GDK_IS_X11_DISPLAY (display)) if (GDK_IS_X11_DISPLAY (display))
priv->display = (GstGLDisplay *) priv->display = (GstGLDisplay *)
gst_gl_display_x11_new_with_display (gdk_x11_display_get_xdisplay gst_gl_display_x11_new_with_display (gdk_x11_display_get_xdisplay
(display)); (display));
#endif #endif
#if GST_GL_HAVE_WINDOW_WAYLAND && defined (GDK_WINDOWING_WAYLAND) #if GST_GL_HAVE_WINDOW_WAYLAND && GST_GL_HAVE_PLATFORM_EGL && defined (GDK_WINDOWING_WAYLAND)
if (GDK_IS_WAYLAND_DISPLAY (display)) { if (GDK_IS_WAYLAND_DISPLAY (display)) {
struct wl_display *wayland_display = struct wl_display *wayland_display =
gdk_wayland_display_get_wl_display (display); gdk_wayland_display_get_wl_display (display);
@ -468,7 +468,7 @@ _get_gl_context (GtkGstGLWidget * gst_widget)
gdk_gl_context_make_current (priv->gdk_context); gdk_gl_context_make_current (priv->gdk_context);
#if GST_GL_HAVE_WINDOW_X11 && defined (GDK_WINDOWING_X11) #if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (GDK_WINDOWING_X11)
if (GST_IS_GL_DISPLAY_X11 (priv->display)) { if (GST_IS_GL_DISPLAY_X11 (priv->display)) {
platform = GST_GL_PLATFORM_GLX; platform = GST_GL_PLATFORM_GLX;
gl_api = gst_gl_context_get_current_gl_api (platform, NULL, NULL); gl_api = gst_gl_context_get_current_gl_api (platform, NULL, NULL);
@ -479,7 +479,7 @@ _get_gl_context (GtkGstGLWidget * gst_widget)
platform, gl_api); platform, gl_api);
} }
#endif #endif
#if GST_GL_HAVE_WINDOW_WAYLAND && defined (GDK_WINDOWING_WAYLAND) #if GST_GL_HAVE_WINDOW_WAYLAND && GST_GL_HAVE_PLATFORM_EGL && defined (GDK_WINDOWING_WAYLAND)
if (GST_IS_GL_DISPLAY_WAYLAND (priv->display)) { if (GST_IS_GL_DISPLAY_WAYLAND (priv->display)) {
platform = GST_GL_PLATFORM_EGL; platform = GST_GL_PLATFORM_EGL;
gl_api = gst_gl_context_get_current_gl_api (platform, NULL, NULL); gl_api = gst_gl_context_get_current_gl_api (platform, NULL, NULL);

View file

@ -31,13 +31,13 @@
#include "qtitem.h" #include "qtitem.h"
#include "gstqsgtexture.h" #include "gstqsgtexture.h"
#if GST_GL_HAVE_WINDOW_X11 && defined (HAVE_QT_X11) #if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (HAVE_QT_X11)
#include <QX11Info> #include <QX11Info>
#include <gst/gl/x11/gstgldisplay_x11.h> #include <gst/gl/x11/gstgldisplay_x11.h>
#include <gst/gl/x11/gstglcontext_glx.h> #include <gst/gl/x11/gstglcontext_glx.h>
#endif #endif
#if GST_GL_HAVE_WINDOW_WAYLAND && defined (HAVE_QT_WAYLAND) #if GST_GL_HAVE_WINDOW_WAYLAND && GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_WAYLAND)
#include <gst/gl/wayland/gstgldisplay_wayland.h> #include <gst/gl/wayland/gstgldisplay_wayland.h>
#endif #endif