2016-09-21 19:54:41 -03:00
dnl Copyright (c) 2013-2016 The Bitcoin Core developers
dnl Distributed under the MIT software license, see the accompanying
dnl file COPYING or http://www.opensource.org/licenses/mit-license.php.
2013-12-13 17:19:02 -03:00
dnl Helper for cases where a qt dependency is not met.
dnl Output: If qt version is auto, set bitcoin_enable_qt to false. Else, exit.
AC_DEFUN([BITCOIN_QT_FAIL],[
2021-11-24 09:16:53 -03:00
if test "$bitcoin_qt_want_version" = "auto" && test "$bitcoin_qt_force" != "yes"; then
if test "$bitcoin_enable_qt" != "no"; then
2013-12-13 17:19:02 -03:00
AC_MSG_WARN([$1; bitcoin-qt frontend will not be built])
fi
bitcoin_enable_qt=no
2015-04-29 11:09:56 -03:00
bitcoin_enable_qt_test=no
2013-12-13 17:19:02 -03:00
else
AC_MSG_ERROR([$1])
fi
])
AC_DEFUN([BITCOIN_QT_CHECK],[
2021-11-24 09:16:53 -03:00
if test "$bitcoin_enable_qt" != "no" && test "$bitcoin_qt_want_version" != "no"; then
2013-12-13 17:19:02 -03:00
true
$1
else
true
$2
fi
])
dnl BITCOIN_QT_PATH_PROGS([FOO], [foo foo2], [/path/to/search/first], [continue if missing])
2014-01-18 17:04:11 -03:00
dnl Helper for finding the path of programs needed for Qt.
2013-12-13 17:19:02 -03:00
dnl Inputs: $1: Variable to be set
dnl Inputs: $2: List of programs to search for
dnl Inputs: $3: Look for $2 here before $PATH
dnl Inputs: $4: If "yes", don't fail if $2 is not found.
dnl Output: $1 is set to the path of $2 if found. $2 are searched in order.
AC_DEFUN([BITCOIN_QT_PATH_PROGS],[
BITCOIN_QT_CHECK([
2021-11-24 09:16:53 -03:00
if test "$3" != ""; then
2021-10-07 08:18:14 -03:00
AC_PATH_PROGS([$1], [$2], [], [$3])
2013-12-13 17:19:02 -03:00
else
2021-10-07 08:18:14 -03:00
AC_PATH_PROGS([$1], [$2])
2013-12-13 17:19:02 -03:00
fi
2021-11-24 09:16:53 -03:00
if test "$$1" = "" && test "$4" != "yes"; then
2013-12-13 17:19:02 -03:00
BITCOIN_QT_FAIL([$1 not found])
fi
])
])
dnl Initialize qt input.
dnl This must be called before any other BITCOIN_QT* macros to ensure that
dnl input variables are set correctly.
dnl CAUTION: Do not use this inside of a conditional.
AC_DEFUN([BITCOIN_QT_INIT],[
dnl enable qt support
2014-01-18 17:11:05 -03:00
AC_ARG_WITH([gui],
2018-06-13 11:02:49 -04:00
[AS_HELP_STRING([--with-gui@<:@=no|qt5|auto@:>@],
[build bitcoin-qt GUI (default=auto)])],
2014-01-10 18:28:57 -03:00
[
bitcoin_qt_want_version=$withval
2021-11-24 09:16:53 -03:00
if test "$bitcoin_qt_want_version" = "yes"; then
2014-01-10 18:28:57 -03:00
bitcoin_qt_force=yes
bitcoin_qt_want_version=auto
fi
],
2013-12-13 17:19:02 -03:00
[bitcoin_qt_want_version=auto])
2021-11-24 09:16:53 -03:00
AS_IF([test "$with_gui" = "qt5_debug"],
2020-03-09 09:40:21 -03:00
[AS_CASE([$host],
[*darwin*], [qt_lib_suffix=_debug],
[qt_lib_suffix= ]); bitcoin_qt_want_version=qt5],
[qt_lib_suffix= ])
2020-07-29 06:29:58 -04:00
AS_CASE([$host], [*android*], [qt_lib_suffix=_$ANDROID_ARCH])
2014-01-23 10:05:04 -03:00
AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], [])
AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], [])
AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], [])
2014-08-04 14:39:13 -04:00
AC_ARG_WITH([qt-translationdir],[AS_HELP_STRING([--with-qt-translationdir=PLUGIN_DIR],[specify qt translation path (overridden by pkgconfig)])], [qt_translation_path=$withval], [])
2014-01-23 10:05:04 -03:00
AC_ARG_WITH([qt-bindir],[AS_HELP_STRING([--with-qt-bindir=BIN_DIR],[specify qt bin path])], [qt_bin_path=$withval], [])
2013-12-13 17:19:02 -03:00
AC_ARG_WITH([qtdbus],
[AS_HELP_STRING([--with-qtdbus],
2019-11-06 13:13:28 -03:00
[enable DBus support (default is yes if qt is enabled and QtDBus is found, except on Android)])],
2013-12-13 17:19:02 -03:00
[use_dbus=$withval],
[use_dbus=auto])
2014-08-04 14:39:13 -04:00
2019-11-06 13:13:28 -03:00
dnl Android doesn't support D-Bus and certainly doesn't use it for notifications
case $host in
*android*)
2021-11-24 09:16:53 -03:00
if test "$use_dbus" != "yes"; then
2019-11-06 13:13:28 -03:00
use_dbus=no
fi
;;
esac
2014-08-04 14:39:13 -04:00
AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path)
2013-12-13 17:19:02 -03:00
])
2020-03-08 21:41:03 -03:00
dnl Find Qt libraries and includes.
2020-08-09 18:19:54 -04:00
dnl
dnl BITCOIN_QT_CONFIGURE([MINIMUM-VERSION])
dnl
2020-03-08 21:41:03 -03:00
dnl Outputs: See _BITCOIN_QT_FIND_LIBS
2013-12-13 17:19:02 -03:00
dnl Outputs: Sets variables for all qt-related tools.
dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test
AC_DEFUN([BITCOIN_QT_CONFIGURE],[
2020-08-09 18:19:54 -04:00
qt_version=">= $1"
qt_lib_prefix="Qt5"
2020-03-08 21:41:03 -03:00
BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS])
2013-12-13 17:19:02 -03:00
2014-06-03 23:42:53 -04:00
dnl This is ugly and complicated. Yuck. Works as follows:
2021-03-31 20:47:36 -03:00
dnl We check a header to find out whether Qt is built statically.
dnl When Qt is built statically, some plugins must be linked into
dnl the final binary as well. _BITCOIN_QT_CHECK_STATIC_PLUGIN does
dnl a quick link-check and appends the results to QT_LIBS.
2014-06-03 23:42:53 -04:00
BITCOIN_QT_CHECK([
TEMP_CPPFLAGS=$CPPFLAGS
2015-11-09 22:50:25 -03:00
TEMP_CXXFLAGS=$CXXFLAGS
2022-02-17 08:31:36 -03:00
CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS"
2022-02-17 13:16:52 -03:00
CXXFLAGS="$PIC_FLAGS $CORE_CXXFLAGS $CXXFLAGS"
2018-06-13 11:02:49 -04:00
_BITCOIN_QT_IS_STATIC
2021-11-24 09:16:53 -03:00
if test "$bitcoin_cv_static_qt" = "yes"; then
2021-03-04 15:34:38 -03:00
_BITCOIN_QT_CHECK_STATIC_LIBS
2021-03-04 15:56:46 -03:00
2021-11-24 09:16:53 -03:00
if test "$qt_plugin_path" != ""; then
2021-03-12 07:51:18 -03:00
if test -d "$qt_plugin_path/platforms"; then
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
fi
if test -d "$qt_plugin_path/styles"; then
QT_LIBS="$QT_LIBS -L$qt_plugin_path/styles"
fi
2021-03-04 15:56:46 -03:00
if test -d "$qt_plugin_path/accessible"; then
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
fi
if test -d "$qt_plugin_path/platforms/android"; then
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL"
fi
fi
2021-11-09 03:03:42 -03:00
AC_DEFINE([QT_STATICPLUGIN], [1], [Define this symbol if qt plugins are static])
2021-11-24 09:16:53 -03:00
if test "$TARGET_OS" != "android"; then
2021-03-04 15:07:06 -03:00
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal])
2021-11-09 03:03:42 -03:00
AC_DEFINE([QT_QPA_PLATFORM_MINIMAL], [1], [Define this symbol if the minimal qt platform exists])
2019-09-19 10:09:47 -03:00
fi
2021-11-24 09:16:53 -03:00
if test "$TARGET_OS" = "windows"; then
2020-11-06 05:16:06 -03:00
dnl Linking against wtsapi32 is required. See #17749 and
dnl https://bugreports.qt.io/browse/QTBUG-27097.
AX_CHECK_LINK_FLAG([-lwtsapi32], [QT_LIBS="$QT_LIBS -lwtsapi32"], [AC_MSG_ERROR([could not link against -lwtsapi32])])
2021-03-04 15:07:06 -03:00
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QWindowsIntegrationPlugin], [-lqwindows])
2021-06-02 13:59:58 -04:00
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QWindowsVistaStylePlugin], [-lqwindowsvistastyle])
2021-11-09 03:03:42 -03:00
AC_DEFINE([QT_QPA_PLATFORM_WINDOWS], [1], [Define this symbol if the qt platform is windows])
2021-11-24 09:16:53 -03:00
elif test "$TARGET_OS" = "linux"; then
2021-03-12 08:01:42 -03:00
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QXcbIntegrationPlugin], [-lqxcb])
2021-11-09 03:03:42 -03:00
AC_DEFINE([QT_QPA_PLATFORM_XCB], [1], [Define this symbol if the qt platform is xcb])
2021-11-24 09:16:53 -03:00
elif test "$TARGET_OS" = "darwin"; then
2021-09-02 08:42:14 -04:00
AX_CHECK_LINK_FLAG([-framework Carbon], [QT_LIBS="$QT_LIBS -framework Carbon"], [AC_MSG_ERROR(could not link against Carbon framework)])
AX_CHECK_LINK_FLAG([-framework IOSurface], [QT_LIBS="$QT_LIBS -framework IOSurface"], [AC_MSG_ERROR(could not link against IOSurface framework)])
AX_CHECK_LINK_FLAG([-framework Metal], [QT_LIBS="$QT_LIBS -framework Metal"], [AC_MSG_ERROR(could not link against Metal framework)])
AX_CHECK_LINK_FLAG([-framework QuartzCore], [QT_LIBS="$QT_LIBS -framework QuartzCore"], [AC_MSG_ERROR(could not link against QuartzCore framework)])
2021-03-04 15:07:06 -03:00
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QCocoaIntegrationPlugin], [-lqcocoa])
2021-03-04 08:28:55 -03:00
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QMacStylePlugin], [-lqmacstyle])
2021-11-09 03:03:42 -03:00
AC_DEFINE([QT_QPA_PLATFORM_COCOA], [1], [Define this symbol if the qt platform is cocoa])
2021-11-24 09:16:53 -03:00
elif test "$TARGET_OS" = "android"; then
2021-12-04 19:39:14 -03:00
QT_LIBS="-Wl,--export-dynamic,--undefined=JNI_OnLoad -lplugins_platforms_qtforandroid${qt_lib_suffix} -ljnigraphics -landroid -lqtfreetype${qt_lib_suffix} $QT_LIBS"
2021-11-09 03:03:42 -03:00
AC_DEFINE([QT_QPA_PLATFORM_ANDROID], [1], [Define this symbol if the qt platform is android])
2014-06-03 23:42:53 -04:00
fi
fi
CPPFLAGS=$TEMP_CPPFLAGS
2015-11-09 22:50:25 -03:00
CXXFLAGS=$TEMP_CXXFLAGS
2014-06-03 23:42:53 -04:00
])
2014-09-29 16:26:31 -03:00
2021-11-24 09:16:53 -03:00
if test "$qt_bin_path" = ""; then
2021-03-31 09:30:58 -03:00
qt_bin_path="`$PKG_CONFIG --variable=host_bins ${qt_lib_prefix}Core 2>/dev/null`"
2014-09-29 16:26:31 -03:00
fi
2021-11-24 09:16:53 -03:00
if test "$use_hardening" != "no"; then
2015-11-09 22:52:37 -03:00
BITCOIN_QT_CHECK([
2021-10-07 21:13:36 -03:00
AC_MSG_CHECKING([whether -fPIE can be used with this Qt config])
2015-11-09 22:52:37 -03:00
TEMP_CPPFLAGS=$CPPFLAGS
TEMP_CXXFLAGS=$CXXFLAGS
2022-02-17 08:31:36 -03:00
CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS"
2022-02-17 13:16:52 -03:00
CXXFLAGS="$PIE_FLAGS $CORE_CXXFLAGS $CXXFLAGS"
2017-08-22 11:48:26 -03:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h>
#ifndef QT_VERSION
# include <QtCore/qglobal.h>
#endif
]],
2015-11-09 22:52:37 -03:00
[[
2017-08-22 11:48:26 -03:00
#if defined(QT_REDUCE_RELOCATIONS)
choke
#endif
2015-11-09 22:52:37 -03:00
]])],
2021-11-10 01:09:11 -03:00
[ AC_MSG_RESULT([yes]); QT_PIE_FLAGS=$PIE_FLAGS ],
[ AC_MSG_RESULT([no]); QT_PIE_FLAGS=$PIC_FLAGS]
2015-11-09 22:52:37 -03:00
)
CPPFLAGS=$TEMP_CPPFLAGS
CXXFLAGS=$TEMP_CXXFLAGS
])
else
BITCOIN_QT_CHECK([
2021-10-07 21:13:36 -03:00
AC_MSG_CHECKING([whether -fPIC is needed with this Qt config])
2015-11-09 22:52:37 -03:00
TEMP_CPPFLAGS=$CPPFLAGS
2022-02-17 08:31:36 -03:00
CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS"
2017-08-22 11:48:26 -03:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h>
#ifndef QT_VERSION
# include <QtCore/qglobal.h>
#endif
]],
2015-11-09 22:52:37 -03:00
[[
2017-08-22 11:48:26 -03:00
#if defined(QT_REDUCE_RELOCATIONS)
choke
#endif
2015-11-09 22:52:37 -03:00
]])],
2021-11-10 01:09:11 -03:00
[ AC_MSG_RESULT([no])],
[ AC_MSG_RESULT([yes]); QT_PIE_FLAGS=$PIC_FLAGS]
2015-11-09 22:52:37 -03:00
)
CPPFLAGS=$TEMP_CPPFLAGS
])
fi
2018-06-13 11:02:49 -04:00
BITCOIN_QT_PATH_PROGS([MOC], [moc-qt5 moc5 moc], $qt_bin_path)
BITCOIN_QT_PATH_PROGS([UIC], [uic-qt5 uic5 uic], $qt_bin_path)
BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt5 rcc5 rcc], $qt_bin_path)
BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt5 lrelease5 lrelease], $qt_bin_path)
BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt5 lupdate5 lupdate],$qt_bin_path, yes)
2021-04-15 06:14:20 -04:00
BITCOIN_QT_PATH_PROGS([LCONVERT], [lconvert-qt5 lconvert5 lconvert], $qt_bin_path, yes)
2013-12-13 17:19:02 -03:00
2014-06-05 14:22:54 -04:00
MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)'
2013-12-13 17:19:02 -03:00
case $host in
*darwin*)
BITCOIN_QT_CHECK([
2014-01-13 06:30:20 -03:00
MOC_DEFS="${MOC_DEFS} -DQ_OS_MAC"
2020-11-25 13:18:36 -03:00
base_frameworks="-framework Foundation -framework AppKit"
2021-09-02 08:42:14 -04:00
AX_CHECK_LINK_FLAG([$base_frameworks], [QT_LIBS="$QT_LIBS $base_frameworks"], [AC_MSG_ERROR(could not find base frameworks)])
2013-12-13 17:19:02 -03:00
])
;;
2014-01-27 17:30:51 -03:00
*mingw*)
BITCOIN_QT_CHECK([
2021-11-10 01:09:11 -03:00
AX_CHECK_LINK_FLAG([-mwindows], [QT_LDFLAGS="$QT_LDFLAGS -mwindows"], [AC_MSG_WARN([-mwindows linker support not detected])])
2014-01-27 17:30:51 -03:00
])
2013-12-13 17:19:02 -03:00
esac
dnl enable qt support
2020-03-08 22:13:33 -03:00
AC_MSG_CHECKING([whether to build ]AC_PACKAGE_NAME[ GUI])
2013-12-13 17:19:02 -03:00
BITCOIN_QT_CHECK([
bitcoin_enable_qt=yes
bitcoin_enable_qt_test=yes
2021-11-24 09:16:53 -03:00
if test "$have_qt_test" = "no"; then
2013-12-13 17:19:02 -03:00
bitcoin_enable_qt_test=no
fi
2014-03-15 22:33:49 -03:00
bitcoin_enable_qt_dbus=no
2021-11-24 09:16:53 -03:00
if test "$use_dbus" != "no" && test "$have_qt_dbus" = "yes"; then
2014-03-15 22:33:49 -03:00
bitcoin_enable_qt_dbus=yes
fi
2021-11-24 09:16:53 -03:00
if test "$use_dbus" = "yes" && test "$have_qt_dbus" = "no"; then
2017-08-22 14:34:18 -03:00
AC_MSG_ERROR([libQtDBus not found. Install libQtDBus or remove --with-qtdbus.])
2013-12-13 17:19:02 -03:00
fi
2021-11-24 09:16:53 -03:00
if test "$LUPDATE" = ""; then
2021-04-15 06:14:20 -04:00
AC_MSG_WARN([lupdate tool is required to update Qt translations.])
fi
2021-11-24 09:16:53 -03:00
if test "$LCONVERT" = ""; then
2021-04-15 06:14:20 -04:00
AC_MSG_WARN([lconvert tool is required to update Qt translations.])
2013-12-13 17:19:02 -03:00
fi
],[
bitcoin_enable_qt=no
])
2021-11-24 09:16:53 -03:00
if test $bitcoin_enable_qt = "yes"; then
2020-08-09 18:19:54 -04:00
AC_MSG_RESULT([$bitcoin_enable_qt ($qt_lib_prefix)])
2019-09-30 20:03:16 -03:00
else
AC_MSG_RESULT([$bitcoin_enable_qt])
fi
2013-12-13 17:19:02 -03:00
2015-11-09 22:52:37 -03:00
AC_SUBST(QT_PIE_FLAGS)
2013-12-13 17:19:02 -03:00
AC_SUBST(QT_INCLUDES)
AC_SUBST(QT_LIBS)
2014-01-27 17:30:51 -03:00
AC_SUBST(QT_LDFLAGS)
2013-12-13 17:19:02 -03:00
AC_SUBST(QT_DBUS_INCLUDES)
AC_SUBST(QT_TEST_INCLUDES)
2018-06-13 11:02:49 -04:00
AC_SUBST(QT_SELECT, qt5)
2014-01-13 06:30:20 -03:00
AC_SUBST(MOC_DEFS)
2013-12-13 17:19:02 -03:00
])
2021-03-31 20:47:36 -03:00
dnl All macros below are internal and should _not_ be used from configure.ac.
2013-12-13 17:19:02 -03:00
2021-03-31 20:47:36 -03:00
dnl Internal. Check if the linked version of Qt was built statically.
dnl
dnl _BITCOIN_QT_IS_STATIC
dnl ---------------------
dnl
2018-05-19 10:22:47 -04:00
dnl Requires: INCLUDES and LIBS must be populated as necessary.
dnl Output: bitcoin_cv_static_qt=yes|no
AC_DEFUN([_BITCOIN_QT_IS_STATIC],[
AC_CACHE_CHECK(for static Qt, bitcoin_cv_static_qt,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h>
2020-03-08 22:10:44 -03:00
#ifndef QT_VERSION
2018-05-19 10:22:47 -04:00
# include <QtCore/qglobal.h>
#endif
]],
[[
#if !defined(QT_STATIC)
choke
#endif
]])],
[bitcoin_cv_static_qt=yes],
[bitcoin_cv_static_qt=no])
])
2013-12-13 17:19:02 -03:00
])
2021-03-04 15:07:06 -03:00
dnl Internal. Check if the link-requirements for a static plugin are met.
dnl
dnl _BITCOIN_QT_CHECK_STATIC_PLUGIN(PLUGIN, LIBRARIES)
dnl --------------------------------------------------
dnl
2013-12-13 17:19:02 -03:00
dnl Requires: INCLUDES and LIBS must be populated as necessary.
2021-03-04 15:07:06 -03:00
dnl Inputs: $1: A static plugin name.
2013-12-13 17:19:02 -03:00
dnl Inputs: $2: The libraries that resolve $1.
dnl Output: QT_LIBS is prepended or configure exits.
2021-03-04 15:07:06 -03:00
AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGIN], [
AC_MSG_CHECKING([for $1 ($2)])
2013-12-13 17:19:02 -03:00
CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS"
2020-03-09 09:40:21 -03:00
LIBS="$2${qt_lib_suffix} $QT_LIBS $LIBS"
2021-03-09 18:29:57 -03:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <QtPlugin>
Q_IMPORT_PLUGIN($1)
]])],
2021-03-04 15:07:06 -03:00
[AC_MSG_RESULT([yes]); QT_LIBS="$2${qt_lib_suffix} $QT_LIBS"],
[AC_MSG_RESULT([no]); BITCOIN_QT_FAIL([$1 not found.])])
2013-12-13 17:19:02 -03:00
LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS"
])
2021-03-04 15:34:38 -03:00
dnl Internal. Check Qt static libs with PKG_CHECK_MODULES.
dnl
dnl _BITCOIN_QT_CHECK_STATIC_LIBS
dnl -----------------------------
dnl
2021-03-04 15:56:46 -03:00
dnl Outputs: QT_LIBS is prepended.
2021-03-04 15:34:38 -03:00
AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_LIBS], [
2021-03-31 09:57:23 -03:00
PKG_CHECK_MODULES([QT_ACCESSIBILITY], [${qt_lib_prefix}AccessibilitySupport${qt_lib_suffix}], [QT_LIBS="$QT_ACCESSIBILITY_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_DEVICEDISCOVERY], [${qt_lib_prefix}DeviceDiscoverySupport${qt_lib_suffix}], [QT_LIBS="$QT_DEVICEDISCOVERY_LIBS $QT_LIBS"])
2021-04-03 04:27:04 -03:00
PKG_CHECK_MODULES([QT_EDID], [${qt_lib_prefix}EdidSupport${qt_lib_suffix}], [QT_LIBS="$QT_EDID_LIBS $QT_LIBS"])
2021-03-31 09:57:23 -03:00
PKG_CHECK_MODULES([QT_EVENTDISPATCHER], [${qt_lib_prefix}EventDispatcherSupport${qt_lib_suffix}], [QT_LIBS="$QT_EVENTDISPATCHER_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_FB], [${qt_lib_prefix}FbSupport${qt_lib_suffix}], [QT_LIBS="$QT_FB_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_FONTDATABASE], [${qt_lib_prefix}FontDatabaseSupport${qt_lib_suffix}], [QT_LIBS="$QT_FONTDATABASE_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_THEME], [${qt_lib_prefix}ThemeSupport${qt_lib_suffix}], [QT_LIBS="$QT_THEME_LIBS $QT_LIBS"])
2021-11-24 09:16:53 -03:00
if test "$TARGET_OS" = "linux"; then
2021-08-27 10:50:30 -04:00
PKG_CHECK_MODULES([QT_INPUT], [${qt_lib_prefix}InputSupport], [QT_LIBS="$QT_INPUT_LIBS $QT_LIBS"])
2021-04-03 04:27:04 -03:00
PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"])
2021-03-31 09:57:23 -03:00
PKG_CHECK_MODULES([QT_XCBQPA], [${qt_lib_prefix}XcbQpa], [QT_LIBS="$QT_XCBQPA_LIBS $QT_LIBS"])
2020-07-29 06:29:58 -04:00
PKG_CHECK_MODULES([QT_XKBCOMMON], [${qt_lib_prefix}XkbCommonSupport], [QT_LIBS="$QT_XKBCOMMON_LIBS $QT_LIBS"])
2021-11-24 09:16:53 -03:00
elif test "$TARGET_OS" = "darwin"; then
2021-03-31 09:57:23 -03:00
PKG_CHECK_MODULES([QT_CLIPBOARD], [${qt_lib_prefix}ClipboardSupport${qt_lib_suffix}], [QT_LIBS="$QT_CLIPBOARD_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_GRAPHICS], [${qt_lib_prefix}GraphicsSupport${qt_lib_suffix}], [QT_LIBS="$QT_GRAPHICS_LIBS $QT_LIBS"])
2021-04-03 04:27:04 -03:00
PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport${qt_lib_suffix}], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"])
2021-11-24 09:16:53 -03:00
elif test "$TARGET_OS" = "windows"; then
2021-03-31 09:57:23 -03:00
PKG_CHECK_MODULES([QT_WINDOWSUIAUTOMATION], [${qt_lib_prefix}WindowsUIAutomationSupport${qt_lib_suffix}], [QT_LIBS="$QT_WINDOWSUIAUTOMATION_LIBS $QT_LIBS"])
2021-11-24 09:16:53 -03:00
elif test "$TARGET_OS" = "android"; then
2020-07-29 06:29:58 -04:00
PKG_CHECK_MODULES([QT_EGL], [${qt_lib_prefix}EglSupport${qt_lib_suffix}], [QT_LIBS="$QT_EGL_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport${qt_lib_suffix}], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"])
2021-03-04 16:24:11 -03:00
fi
2015-08-01 00:21:34 -03:00
])
2013-12-13 17:19:02 -03:00
dnl Internal. Find Qt libraries using pkg-config.
2021-03-31 20:47:36 -03:00
dnl
dnl _BITCOIN_QT_FIND_LIBS
dnl ---------------------
dnl
2013-12-13 17:19:02 -03:00
dnl Outputs: All necessary QT_* variables are set.
dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
2020-03-08 21:41:03 -03:00
AC_DEFUN([_BITCOIN_QT_FIND_LIBS],[
2020-08-09 18:19:54 -04:00
BITCOIN_QT_CHECK([
2021-03-31 09:58:01 -03:00
PKG_CHECK_MODULES([QT_CORE], [${qt_lib_prefix}Core${qt_lib_suffix} $qt_version], [QT_INCLUDES="$QT_CORE_CFLAGS $QT_INCLUDES" QT_LIBS="$QT_CORE_LIBS $QT_LIBS"],
2020-03-09 09:40:21 -03:00
[BITCOIN_QT_FAIL([${qt_lib_prefix}Core${qt_lib_suffix} $qt_version not found])])
2020-08-09 18:19:54 -04:00
])
BITCOIN_QT_CHECK([
2021-03-31 09:58:01 -03:00
PKG_CHECK_MODULES([QT_GUI], [${qt_lib_prefix}Gui${qt_lib_suffix} $qt_version], [QT_INCLUDES="$QT_GUI_CFLAGS $QT_INCLUDES" QT_LIBS="$QT_GUI_LIBS $QT_LIBS"],
2020-03-09 09:40:21 -03:00
[BITCOIN_QT_FAIL([${qt_lib_prefix}Gui${qt_lib_suffix} $qt_version not found])])
2020-08-09 18:19:54 -04:00
])
BITCOIN_QT_CHECK([
2021-03-31 09:58:01 -03:00
PKG_CHECK_MODULES([QT_WIDGETS], [${qt_lib_prefix}Widgets${qt_lib_suffix} $qt_version], [QT_INCLUDES="$QT_WIDGETS_CFLAGS $QT_INCLUDES" QT_LIBS="$QT_WIDGETS_LIBS $QT_LIBS"],
2020-03-09 09:40:21 -03:00
[BITCOIN_QT_FAIL([${qt_lib_prefix}Widgets${qt_lib_suffix} $qt_version not found])])
2020-08-09 18:19:54 -04:00
])
BITCOIN_QT_CHECK([
2021-03-31 09:58:01 -03:00
PKG_CHECK_MODULES([QT_NETWORK], [${qt_lib_prefix}Network${qt_lib_suffix} $qt_version], [QT_INCLUDES="$QT_NETWORK_CFLAGS $QT_INCLUDES" QT_LIBS="$QT_NETWORK_LIBS $QT_LIBS"],
2020-03-09 09:40:21 -03:00
[BITCOIN_QT_FAIL([${qt_lib_prefix}Network${qt_lib_suffix} $qt_version not found])])
2020-08-09 18:19:54 -04:00
])
2013-12-13 17:19:02 -03:00
2020-08-09 18:19:54 -04:00
BITCOIN_QT_CHECK([
2020-03-09 09:40:21 -03:00
PKG_CHECK_MODULES([QT_TEST], [${qt_lib_prefix}Test${qt_lib_suffix} $qt_version], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
2021-11-24 09:16:53 -03:00
if test "$use_dbus" != "no"; then
2020-08-09 18:19:54 -04:00
PKG_CHECK_MODULES([QT_DBUS], [${qt_lib_prefix}DBus $qt_version], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no])
fi
2013-12-13 17:19:02 -03:00
])
])