From 5c726de1b3a010a222faf2ce8d722e9ced612f8f Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Thu, 4 Apr 2024 01:06:32 -0400 Subject: [PATCH] Default to Qt 6 for autotools builds as well --- acinclude.m4 | 16 +++++++++++----- configure.ac | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index d455db2be..8b199aedb 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -207,10 +207,6 @@ fi AC_SUBST(USE_GTK) -if test $USE_GTK = yes ; then - PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0 >= 1.0) -fi - if test $HAVE_MSWINDOWS = yes ; then PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.32) else @@ -233,7 +229,11 @@ AC_ARG_ENABLE(qt, AS_HELP_STRING(--disable-qt, [Disable Qt support (default=enabled)]), USE_QT=$enableval, USE_QT=yes) -if test $USE_QT = yes ; then +AC_ARG_ENABLE(qt5, + AS_HELP_STRING(--enable-qt5, [Use Qt 5 instead of Qt 6 (default=disabled)]), + USE_QT5=$enableval, USE_QT5=no) + +if test $USE_QT5 = yes ; then PKG_CHECK_MODULES([QTCORE], [Qt5Core >= 5.2]) PKG_CHECK_VAR([QTBINPATH], [Qt5Core >= 5.2], [host_bins]) PKG_CHECK_MODULES([QT], [Qt5Core Qt5Gui Qt5Widgets >= 5.2]) @@ -242,9 +242,15 @@ if test $USE_QT = yes ; then # needed if Qt was built with -reduce-relocations QTCORE_CFLAGS="$QTCORE_CFLAGS -fPIC" QT_CFLAGS="$QT_CFLAGS -fPIC" +elif test $USE_QT = yes ; then + PKG_CHECK_MODULES([QTCORE], [Qt6Core >= 6.0]) + PKG_CHECK_VAR([QTBINPATH], [Qt6Core >= 6.0], [libexecdir]) + PKG_CHECK_MODULES([QT], [Qt6Core Qt6Gui Qt6Widgets >= 6.0]) + AC_DEFINE([USE_QT], [1], [Define if Qt support enabled]) fi AC_SUBST(USE_QT) +AC_SUBST(USE_QT5) AC_SUBST(QT_CFLAGS) AC_SUBST(QT_LIBS) AC_SUBST(QTBINPATH) diff --git a/configure.ac b/configure.ac index b6fbbfccb..a68283699 100644 --- a/configure.ac +++ b/configure.ac @@ -63,6 +63,13 @@ else PKG_CHECK_MODULES([XML], [libxml-2.0]) fi +dnl Check for json-glib (required for lyrics-gtk) +dnl ============================================= + +if test $USE_GTK = yes ; then + PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0 >= 1.0) +fi + dnl Default Set of Plugins dnl ====================== @@ -110,6 +117,12 @@ check_allowed () { if test $plugin_allowed = no -a $2 = yes ; then AC_MSG_ERROR([--enable-$1 cannot be used without --enable-qt]) fi + if test $plugin_allowed = yes -a $1 = qtaudio ; then + plugin_allowed=$USE_QT5 + if test $plugin_allowed = no -a $2 = yes ; then + AC_MSG_ERROR([--enable-$1 cannot be used without --enable-qt5]) + fi + fi if test $plugin_allowed = yes -a $1 = ampache ; then plugin_allowed=$have_neon if test $plugin_allowed = no -a $2 = yes ; then @@ -529,23 +542,34 @@ ENABLE_PLUGIN_WITH_DEP(ampache, AMPACHE, ampache_browser_1) +if test "x$USE_QT5" = "xyes"; then + QT_MULTIMEDIA_DEP=Qt5Multimedia + QT_NETWORK_DEP=Qt5Network + QT_OPENGL_DEP="Qt5OpenGL >= 5.4" + QT_X11_DEP=Qt5X11Extras +else + QT_MULTIMEDIA_DEP=Qt6Multimedia + QT_NETWORK_DEP=Qt6Network + QT_OPENGL_DEP="Qt6OpenGL Qt6OpenGLWidgets" + QT_X11_DEP="Qt6Gui >= 6.2" +fi + ENABLE_PLUGIN_WITH_DEP(qtaudio, QtMultimedia output, auto, OUTPUT, QTMULTIMEDIA, - Qt5Multimedia) + $QT_MULTIMEDIA_DEP) ENABLE_PLUGIN_WITH_DEP(streamtuner, Stream tuner (experimental), no, GENERAL, QTNETWORK, - Qt5Network) + $QT_NETWORK_DEP) test_qtglspectrum () { - PKG_CHECK_MODULES(QTOPENGL, Qt5OpenGL >= 5.4, [ - QTOPENGL_CFLAGS="$QTOPENGL_CFLAGS -fPIC" + PKG_CHECK_MODULES(QTOPENGL, $QT_OPENGL_DEP, [ if test $have_glspectrum = yes ; then have_qtglspectrum=yes elif test $HAVE_MSWINDOWS = yes ; then @@ -571,7 +595,7 @@ ENABLE_PLUGIN_WITH_DEP(qthotkey, auto, GENERAL, QTX11EXTRAS, - Qt5X11Extras) + $QT_X11_DEP) dnl CoreAudio dnl ========= @@ -855,7 +879,7 @@ fi if test "x$USE_QT" = "xyes" ; then echo " Qt Support" echo " ----------" - echo " Qt Multimedia output: $have_qtaudio" + echo " Qt Multimedia output (Qt 5 only): $have_qtaudio" echo " Qt Interface: yes" echo " Winamp Classic Interface: yes" echo " Album Art: yes"