@@ -81,8 +81,6 @@ AC_DEFUN([BITCOIN_QT_INIT],[
8181
8282dnl Find the appropriate version of Qt libraries and includes.
8383dnl Inputs: $1: Whether or not pkg-config should be used. yes|no. Default: yes.
84- dnl Inputs: $2: If $1 is "yes" and --with-gui=auto, which qt version should be
85- dnl tried first.
8684dnl Outputs: See _BITCOIN_QT_FIND_LIBS_*
8785dnl Outputs: Sets variables for all qt-related tools.
8886dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test
@@ -99,6 +97,12 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
9997 BITCOIN_QT_CHECK([ _BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG] )
10098 fi
10199
100+ BITCOIN_QT_CHECK([
101+ if test "x$bitcoin_cv_qt_minimumrequired" != xyes; then
102+ BITCOIN_QT_FAIL([ Qt version not supported] )
103+ fi
104+ ] )
105+
102106 dnl This is ugly and complicated. Yuck. Works as follows:
103107 dnl For Qt5, we can check a header to find out whether Qt is build
104108 dnl statically. When Qt is built statically, some plugins must be linked into
@@ -211,7 +215,6 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
211215 ] )
212216 esac
213217
214-
215218 dnl enable qt support
216219 AC_MSG_CHECKING ( whether to build ]AC_PACKAGE_NAME [ GUI)
217220 BITCOIN_QT_CHECK([
@@ -257,9 +260,9 @@ dnl ----
257260
258261dnl Internal. Check included version of Qt against minimum specified in doc/dependencies.md
259262dnl Requires: INCLUDES must be populated as necessary.
260- dnl Output: bitcoin_cv_qt5 =yes|no
261- AC_DEFUN ( [ _BITCOIN_QT_CHECK_QT5 ] ,[
262- AC_CACHE_CHECK ( for Qt 5 , bitcoin_cv_qt5 ,[
263+ dnl Output: bitcoin_cv_qt_minimumrequired =yes|no
264+ AC_DEFUN ( [ _BITCOIN_QT_CHECK_MINIMUM_REQUIRED ] ,[
265+ AC_CACHE_CHECK ( for Qt >= 5.5.1 , bitcoin_cv_qt_minimumrequired ,[
263266 AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
264267 #include <QtCore/qconfig.h>
265268 #ifndef QT_VERSION
@@ -271,15 +274,15 @@ AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[
271274 choke
272275 #endif
273276 ] ] ) ] ,
274- [ bitcoin_cv_qt5 =yes] ,
275- [ bitcoin_cv_qt5 =no] )
277+ [ bitcoin_cv_qt_minimumrequired =yes] ,
278+ [ bitcoin_cv_qt_minimumrequired =no] )
276279] ) ] )
277280
278- dnl Internal. Check if the included version of Qt is greater than Qt58 .
281+ dnl Internal. Check if the included version of Qt is >= 5.8 .
279282dnl Requires: INCLUDES must be populated as necessary.
280283dnl Output: bitcoin_cv_qt58=yes|no
281284AC_DEFUN ( [ _BITCOIN_QT_CHECK_QT58] ,[
282- AC_CACHE_CHECK ( for > Qt 5.7 , bitcoin_cv_qt58 ,[
285+ AC_CACHE_CHECK ( for >= Qt 5.8 , bitcoin_cv_qt58 ,[
283286 AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
284287 #include <QtCore/qconfig.h>
285288 #ifndef QT_VERSION
@@ -410,10 +413,6 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
410413] )
411414
412415dnl Internal. Find Qt libraries using pkg-config.
413- dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to check
414- dnl first.
415- dnl Inputs: $1 : If bitcoin_qt_want_version is "auto", check for this version
416- dnl first.
417416dnl Outputs: All necessary QT_* variables are set.
418417dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
419418AC_DEFUN ( [ _BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG] ,[
@@ -434,14 +433,25 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[
434433 PKG_CHECK_MODULES([ QT_DBUS] , [ ${QT_LIB_PREFIX}DBus] , [ QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes] , [ have_qt_dbus=no] )
435434 fi
436435 ] )
436+ BITCOIN_QT_CHECK([
437+ AC_CACHE_CHECK ( for Qt >= 5.5.1 ,bitcoin_cv_qt_minimumrequired ,
438+ PKG_CHECK_EXISTS ( Qt5Core < 5.5.1 ,[ bitcoin_cv_qt_minimumrequired=no] ,[ bitcoin_cv_qt_minimumrequired=yes] )
439+ )
440+ ] )
441+ BITCOIN_QT_CHECK([
442+ AC_CACHE_CHECK ( for Qt >= 5.8.0 ,bitcoin_cv_qt58 ,
443+ PKG_CHECK_EXISTS ( Qt5Core < 5.8.0 ,[ bitcoin_cv_qt58=no] ,[ bitcoin_cv_qt58=yes] )
444+ )
445+ ] )
437446 ] )
438447 true; dnl
439448] )
440449
441450dnl Internal. Find Qt libraries without using pkg-config. Version is deduced
442451dnl from the discovered headers.
443452dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to use.
444- dnl If "auto", the version will be discovered by _BITCOIN_QT_CHECK_QT5.
453+ dnl If "auto", the version will be discovered by _BITCOIN_QT_CHECK_MINIMUM_REQUIRED
454+ dnl and _BITCOIN_QT_CHECK_QT58.
445455dnl Outputs: All necessary QT_* variables are set.
446456dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
447457AC_DEFUN ( [ _BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG] ,[
@@ -462,7 +472,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
462472
463473 BITCOIN_QT_CHECK([
464474 if test "x$bitcoin_qt_want_version" = xauto; then
465- _BITCOIN_QT_CHECK_QT5
475+ _BITCOIN_QT_CHECK_MINIMUM_REQUIRED
466476 _BITCOIN_QT_CHECK_QT58
467477 fi
468478 QT_LIB_PREFIX=Qt5
0 commit comments