Skip to content

Commit

Permalink
Default to Qt 6 for autotools builds as well
Browse files Browse the repository at this point in the history
  • Loading branch information
jlindgren90 committed Apr 4, 2024
1 parent 04d1346 commit 5c726de
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 11 deletions.
16 changes: 11 additions & 5 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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])
Expand All @@ -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)
Expand Down
36 changes: 30 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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 ======================

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -571,7 +595,7 @@ ENABLE_PLUGIN_WITH_DEP(qthotkey,
auto,
GENERAL,
QTX11EXTRAS,
Qt5X11Extras)
$QT_X11_DEP)

dnl CoreAudio
dnl =========
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 5c726de

Please sign in to comment.