aboutsummaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-08-10 01:19:54 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-08-10 02:10:28 +0300
commit4af4672525f698c7b491023fcd36a17a4e982070 (patch)
tree783e3c592075c4d85b8198847e6f030366179c2b /build-aux
parent30e336f785e1b662cade3cfacea91a9785ea1023 (diff)
build, qt: Add Qt version checking
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/m4/bitcoin_qt.m447
1 files changed, 29 insertions, 18 deletions
diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4
index bc6cb53c84..dc9bc544da 100644
--- a/build-aux/m4/bitcoin_qt.m4
+++ b/build-aux/m4/bitcoin_qt.m4
@@ -80,10 +80,15 @@ AC_DEFUN([BITCOIN_QT_INIT],[
])
dnl Find Qt libraries and includes.
+dnl
+dnl BITCOIN_QT_CONFIGURE([MINIMUM-VERSION])
+dnl
dnl Outputs: See _BITCOIN_QT_FIND_LIBS
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],[
+ qt_version=">= $1"
+ qt_lib_prefix="Qt5"
BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS])
dnl This is ugly and complicated. Yuck. Works as follows:
@@ -221,7 +226,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
bitcoin_enable_qt=no
])
if test x$bitcoin_enable_qt = xyes; then
- AC_MSG_RESULT([$bitcoin_enable_qt ($QT_LIB_PREFIX)])
+ AC_MSG_RESULT([$bitcoin_enable_qt ($qt_lib_prefix)])
else
AC_MSG_RESULT([$bitcoin_enable_qt])
fi
@@ -315,23 +320,29 @@ dnl Internal. Find Qt libraries using pkg-config.
dnl Outputs: All necessary QT_* variables are set.
dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
AC_DEFUN([_BITCOIN_QT_FIND_LIBS],[
- m4_ifdef([PKG_CHECK_MODULES],[
- QT_LIB_PREFIX=Qt5
- qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets"
- BITCOIN_QT_CHECK([
- PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" have_qt=yes],[have_qt=no])
+ BITCOIN_QT_CHECK([
+ PKG_CHECK_MODULES([QT_CORE], [${qt_lib_prefix}Core $qt_version], [],
+ [BITCOIN_QT_FAIL([${qt_lib_prefix}Core $qt_version not found])])
+ ])
+ BITCOIN_QT_CHECK([
+ PKG_CHECK_MODULES([QT_GUI], [${qt_lib_prefix}Gui $qt_version], [],
+ [BITCOIN_QT_FAIL([${qt_lib_prefix}Gui $qt_version not found])])
+ ])
+ BITCOIN_QT_CHECK([
+ PKG_CHECK_MODULES([QT_WIDGETS], [${qt_lib_prefix}Widgets $qt_version], [],
+ [BITCOIN_QT_FAIL([${qt_lib_prefix}Widgets $qt_version not found])])
+ ])
+ BITCOIN_QT_CHECK([
+ PKG_CHECK_MODULES([QT_NETWORK], [${qt_lib_prefix}Network $qt_version], [],
+ [BITCOIN_QT_FAIL([${qt_lib_prefix}Network $qt_version not found])])
+ ])
+ QT_INCLUDES="$QT_CORE_CFLAGS $QT_GUI_CFLAGS $QT_WIDGETS_CFLAGS $QT_NETWORK_CFLAGS"
+ QT_LIBS="$QT_CORE_LIBS $QT_GUI_LIBS $QT_WIDGETS_LIBS $QT_NETWORK_LIBS"
- if test "x$have_qt" != xyes; then
- have_qt=no
- BITCOIN_QT_FAIL([Qt dependencies not found])
- fi
- ])
- BITCOIN_QT_CHECK([
- PKG_CHECK_MODULES([QT_TEST], [${QT_LIB_PREFIX}Test], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
- if test "x$use_dbus" != xno; then
- PKG_CHECK_MODULES([QT_DBUS], [${QT_LIB_PREFIX}DBus], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no])
- fi
- ])
+ BITCOIN_QT_CHECK([
+ PKG_CHECK_MODULES([QT_TEST], [${qt_lib_prefix}Test $qt_version], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
+ if test "x$use_dbus" != xno; then
+ 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
])
- true; dnl
])