summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2018-02-12 18:34:16 +0000
committerTim-Philipp Müller <tim@centricular.com>2018-02-12 18:40:10 +0000
commitbbab8f79ade3d16b0a8672db5b06d115cfc88155 (patch)
tree13bddfd176b255fa68865f1fd926467b57febe8c
parent6c75e6c5e0d5ae128b52437c790c9130acf89a7b (diff)
qt: hook up to build
https://bugzilla.gnome.org/show_bug.cgi?id=754094
-rw-r--r--configure.ac107
-rw-r--r--ext/Makefile.am7
-rw-r--r--ext/meson.build1
-rw-r--r--tests/examples/meson.build1
4 files changed, 116 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index d88823918..25f28b2dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,6 +30,9 @@ AM_MAINTAINER_MODE([enable])
dnl sets host_* variables
AC_CANONICAL_HOST
+dnl PKG_CONFIG_SYSROOT_DIR is a valid environment variable
+m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
+
dnl use pretty build output with automake >= 1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
[AM_DEFAULT_VERBOSITY=1
@@ -854,6 +857,108 @@ AG_GST_CHECK_FEATURE(DV1394, [raw1394 and avc1394 library], 1394, [
])
AM_CONDITIONAL(USE_LIBIEC61883, [ test "x${HAVE_LIBIEC61883}" = xyes ] )
+dnl *** Qt ***
+translit(dnm, m, l) AM_CONDITIONAL(USE_QT, true)
+AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
+ PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Qml Qt5Quick >= 5.4.0, [
+ QT_PATH=`$PKG_CONFIG --variable=exec_prefix Qt5Core`
+ QT_HOST_PATH=`$PKG_CONFIG --variable=host_bins Qt5Core`
+ AC_ARG_WITH([moc],
+ AS_HELP_STRING([--with-moc], [Set location of qt moc tool]),
+ [MOC=$withval])
+ AC_PATH_PROGS(MOC, [moc-qt5 moc], [moc], ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
+ AC_ARG_WITH([rcc],
+ AS_HELP_STRING([--with-rcc], [Set location of qt rcc tool]),
+ [RCC=$withval])
+ AC_PATH_PROGS(RCC, [rcc-qt5 rcc], [rcc], ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
+ AC_ARG_WITH([uic],
+ AS_HELP_STRING([--with-uic], [Set location of qt uic tool]),
+ [UIC=$withval])
+ AC_PATH_PROGS(UIC, [uic-qt5 uic], [uic], ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
+ if test "x$MOC" = "x" || test "x$UIC" = "x" || test "x$RCC" = "x"; then
+ AC_MSG_WARN([One of the required qt build programs was not found])
+ HAVE_QT="no"
+ else
+ HAVE_QT="yes"
+ HAVE_QT_WINDOWING="no"
+ QT_VERSION="`$PKG_CONFIG --define-prefix --modversion Qt5Core`"
+ QPA_INCLUDE_PATH=`$PKG_CONFIG --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui
+ AS_IF([test -f "$PKG_CONFIG_SYSROOT_DIR/$QPA_INCLUDE_PATH/qpa/qplatformnativeinterface.h"], [
+ QT_CFLAGS="$QT_CFLAGS -I$PKG_CONFIG_SYSROOT_DIR/$QPA_INCLUDE_PATH"
+ HAVE_QT_QPA_HEADER="yes"
+ ], [AC_MSG_NOTICE([Cannot find QPA])])
+ if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1" || test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
+ 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_LIBS="$QT_LIBS $QT_X11_LIBS"
+ HAVE_QT_WINDOWING="yes"
+ ], [AC_MSG_NOTICE([Could not find Qt X11 integration])])
+ fi
+ if test "x$GST_GL_HAVE_WINDOW_WAYLAND" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1" -a "x$HAVE_QT_QPA_HEADER" = "xyes"; then
+ PKG_CHECK_MODULES(QT_WAYLAND, Qt5WaylandClient, [
+ AC_DEFINE([HAVE_QT_WAYLAND], [],
+ [Define if Qt Wayland integration is installed])
+ QT_CFLAGS="$QT_CFLAGS $QT_WAYLAND_CFLAGS"
+ QT_LIBS="$QT_LIBS $QT_WAYLAND_LIBS"
+ HAVE_QT_WINDOWING="yes"
+ ], [AC_MSG_NOTICE([Could not find Qt Wayland integration])])
+ fi
+ if test "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
+ if test "x$GST_GL_HAVE_WINDOW_ANDROID" = "x1"; then
+ PKG_CHECK_MODULES(QT_ANDROID, Qt5AndroidExtras, [
+ # c++ on android requires a standard library and there are multiple
+ # choices. cerbero provides a pkg-config file the describes a choice
+ # so try to use that. Outside cerbero one has to pass these flags
+ # manually for the library one is using
+ PKG_CHECK_MODULES(GNUSTL, gnustl, [
+ QT_CFLAGS="$QT_CFLAGS $GNUSTL_CFLAGS"
+ QT_LIBS="$QT_LIBS $GNUSTL_LIBS"
+ ], [
+ AC_MSG_NOTICE([Could not find Standard C++ library])])
+ AC_DEFINE([HAVE_QT_EGLFS], [],
+ [Define if Qt eglfs integration is installed])
+ QT_CFLAGS="$QT_CFLAGS $QT_ANDROID_CFLAGS"
+ QT_LIBS="$QT_LIBS $QT_ANDROID_LIBS"
+ HAVE_QT_WINDOWING="yes"
+ ], [AC_MSG_NOTICE([Could not find Qt Android integration])])
+ else
+ AC_DEFINE([HAVE_QT_EGLFS], [],
+ [Define if Qt eglfs integration is installed])
+ HAVE_QT_WINDOWING="yes"
+ fi
+ fi
+ if test "x$GST_GL_HAVE_WINDOW_COCOA" = "x1" -a "x$GST_GL_HAVE_PLATFORM_CGL" = "x1"; then
+ PKG_CHECK_MODULES(QT_MAC, Qt5MacExtras, [
+ AC_DEFINE([HAVE_QT_MAC], [],
+ [Define if Qt Mac integration is installed])
+ QT_LIBDIR=`$PKG_CONFIG --variable=libdir Qt5Core`
+ QT_CFLAGS="$QT_CFLAGS $QT_MAC_CFLAGS -F$QT_LIBDIR -framework QtCore -framework QtGui -framework QtQuick -framework QtQml -framework QtMacExtras"
+ QT_LIBS="$QT_LIBS $QT_MAC_LIBS"
+ HAVE_QT_WINDOWING="yes"
+ ], [AC_MSG_NOTICE([Could not find Qt Mac integration])])
+ fi
+ if test "x$GST_GL_HAVE_WINDOW_EAGL" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EAGL" = "x1"; then
+ if test "x$HAVE_IOS" = "xyes"; then
+ # iOS doesn't have its own extras package so if we have the core
+ # modules we are good to go
+ AC_DEFINE([HAVE_QT_IOS], [],
+ [Define if Qt iOS integration is installed])
+ HAVE_QT_WINDOWING="yes"
+ fi
+ fi
+ if test "x$HAVE_QT_WINDOWING" = "xno"; then
+ AC_MSG_WARN([Could not find any Qt Windowing integration])
+ HAVE_QT="no"
+ fi
+ AC_SUBST([QT_CFLAGS])
+ AC_SUBST([QT_LIBS])
+ fi
+ ], [
+ HAVE_QT="no"
+ ])
+])
+
dnl *** shout2 ***
translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT2, true)
AG_GST_CHECK_FEATURE(SHOUT2, [Shoutcast/Icecast client library], shout2, [
@@ -1005,6 +1110,7 @@ AM_CONDITIONAL(USE_OSS4, false)
AM_CONDITIONAL(USE_OSX_AUDIO, false)
AM_CONDITIONAL(USE_OSX_VIDEO, false)
AM_CONDITIONAL(USE_PULSE, false)
+AM_CONDITIONAL(USE_QT, false)
AM_CONDITIONAL(USE_SHOUT2, false)
AM_CONDITIONAL(USE_SOUP, false)
AM_CONDITIONAL(USE_SPEEX, false)
@@ -1159,6 +1265,7 @@ ext/libcaca/Makefile
ext/libpng/Makefile
ext/mpg123/Makefile
ext/pulse/Makefile
+ext/qt/Makefile
ext/raw1394/Makefile
ext/shout2/Makefile
ext/soup/Makefile
diff --git a/ext/Makefile.am b/ext/Makefile.am
index cb1293b78..f996b65c0 100644
--- a/ext/Makefile.am
+++ b/ext/Makefile.am
@@ -83,6 +83,11 @@ else
PULSE_DIR =
endif
+if USE_QT
+QT_DIR=qt
+else
+QT_DIR=
+endif
if USE_SHOUT2
SHOUT2_DIR = shout2
@@ -142,6 +147,7 @@ SUBDIRS = \
$(LIBPNG_DIR) \
$(MPG123_DIR) \
$(PULSE_DIR) \
+ $(QT_DIR) \
$(SHOUT2_DIR) \
$(SOUP_DIR) \
$(SPEEX_DIR) \
@@ -164,6 +170,7 @@ DIST_SUBDIRS = \
libpng \
mpg123 \
pulse \
+ qt \
raw1394 \
shout2 \
soup \
diff --git a/ext/meson.build b/ext/meson.build
index d5eb38292..52eb4c748 100644
--- a/ext/meson.build
+++ b/ext/meson.build
@@ -14,6 +14,7 @@ endif
subdir('libpng')
subdir('mpg123')
subdir('raw1394')
+# FIXME: subdir('qt')
subdir('pulse')
subdir('shout2')
subdir('soup')
diff --git a/tests/examples/meson.build b/tests/examples/meson.build
index 3c66c5543..aa871a410 100644
--- a/tests/examples/meson.build
+++ b/tests/examples/meson.build
@@ -2,6 +2,7 @@ subdir('audiofx')
subdir('cairo')
#FIXME: subdir('gtk')
subdir('level')
+#FIXME: subdir('qt')
subdir('rtp')
subdir('shapewipe')
subdir('v4l2')