message: build: Refactor out Qt version check macro
diff: @@ -254,22 +254,25 @@ dnl All macros below are internal and should _not_ be used from the main
  dnl configure.ac.
  dnl ----
  +dnl Internal. Check the included version of Qt against the passed minimum one.
  +dnl _BITCOIN_QT_VERSIONCHECK_PROGRAM([VERSION-MAJOR-NUMBER], [VERSION-MINOR-NUMBER], [VERSION-PATCH-NUMBER])
  +dnl Requires: INCLUDES must be populated as necessary.
  +m4_define([_BITCOIN_QT_VERSIONCHECK_PROGRAM],[
  + AC_LANG_PROGRAM([[
  + #include <QtGlobal>
  + ]],[[
  + #if (QT_VERSION < QT_VERSION_CHECK($1, $2, $3))
  + choke
  + #endif
  + ]])
  +])
  +
  dnl Internal. Check included version of Qt against minimum specified in doc/dependencies.md
  dnl Requires: INCLUDES must be populated as necessary.
  dnl Output: bitcoin_cv_qt_minimumrequired=yes|no
  AC_DEFUN([_BITCOIN_QT_CHECK_MINIMUM_REQUIRED],[
  - AC_CACHE_CHECK(for Qt >= 5.5.1, bitcoin_cv_qt_minimumrequired,[
  - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  - #include <QtCore/qconfig.h>
  - #ifndef QT_VERSION
  - # include <QtCore/qglobal.h>
  - #endif
  - ]],
  - [[
  - #if QT_VERSION < 0x050501
  - choke
  - #endif
  - ]])],
  + AC_CACHE_CHECK([for Qt >= 5.5.1], bitcoin_cv_qt_minimumrequired,[
  + AC_COMPILE_IFELSE([_BITCOIN_QT_VERSIONCHECK_PROGRAM(5,5,1)],
  [bitcoin_cv_qt_minimumrequired=yes],
  [bitcoin_cv_qt_minimumrequired=no])
  ])])
  @@ -279,17 +282,7 @@ dnl Requires: INCLUDES must be populated as necessary.
  dnl Output: bitcoin_cv_qt58=yes|no
  AC_DEFUN([_BITCOIN_QT_CHECK_QT58],[
  AC_CACHE_CHECK([for Qt >= 5.8], bitcoin_cv_qt58,[
  - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  - #include <QtCore/qconfig.h>
  - #ifndef QT_VERSION
  - # include <QtCore/qglobal.h>
  - #endif
  - ]],
  - [[
  - #if QT_VERSION_MINOR < 8
  - choke
  - #endif
  - ]])],
  + AC_COMPILE_IFELSE([_BITCOIN_QT_VERSIONCHECK_PROGRAM(5,8,0)],
  [bitcoin_cv_qt58=yes],
  [bitcoin_cv_qt58=no])
  ])])
  @@ -373,18 +366,8 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
  ])
  else
  if test "x$TARGET_OS" = xwindows; then
  - AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[
  - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  - #include <QtCore/qconfig.h>
  - #ifndef QT_VERSION
  - # include <QtCore/qglobal.h>
  - #endif
  - ]],
  - [[
  - #if QT_VERSION < 0x050600 || QT_VERSION_MINOR < 6
  - choke
  - #endif
  - ]])],
  + AC_CACHE_CHECK([for Qt >= 5.6], bitcoin_cv_need_platformsupport,[
  + AC_COMPILE_IFELSE([_BITCOIN_QT_VERSIONCHECK_PROGRAM(5,6,0)],
  [bitcoin_cv_need_platformsupport=yes],
  [bitcoin_cv_need_platformsupport=no])
  ])
  