From 49ac41045bfcbfea339d099c5edbfa2b4cd8cb9c Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 Apr 2026 06:38:51 +0000 Subject: [PATCH] Modernize Qt dependency path --- Makefile.in | 11 +- build-aux/m4/bitcoin_qt.m4 | 100 +- configure | 1641 ++++++++++++++++++++++++++- configure.ac | 4 +- contrib/build-linux-wallet.sh | 30 +- contrib/smoke-test-daemon.sh | 7 +- contrib/smoke-test-qt.sh | 48 + contrib/smoke-test-wallet.sh | 102 ++ depends/packages/openssl.mk | 2 +- depends/packages/packages.mk | 2 +- depends/packages/qt.mk | 180 +-- depends/packages/xcb_proto.mk | 9 + doc/build-ubuntu-24.md | 40 +- doc/build-wallets.md | 18 +- doc/dependencies.md | 10 +- doc/man/Makefile.in | 6 +- src/Makefile.in | 6 +- src/config/agrarian-config.h.in | 7 +- src/qt/agrarian.cpp | 21 +- src/qt/bantablemodel.cpp | 6 +- src/qt/bitcoinamountfield.cpp | 5 +- src/qt/bitcoingui.cpp | 33 +- src/qt/blockexplorer.cpp | 3 +- src/qt/clientmodel.cpp | 6 +- src/qt/coincontroldialog.cpp | 7 +- src/qt/guiutil.cpp | 27 +- src/qt/optionsdialog.cpp | 2 +- src/qt/optionsmodel.cpp | 8 +- src/qt/paymentserver.h | 2 +- src/qt/recentrequeststablemodel.cpp | 2 +- src/qt/recentrequeststablemodel.h | 4 +- src/qt/res/css/default.css | 2 +- src/qt/rpcconsole.cpp | 10 +- src/qt/sendcoinsdialog.cpp | 8 + src/qt/splashscreen.cpp | 2 + src/qt/transactionfilterproxy.cpp | 4 +- src/qt/transactiontablemodel.cpp | 2 +- src/qt/transactionview.cpp | 6 +- src/qt/utilitydialog.cpp | 5 +- src/qt/walletview.cpp | 2 +- src/qt/zagrcontroldialog.cpp | 7 +- src/sync.h | 3 +- src/wallet/rpcwallet.cpp | 2 +- 43 files changed, 2034 insertions(+), 368 deletions(-) create mode 100755 contrib/smoke-test-qt.sh create mode 100755 contrib/smoke-test-wallet.sh diff --git a/Makefile.in b/Makefile.in index 610393c0..4edd863b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -237,8 +237,9 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/test/functional/test_runner.py \ $(top_srcdir)/test/util/bitcoin-util-test.py \ $(top_srcdir)/test/util/rpcauth-test.py COPYING INSTALL \ - build-aux/compile build-aux/config.guess build-aux/config.sub \ - build-aux/install-sh build-aux/ltmain.sh build-aux/missing + README.md build-aux/compile build-aux/config.guess \ + build-aux/config.sub build-aux/install-sh build-aux/ltmain.sh \ + build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -354,6 +355,7 @@ EVENT_PTHREADS_LIBS = @EVENT_PTHREADS_LIBS@ EXEEXT = @EXEEXT@ EXTENDED_FUNCTIONAL_TESTS = @EXTENDED_FUNCTIONAL_TESTS@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GCOV = @GCOV@ GENHTML = @GENHTML@ GENISOIMAGE = @GENISOIMAGE@ @@ -364,7 +366,7 @@ GREP = @GREP@ HARDENED_CPPFLAGS = @HARDENED_CPPFLAGS@ HARDENED_CXXFLAGS = @HARDENED_CXXFLAGS@ HARDENED_LDFLAGS = @HARDENED_LDFLAGS@ -HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HEXDUMP = @HEXDUMP@ IMAGEMAGICK_CONVERT = @IMAGEMAGICK_CONVERT@ INSTALL = @INSTALL@ @@ -435,8 +437,6 @@ PYTHON = @PYTHON@ PYTHONPATH = @PYTHONPATH@ QR_CFLAGS = @QR_CFLAGS@ QR_LIBS = @QR_LIBS@ -QT5_CFLAGS = @QT5_CFLAGS@ -QT5_LIBS = @QT5_LIBS@ QTACCESSIBILITY_CFLAGS = @QTACCESSIBILITY_CFLAGS@ QTACCESSIBILITY_LIBS = @QTACCESSIBILITY_LIBS@ QTCGL_CFLAGS = @QTCGL_CFLAGS@ @@ -459,6 +459,7 @@ QTTHEME_CFLAGS = @QTTHEME_CFLAGS@ QTTHEME_LIBS = @QTTHEME_LIBS@ QTXCBQPA_CFLAGS = @QTXCBQPA_CFLAGS@ QTXCBQPA_LIBS = @QTXCBQPA_LIBS@ +QT_CFLAGS = @QT_CFLAGS@ QT_DBUS_CFLAGS = @QT_DBUS_CFLAGS@ QT_DBUS_INCLUDES = @QT_DBUS_INCLUDES@ QT_DBUS_LIBS = @QT_DBUS_LIBS@ diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 index 39c1a567..4ade2c0a 100644 --- a/build-aux/m4/bitcoin_qt.m4 +++ b/build-aux/m4/bitcoin_qt.m4 @@ -53,7 +53,7 @@ dnl CAUTION: Do not use this inside of a conditional. AC_DEFUN([BITCOIN_QT_INIT],[ dnl enable qt support AC_ARG_WITH([gui], - [AS_HELP_STRING([--with-gui@<:@=no|qt5|auto@:>@], + [AS_HELP_STRING([--with-gui@<:@=no|qt5|qt6|auto@:>@], [build agrarian-qt GUI (default=auto)])], [ bitcoin_qt_want_version=$withval @@ -136,11 +136,19 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ fi _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)],[-lqminimal]) AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists]) + if test "x$QT_LIB_PREFIX" = xQt6; then + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QTlsBackendOpenSSL)],[-lqopensslbackend -lssl -lcrypto]) + AC_DEFINE(QT_TLS_OPENSSL, 1, [Define this symbol if the Qt OpenSSL TLS backend exists]) + fi if test "x$TARGET_OS" = xwindows; then _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows]) AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows]) elif test "x$TARGET_OS" = xlinux; then - _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static]) + if test "x$QT_LIB_PREFIX" = xQt6; then + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb]) + else + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static]) + fi AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb]) elif test "x$TARGET_OS" = xdarwin; then AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)]) @@ -153,7 +161,13 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ ]) if test "x$use_pkgconfig$qt_bin_path" = xyes; then - qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`" + qt_bin_path="`$PKG_CONFIG --variable=host_bins ${QT_LIB_PREFIX}Core 2>/dev/null`" + fi + if test "x$qt_bin_path" != x && test -d "$qt_bin_path/../libexec"; then + qt_bin_path="$qt_bin_path$PATH_SEPARATOR$qt_bin_path/../libexec" + fi + if test "x$qt_bin_path" != x; then + qt_bin_path="$qt_bin_path$PATH_SEPARATOR$PATH" fi if test "x$use_hardening" != xno; then @@ -203,11 +217,11 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ ]) fi - 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) + BITCOIN_QT_PATH_PROGS([MOC], [moc-qt6 moc6 moc-qt5 moc5 moc], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([UIC], [uic-qt6 uic6 uic-qt5 uic5 uic], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt6 rcc6 rcc-qt5 rcc5 rcc], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt6 lrelease6 lrelease-qt5 lrelease5 lrelease], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt6 lupdate6 lupdate-qt5 lupdate5 lupdate],$qt_bin_path, yes) MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)' case $host in @@ -246,7 +260,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ ],[ bitcoin_enable_qt=no ]) - AC_MSG_RESULT([$bitcoin_enable_qt (Qt5)]) + AC_MSG_RESULT([$bitcoin_enable_qt ($QT_LIB_PREFIX)]) AC_SUBST(QT_PIE_FLAGS) AC_SUBST(QT_INCLUDES) @@ -256,7 +270,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ AC_SUBST(QT_DBUS_LIBS) AC_SUBST(QT_TEST_INCLUDES) AC_SUBST(QT_TEST_LIBS) - AC_SUBST(QT_SELECT, qt5) + AC_SUBST(QT_SELECT) AC_SUBST(MOC_DEFS) ]) @@ -284,6 +298,26 @@ AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[ [bitcoin_cv_qt5=no]) ])]) +dnl Internal. Check if the included version of Qt is Qt6. +dnl Requires: INCLUDES must be populated as necessary. +dnl Output: bitcoin_cv_qt6=yes|no +AC_DEFUN([_BITCOIN_QT_CHECK_QT6],[ + AC_CACHE_CHECK(for Qt 6, bitcoin_cv_qt6,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #ifndef QT_VERSION + # include + #endif + ]], + [[ + #if QT_VERSION < 0x060000 || QT_VERSION_MAJOR < 6 + choke + #endif + ]])], + [bitcoin_cv_qt6=yes], + [bitcoin_cv_qt6=no]) +])]) + dnl Internal. Check if the included version of Qt is greater than Qt58. dnl Requires: INCLUDES must be populated as necessary. dnl Output: bitcoin_cv_qt5=yes|no @@ -359,6 +393,28 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[ if test -d "$qt_plugin_path/accessible"; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" fi + if test "x$QT_LIB_PREFIX" = xQt6; then + if test -d "$qt_plugin_path/imageformats"; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/imageformats" + fi + if test -d "$qt_plugin_path/tls"; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/tls" + fi + if test -d "$qt_plugin_path/platforminputcontexts"; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforminputcontexts" + fi + if test -d "$qt_plugin_path/generic"; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/generic" + fi + if test "x$TARGET_OS" = xlinux; then + QT_LIBS="-lQt6XcbQpa -lQt6InputSupport -lQt6FbSupport -lQt6DeviceDiscoverySupport $QT_LIBS" + QT_LIBS="$QT_LIBS -lQt6BundledHarfbuzz -lQt6BundledLibpng -lQt6BundledLibjpeg -lQt6BundledPcre2" + if test "x$PKG_CONFIG" != x; then + QT6_XCB_LIBS=`PKG_CONFIG_LIBDIR=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig $PKG_CONFIG --libs --static x11 x11-xcb xcb xcb-cursor xcb-icccm xcb-image xcb-keysyms xcb-randr xcb-renderutil xcb-shape xcb-shm xcb-sync xcb-xfixes xcb-xkb xkbcommon xkbcommon-x11 fontconfig freetype2 harfbuzz 2>/dev/null` + QT_LIBS="$QT_LIBS $QT6_XCB_LIBS" + fi + fi + else if test "x$use_pkgconfig" = xyes; then : dnl m4_ifdef([PKG_CHECK_MODULES],[ @@ -415,6 +471,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[ fi fi fi + fi fi ]) @@ -427,14 +484,17 @@ 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_WITH_PKGCONFIG],[ m4_ifdef([PKG_CHECK_MODULES],[ - QT_LIB_PREFIX=Qt5 - qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets" + QT_LIB_PREFIX=Qt6 + qt_modules="Qt6Core Qt6Gui Qt6Network Qt6Widgets" + if test "x$bitcoin_qt_want_version" = xqt5; then + QT_LIB_PREFIX=Qt5 + qt_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets" + fi BITCOIN_QT_CHECK([ - PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" have_qt=yes],[have_qt=no]) + PKG_CHECK_MODULES([QT], [$qt_modules], [QT_INCLUDES="$QT_CFLAGS"; QT_LIBS="$QT_LIBS" have_qt=yes],[have_qt=no]) if test "x$have_qt" != xyes; then - have_qt=no - BITCOIN_QT_FAIL([Qt dependencies not found]) + _BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG fi ]) BITCOIN_QT_CHECK([ @@ -471,10 +531,17 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ BITCOIN_QT_CHECK([ if test "x$bitcoin_qt_want_version" = xauto; then + _BITCOIN_QT_CHECK_QT6 _BITCOIN_QT_CHECK_QT5 _BITCOIN_QT_CHECK_QT58 fi - QT_LIB_PREFIX=Qt5 + QT_LIB_PREFIX=Qt6 + if test "x$bitcoin_qt_want_version" = xqt5; then + QT_LIB_PREFIX=Qt5 + fi + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_cv_qt6" != xyes; then + QT_LIB_PREFIX=Qt5 + fi ]) BITCOIN_QT_CHECK([ @@ -527,4 +594,3 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ CXXFLAGS="$TEMP_CXXFLAGS" LIBS="$TEMP_LIBS" ]) - diff --git a/configure b/configure index eb8d44b6..41692627 100755 --- a/configure +++ b/configure @@ -783,7 +783,6 @@ QT_SELECT QT_TEST_INCLUDES QT_DBUS_INCLUDES QT_LDFLAGS -QT_LIBS QT_INCLUDES QT_PIE_FLAGS LUPDATE @@ -819,8 +818,8 @@ QT_DBUS_LIBS QT_DBUS_CFLAGS QT_TEST_LIBS QT_TEST_CFLAGS -QT5_LIBS -QT5_CFLAGS +QT_LIBS +QT_CFLAGS QT_TRANSLATION_DIR BDB_CPPFLAGS BDB_LIBS @@ -903,7 +902,7 @@ OBJCXXDEPMODE ac_ct_OBJCXX OBJCXXFLAGS OBJCXX -HAVE_CXX11 +HAVE_CXX17 am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE @@ -1084,8 +1083,8 @@ PKG_CONFIG_LIBDIR CPP BDB_CFLAGS BDB_LIBS -QT5_CFLAGS -QT5_LIBS +QT_CFLAGS +QT_LIBS QT_TEST_CFLAGS QT_TEST_LIBS QT_DBUS_CFLAGS @@ -1828,7 +1827,7 @@ Optional Packages: --with-libs build libraries (default=no) --with-daemon build agrariand daemon (default=yes) --with-incompatible-bdb allow using a bdb version other than 4.8 - --with-gui[=no|qt5|auto] + --with-gui[=no|qt5|qt6|auto] build agrarian-qt GUI (default=auto) --with-qt-incdir=INC_DIR specify qt include path (overridden by pkgconfig) @@ -1904,8 +1903,8 @@ Some influential environment variables: CPP C preprocessor BDB_CFLAGS C compiler flags for BerkeleyDB, bypasses autodetection BDB_LIBS Linker flags for BerkeleyDB, bypasses autodetection - QT5_CFLAGS C compiler flags for QT5, overriding pkg-config - QT5_LIBS linker flags for QT5, overriding pkg-config + QT_CFLAGS C compiler flags for QT, overriding pkg-config + QT_LIBS linker flags for QT, overriding pkg-config QT_TEST_CFLAGS C compiler flags for QT_TEST, overriding pkg-config QT_TEST_LIBS @@ -5181,8 +5180,8 @@ case $host in ;; esac - ax_cxx_compile_cxx11_required=true - ax_cxx_compile_cxx11_try_default=false + ax_cxx_compile_cxx17_required=true + ax_cxx_compile_cxx17_try_default=false ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5195,10 +5194,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test x$ac_success = xno; then - for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 -printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } + for switch in -std=c++17 -std=c++0x +std=c++17 "-h std=c++17"; do + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 +printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 @@ -5493,6 +5492,177 @@ namespace cxx11 + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_seperators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include + +namespace cxx17 +{ + + namespace test_if_constexpr + { + + template + constexpr int test(T) + { + if constexpr (std::is_integral::value) + return 1; + else + return 0; + } + + static_assert(test(1) == 1, ""); + static_assert(test(1.0) == 0, ""); + + } + + namespace test_inline_variables + { + + struct constants + { + inline static constexpr int value = 17; + }; + + static_assert(constants::value == 17, ""); + + } + +} // namespace cxx17 + +#endif // __cplusplus >= 201703L + + + _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : @@ -5522,19 +5692,19 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ax_cxx_compile_cxx17_required = xtrue; then if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 + as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 fi fi if test x$ac_success = xno; then - HAVE_CXX11=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} + HAVE_CXX17=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;} else - HAVE_CXX11=1 + HAVE_CXX17=1 -printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h +printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h fi @@ -26442,27 +26612,31 @@ fi true - QT_LIB_PREFIX=Qt5 - qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets" + QT_LIB_PREFIX=Qt6 + qt_modules="Qt6Core Qt6Gui Qt6Network Qt6Widgets" + if test "x$bitcoin_qt_want_version" = xqt5; then + QT_LIB_PREFIX=Qt5 + qt_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets" + fi if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then true pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $qt5_modules" >&5 -printf %s "checking for $qt5_modules... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $qt_modules" >&5 +printf %s "checking for $qt_modules... " >&6; } -if test -n "$QT5_CFLAGS"; then - pkg_cv_QT5_CFLAGS="$QT5_CFLAGS" +if test -n "$QT_CFLAGS"; then + pkg_cv_QT_CFLAGS="$QT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$qt5_modules\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$qt5_modules") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$qt_modules\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$qt_modules") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_QT5_CFLAGS=`$PKG_CONFIG --cflags "$qt5_modules" 2>/dev/null` + pkg_cv_QT_CFLAGS=`$PKG_CONFIG --cflags "$qt_modules" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -26470,16 +26644,16 @@ fi else pkg_failed=untried fi -if test -n "$QT5_LIBS"; then - pkg_cv_QT5_LIBS="$QT5_LIBS" +if test -n "$QT_LIBS"; then + pkg_cv_QT_LIBS="$QT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$qt5_modules\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$qt5_modules") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$qt_modules\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$qt_modules") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_QT5_LIBS=`$PKG_CONFIG --libs "$qt5_modules" 2>/dev/null` + pkg_cv_QT_LIBS=`$PKG_CONFIG --libs "$qt_modules" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -26500,12 +26674,12 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - QT5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$qt5_modules" 2>&1` + QT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$qt_modules" 2>&1` else - QT5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$qt5_modules" 2>&1` + QT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$qt_modules" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$QT5_PKG_ERRORS" >&5 + echo "$QT_PKG_ERRORS" >&5 have_qt=no elif test $pkg_failed = untried; then @@ -26513,27 +26687,1207 @@ elif test $pkg_failed = untried; then printf "%s\n" "no" >&6; } have_qt=no else - QT5_CFLAGS=$pkg_cv_QT5_CFLAGS - QT5_LIBS=$pkg_cv_QT5_LIBS + QT_CFLAGS=$pkg_cv_QT_CFLAGS + QT_LIBS=$pkg_cv_QT_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" have_qt=yes + QT_INCLUDES="$QT_CFLAGS"; QT_LIBS="$QT_LIBS" have_qt=yes fi if test "x$have_qt" != xyes; then - have_qt=no + + TEMP_CPPFLAGS="$CPPFLAGS" + TEMP_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$PIC_FLAGS $CXXFLAGS" + TEMP_LIBS="$LIBS" + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + + if test "x$qt_include_path" != x; then + QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtWidgets -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus" + CPPFLAGS="$QT_INCLUDES $CPPFLAGS" + fi + + else + true + + fi + + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + ac_fn_cxx_check_header_compile "$LINENO" "QtPlugin" "ac_cv_header_QtPlugin" "$ac_includes_default" +if test "x$ac_cv_header_QtPlugin" = xyes +then : + +else $as_nop if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then if test "x$bitcoin_enable_qt" != xno; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Qt dependencies not found; agrarian-qt frontend will not be built" >&5 -printf "%s\n" "$as_me: WARNING: Qt dependencies not found; agrarian-qt frontend will not be built" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: QtCore headers missing; agrarian-qt frontend will not be built" >&5 +printf "%s\n" "$as_me: WARNING: QtCore headers missing; agrarian-qt frontend will not be built" >&2;} fi bitcoin_enable_qt=no bitcoin_enable_qt_test=no else - as_fn_error $? "Qt dependencies not found" "$LINENO" 5 + as_fn_error $? "QtCore headers missing" "$LINENO" 5 fi +fi + + else + true + + fi + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + ac_fn_cxx_check_header_compile "$LINENO" "QApplication" "ac_cv_header_QApplication" "$ac_includes_default" +if test "x$ac_cv_header_QApplication" = xyes +then : + +else $as_nop + + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: QtGui headers missing; agrarian-qt frontend will not be built" >&5 +printf "%s\n" "$as_me: WARNING: QtGui headers missing; agrarian-qt frontend will not be built" >&2;} + fi + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + else + as_fn_error $? "QtGui headers missing" "$LINENO" 5 + fi + +fi + + else + true + + fi + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + ac_fn_cxx_check_header_compile "$LINENO" "QLocalSocket" "ac_cv_header_QLocalSocket" "$ac_includes_default" +if test "x$ac_cv_header_QLocalSocket" = xyes +then : + +else $as_nop + + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: QtNetwork headers missing; agrarian-qt frontend will not be built" >&5 +printf "%s\n" "$as_me: WARNING: QtNetwork headers missing; agrarian-qt frontend will not be built" >&2;} + fi + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + else + as_fn_error $? "QtNetwork headers missing" "$LINENO" 5 + fi + +fi + + else + true + + fi + + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + + if test "x$bitcoin_qt_want_version" = xauto; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Qt 6" >&5 +printf %s "checking for Qt 6... " >&6; } +if test ${bitcoin_cv_qt6+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef QT_VERSION + # include + #endif + +int +main (void) +{ + + #if QT_VERSION < 0x060000 || QT_VERSION_MAJOR < 6 + choke + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + bitcoin_cv_qt6=yes +else $as_nop + bitcoin_cv_qt6=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bitcoin_cv_qt6" >&5 +printf "%s\n" "$bitcoin_cv_qt6" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Qt 5" >&5 +printf %s "checking for Qt 5... " >&6; } +if test ${bitcoin_cv_qt5+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef QT_VERSION + # include + #endif + +int +main (void) +{ + + #if QT_VERSION < 0x050000 || QT_VERSION_MAJOR < 5 + choke + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + bitcoin_cv_qt5=yes +else $as_nop + bitcoin_cv_qt5=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bitcoin_cv_qt5" >&5 +printf "%s\n" "$bitcoin_cv_qt5" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for > Qt 5.7" >&5 +printf %s "checking for > Qt 5.7... " >&6; } +if test ${bitcoin_cv_qt58+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef QT_VERSION + # include + #endif + +int +main (void) +{ + + #if QT_VERSION_MINOR < 8 + choke + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + bitcoin_cv_qt58=yes +else $as_nop + bitcoin_cv_qt58=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bitcoin_cv_qt58" >&5 +printf "%s\n" "$bitcoin_cv_qt58" >&6; } + fi + QT_LIB_PREFIX=Qt6 + if test "x$bitcoin_qt_want_version" = xqt5; then + QT_LIB_PREFIX=Qt5 + fi + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_cv_qt6" != xyes; then + QT_LIB_PREFIX=Qt5 + fi + + else + true + + fi + + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + + LIBS= + if test "x$qt_lib_path" != x; then + LIBS="$LIBS -L$qt_lib_path" + fi + + if test "x$TARGET_OS" = xwindows; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -limm32" >&5 +printf %s "checking for main in -limm32... " >&6; } +if test ${ac_cv_lib_imm32_main+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-limm32 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int main (); +} +int +main (void) +{ +return conftest::main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_imm32_main=yes +else $as_nop + ac_cv_lib_imm32_main=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_imm32_main" >&5 +printf "%s\n" "$ac_cv_lib_imm32_main" >&6; } +if test "x$ac_cv_lib_imm32_main" = xyes +then : + printf "%s\n" "#define HAVE_LIBIMM32 1" >>confdefs.h + + LIBS="-limm32 $LIBS" + +else $as_nop + + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libimm32 not found; agrarian-qt frontend will not be built" >&5 +printf "%s\n" "$as_me: WARNING: libimm32 not found; agrarian-qt frontend will not be built" >&2;} + fi + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + else + as_fn_error $? "libimm32 not found" "$LINENO" 5 + fi + +fi + + fi + + else + true + + fi + + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + as_ac_Lib=`printf "%s\n" "ac_cv_lib_z ""_main" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lz " >&5 +printf %s "checking for main in -lz ... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int main (); +} +int +main (void) +{ +return conftest::main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + printf "%s\n" "#define HAVE_LIBZ_ 1" >>confdefs.h + + LIBS="-lz $LIBS" + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib not found. Assuming qt has it built-in" >&5 +printf "%s\n" "$as_me: WARNING: zlib not found. Assuming qt has it built-in" >&2;} +fi + + else + true + + fi + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing jpeg_create_decompress " >&5 +printf %s "checking for library containing jpeg_create_decompress ... " >&6; } +if test ${ac_cv_search_jpeg_create_decompress_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int jpeg_create_decompress (); +} +int +main (void) +{ +return conftest::jpeg_create_decompress (); + ; + return 0; +} +_ACEOF +for ac_lib in '' qtjpeg jpeg +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_search_jpeg_create_decompress_=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_jpeg_create_decompress_+y} +then : + break +fi +done +if test ${ac_cv_search_jpeg_create_decompress_+y} +then : + +else $as_nop + ac_cv_search_jpeg_create_decompress_=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_jpeg_create_decompress_" >&5 +printf "%s\n" "$ac_cv_search_jpeg_create_decompress_" >&6; } +ac_res=$ac_cv_search_jpeg_create_decompress_ +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libjpeg not found. Assuming qt has it built-in" >&5 +printf "%s\n" "$as_me: WARNING: libjpeg not found. Assuming qt has it built-in" >&2;} +fi + + else + true + + fi + + if test x$bitcoin_cv_qt58 = xno; then + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing png_error " >&5 +printf %s "checking for library containing png_error ... " >&6; } +if test ${ac_cv_search_png_error_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int png_error (); +} +int +main (void) +{ +return conftest::png_error (); + ; + return 0; +} +_ACEOF +for ac_lib in '' qtpng png +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_search_png_error_=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_png_error_+y} +then : + break +fi +done +if test ${ac_cv_search_png_error_+y} +then : + +else $as_nop + ac_cv_search_png_error_=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_png_error_" >&5 +printf "%s\n" "$ac_cv_search_png_error_" >&6; } +ac_res=$ac_cv_search_png_error_ +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libpng not found. Assuming qt has it built-in" >&5 +printf "%s\n" "$as_me: WARNING: libpng not found. Assuming qt has it built-in" >&2;} +fi + + else + true + + fi + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing pcre16_exec" >&5 +printf %s "checking for library containing pcre16_exec... " >&6; } +if test ${ac_cv_search_pcre16_exec+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int pcre16_exec (); +} +int +main (void) +{ +return conftest::pcre16_exec (); + ; + return 0; +} +_ACEOF +for ac_lib in '' qtpcre pcre16 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_search_pcre16_exec=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_pcre16_exec+y} +then : + break +fi +done +if test ${ac_cv_search_pcre16_exec+y} +then : + +else $as_nop + ac_cv_search_pcre16_exec=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pcre16_exec" >&5 +printf "%s\n" "$ac_cv_search_pcre16_exec" >&6; } +ac_res=$ac_cv_search_pcre16_exec +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libpcre16 not found. Assuming qt has it built-in" >&5 +printf "%s\n" "$as_me: WARNING: libpcre16 not found. Assuming qt has it built-in" >&2;} +fi + + else + true + + fi + + else + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing png_error " >&5 +printf %s "checking for library containing png_error ... " >&6; } +if test ${ac_cv_search_png_error_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int png_error (); +} +int +main (void) +{ +return conftest::png_error (); + ; + return 0; +} +_ACEOF +for ac_lib in '' qtlibpng png +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_search_png_error_=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_png_error_+y} +then : + break +fi +done +if test ${ac_cv_search_png_error_+y} +then : + +else $as_nop + ac_cv_search_png_error_=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_png_error_" >&5 +printf "%s\n" "$ac_cv_search_png_error_" >&6; } +ac_res=$ac_cv_search_png_error_ +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libpng not found. Assuming qt has it built-in" >&5 +printf "%s\n" "$as_me: WARNING: libpng not found. Assuming qt has it built-in" >&2;} +fi + + else + true + + fi + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing pcre2_match_16" >&5 +printf %s "checking for library containing pcre2_match_16... " >&6; } +if test ${ac_cv_search_pcre2_match_16+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int pcre2_match_16 (); +} +int +main (void) +{ +return conftest::pcre2_match_16 (); + ; + return 0; +} +_ACEOF +for ac_lib in '' qtpcre2 libqtpcre2 +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_search_pcre2_match_16=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_pcre2_match_16+y} +then : + break +fi +done +if test ${ac_cv_search_pcre2_match_16+y} +then : + +else $as_nop + ac_cv_search_pcre2_match_16=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pcre2_match_16" >&5 +printf "%s\n" "$ac_cv_search_pcre2_match_16" >&6; } +ac_res=$ac_cv_search_pcre2_match_16 +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libqtpcre2 not found. Assuming qt has it built-in" >&5 +printf "%s\n" "$as_me: WARNING: libqtpcre2 not found. Assuming qt has it built-in" >&2;} +fi + + else + true + + fi + + fi + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing hb_ot_tags_from_script " >&5 +printf %s "checking for library containing hb_ot_tags_from_script ... " >&6; } +if test ${ac_cv_search_hb_ot_tags_from_script_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int hb_ot_tags_from_script (); +} +int +main (void) +{ +return conftest::hb_ot_tags_from_script (); + ; + return 0; +} +_ACEOF +for ac_lib in '' qtharfbuzzng qtharfbuzz harfbuzz +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_search_hb_ot_tags_from_script_=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_hb_ot_tags_from_script_+y} +then : + break +fi +done +if test ${ac_cv_search_hb_ot_tags_from_script_+y} +then : + +else $as_nop + ac_cv_search_hb_ot_tags_from_script_=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_hb_ot_tags_from_script_" >&5 +printf "%s\n" "$ac_cv_search_hb_ot_tags_from_script_" >&6; } +ac_res=$ac_cv_search_hb_ot_tags_from_script_ +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libharfbuzz not found. Assuming qt has it built-in or support is disabled" >&5 +printf "%s\n" "$as_me: WARNING: libharfbuzz not found. Assuming qt has it built-in or support is disabled" >&2;} +fi + + else + true + + fi + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + as_ac_Lib=`printf "%s\n" "ac_cv_lib_${QT_LIB_PREFIX}Core ""_main" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l${QT_LIB_PREFIX}Core " >&5 +printf %s "checking for main in -l${QT_LIB_PREFIX}Core ... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l${QT_LIB_PREFIX}Core $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int main (); +} +int +main (void) +{ +return conftest::main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_LIB${QT_LIB_PREFIX}Core " | $as_tr_cpp` 1 +_ACEOF + + LIBS="-l${QT_LIB_PREFIX}Core $LIBS" + +else $as_nop + + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: lib${QT_LIB_PREFIX}Core not found; agrarian-qt frontend will not be built" >&5 +printf "%s\n" "$as_me: WARNING: lib${QT_LIB_PREFIX}Core not found; agrarian-qt frontend will not be built" >&2;} + fi + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + else + as_fn_error $? "lib${QT_LIB_PREFIX}Core not found" "$LINENO" 5 + fi + +fi + + else + true + + fi + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + as_ac_Lib=`printf "%s\n" "ac_cv_lib_${QT_LIB_PREFIX}Gui ""_main" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l${QT_LIB_PREFIX}Gui " >&5 +printf %s "checking for main in -l${QT_LIB_PREFIX}Gui ... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l${QT_LIB_PREFIX}Gui $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int main (); +} +int +main (void) +{ +return conftest::main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_LIB${QT_LIB_PREFIX}Gui " | $as_tr_cpp` 1 +_ACEOF + + LIBS="-l${QT_LIB_PREFIX}Gui $LIBS" + +else $as_nop + + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: lib${QT_LIB_PREFIX}Gui not found; agrarian-qt frontend will not be built" >&5 +printf "%s\n" "$as_me: WARNING: lib${QT_LIB_PREFIX}Gui not found; agrarian-qt frontend will not be built" >&2;} + fi + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + else + as_fn_error $? "lib${QT_LIB_PREFIX}Gui not found" "$LINENO" 5 + fi + +fi + + else + true + + fi + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + as_ac_Lib=`printf "%s\n" "ac_cv_lib_${QT_LIB_PREFIX}Network""_main" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l${QT_LIB_PREFIX}Network" >&5 +printf %s "checking for main in -l${QT_LIB_PREFIX}Network... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l${QT_LIB_PREFIX}Network $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int main (); +} +int +main (void) +{ +return conftest::main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_LIB${QT_LIB_PREFIX}Network" | $as_tr_cpp` 1 +_ACEOF + + LIBS="-l${QT_LIB_PREFIX}Network $LIBS" + +else $as_nop + + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: lib${QT_LIB_PREFIX}Network not found; agrarian-qt frontend will not be built" >&5 +printf "%s\n" "$as_me: WARNING: lib${QT_LIB_PREFIX}Network not found; agrarian-qt frontend will not be built" >&2;} + fi + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + else + as_fn_error $? "lib${QT_LIB_PREFIX}Network not found" "$LINENO" 5 + fi + +fi + + else + true + + fi + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + as_ac_Lib=`printf "%s\n" "ac_cv_lib_${QT_LIB_PREFIX}Widgets""_main" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l${QT_LIB_PREFIX}Widgets" >&5 +printf %s "checking for main in -l${QT_LIB_PREFIX}Widgets... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l${QT_LIB_PREFIX}Widgets $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int main (); +} +int +main (void) +{ +return conftest::main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_LIB${QT_LIB_PREFIX}Widgets" | $as_tr_cpp` 1 +_ACEOF + + LIBS="-l${QT_LIB_PREFIX}Widgets $LIBS" + +else $as_nop + + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: lib${QT_LIB_PREFIX}Widgets not found; agrarian-qt frontend will not be built" >&5 +printf "%s\n" "$as_me: WARNING: lib${QT_LIB_PREFIX}Widgets not found; agrarian-qt frontend will not be built" >&2;} + fi + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + else + as_fn_error $? "lib${QT_LIB_PREFIX}Widgets not found" "$LINENO" 5 + fi + +fi + + else + true + + fi + + QT_LIBS="$LIBS" + LIBS="$TEMP_LIBS" + + + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + + LIBS= + if test "x$qt_lib_path" != x; then + LIBS="-L$qt_lib_path" + fi + as_ac_Lib=`printf "%s\n" "ac_cv_lib_${QT_LIB_PREFIX}Test""_main" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l${QT_LIB_PREFIX}Test" >&5 +printf %s "checking for main in -l${QT_LIB_PREFIX}Test... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l${QT_LIB_PREFIX}Test $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int main (); +} +int +main (void) +{ +return conftest::main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_LIB${QT_LIB_PREFIX}Test" | $as_tr_cpp` 1 +_ACEOF + + LIBS="-l${QT_LIB_PREFIX}Test $LIBS" + +else $as_nop + have_qt_test=no +fi + + ac_fn_cxx_check_header_compile "$LINENO" "QTest" "ac_cv_header_QTest" "$ac_includes_default" +if test "x$ac_cv_header_QTest" = xyes +then : + +else $as_nop + have_qt_test=no +fi + + QT_TEST_LIBS="$LIBS" + if test "x$use_dbus" != xno; then + LIBS= + if test "x$qt_lib_path" != x; then + LIBS="-L$qt_lib_path" + fi + as_ac_Lib=`printf "%s\n" "ac_cv_lib_${QT_LIB_PREFIX}DBus""_main" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l${QT_LIB_PREFIX}DBus" >&5 +printf %s "checking for main in -l${QT_LIB_PREFIX}DBus... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l${QT_LIB_PREFIX}DBus $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int main (); +} +int +main (void) +{ +return conftest::main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_LIB${QT_LIB_PREFIX}DBus" | $as_tr_cpp` 1 +_ACEOF + + LIBS="-l${QT_LIB_PREFIX}DBus $LIBS" + +else $as_nop + have_qt_dbus=no +fi + + ac_fn_cxx_check_header_compile "$LINENO" "QtDBus" "ac_cv_header_QtDBus" "$ac_includes_default" +if test "x$ac_cv_header_QtDBus" = xyes +then : + +else $as_nop + have_qt_dbus=no +fi + + QT_DBUS_LIBS="$LIBS" + fi + + else + true + + fi + + CPPFLAGS="$TEMP_CPPFLAGS" + CXXFLAGS="$TEMP_CXXFLAGS" + LIBS="$TEMP_LIBS" + fi else @@ -26814,6 +28168,45 @@ fi if test "x$bitcoin_qt_want_version" = xauto; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Qt 6" >&5 +printf %s "checking for Qt 6... " >&6; } +if test ${bitcoin_cv_qt6+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef QT_VERSION + # include + #endif + +int +main (void) +{ + + #if QT_VERSION < 0x060000 || QT_VERSION_MAJOR < 6 + choke + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + bitcoin_cv_qt6=yes +else $as_nop + bitcoin_cv_qt6=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bitcoin_cv_qt6" >&5 +printf "%s\n" "$bitcoin_cv_qt6" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Qt 5" >&5 printf %s "checking for Qt 5... " >&6; } if test ${bitcoin_cv_qt5+y} @@ -26892,7 +28285,13 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bitcoin_cv_qt58" >&5 printf "%s\n" "$bitcoin_cv_qt58" >&6; } fi - QT_LIB_PREFIX=Qt5 + QT_LIB_PREFIX=Qt6 + if test "x$bitcoin_qt_want_version" = xqt5; then + QT_LIB_PREFIX=Qt5 + fi + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_cv_qt6" != xyes; then + QT_LIB_PREFIX=Qt5 + fi else true @@ -27921,6 +29320,28 @@ printf "%s\n" "#define QT_STATICPLUGIN 1" >>confdefs.h if test -d "$qt_plugin_path/accessible"; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" fi + if test "x$QT_LIB_PREFIX" = xQt6; then + if test -d "$qt_plugin_path/imageformats"; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/imageformats" + fi + if test -d "$qt_plugin_path/tls"; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/tls" + fi + if test -d "$qt_plugin_path/platforminputcontexts"; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforminputcontexts" + fi + if test -d "$qt_plugin_path/generic"; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/generic" + fi + if test "x$TARGET_OS" = xlinux; then + QT_LIBS="-lQt6XcbQpa -lQt6InputSupport -lQt6FbSupport -lQt6DeviceDiscoverySupport $QT_LIBS" + QT_LIBS="$QT_LIBS -lQt6BundledHarfbuzz -lQt6BundledLibpng -lQt6BundledLibjpeg -lQt6BundledPcre2" + if test "x$PKG_CONFIG" != x; then + QT6_XCB_LIBS=`PKG_CONFIG_LIBDIR=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig $PKG_CONFIG --libs --static x11 x11-xcb xcb xcb-cursor xcb-icccm xcb-image xcb-keysyms xcb-randr xcb-renderutil xcb-shape xcb-shm xcb-sync xcb-xfixes xcb-xkb xkbcommon xkbcommon-x11 fontconfig freetype2 harfbuzz 2>/dev/null` + QT_LIBS="$QT_LIBS $QT6_XCB_LIBS" + fi + fi + else if test "x$use_pkgconfig" = xyes; then : if test x$bitcoin_cv_qt58 = xno; then @@ -29541,6 +30962,7 @@ fi fi fi fi + fi fi @@ -29673,6 +31095,53 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ printf "%s\n" "#define QT_QPA_PLATFORM_MINIMAL 1" >>confdefs.h + if test "x$QT_LIB_PREFIX" = xQt6; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for static Qt plugins: -lqopensslbackend -lssl -lcrypto" >&5 +printf %s "checking for static Qt plugins: -lqopensslbackend -lssl -lcrypto... " >&6; } + CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS" + LIBS="-lqopensslbackend -lssl -lcrypto $QT_LIBS $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define QT_STATICPLUGIN + #include + Q_IMPORT_PLUGIN(QTlsBackendOpenSSL) +int +main (void) +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; }; QT_LIBS="-lqopensslbackend -lssl -lcrypto $QT_LIBS" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Could not resolve: -lqopensslbackend -lssl -lcrypto; agrarian-qt frontend will not be built" >&5 +printf "%s\n" "$as_me: WARNING: Could not resolve: -lqopensslbackend -lssl -lcrypto; agrarian-qt frontend will not be built" >&2;} + fi + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + else + as_fn_error $? "Could not resolve: -lqopensslbackend -lssl -lcrypto" "$LINENO" 5 + fi + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS" + + +printf "%s\n" "#define QT_TLS_OPENSSL 1" >>confdefs.h + + fi if test "x$TARGET_OS" = xwindows; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for static Qt plugins: -lqwindows" >&5 @@ -29720,6 +31189,50 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ printf "%s\n" "#define QT_QPA_PLATFORM_WINDOWS 1" >>confdefs.h elif test "x$TARGET_OS" = xlinux; then + if test "x$QT_LIB_PREFIX" = xQt6; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for static Qt plugins: -lqxcb" >&5 +printf %s "checking for static Qt plugins: -lqxcb... " >&6; } + CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS" + LIBS="-lqxcb $QT_LIBS $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define QT_STATICPLUGIN + #include + Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) +int +main (void) +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; }; QT_LIBS="-lqxcb $QT_LIBS" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Could not resolve: -lqxcb; agrarian-qt frontend will not be built" >&5 +printf "%s\n" "$as_me: WARNING: Could not resolve: -lqxcb; agrarian-qt frontend will not be built" >&2;} + fi + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + else + as_fn_error $? "Could not resolve: -lqxcb" "$LINENO" 5 + fi + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS" + + else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for static Qt plugins: -lqxcb -lxcb-static" >&5 printf %s "checking for static Qt plugins: -lqxcb -lxcb-static... " >&6; } @@ -29762,6 +31275,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS" + fi printf "%s\n" "#define QT_QPA_PLATFORM_XCB 1" >>confdefs.h @@ -29862,7 +31376,13 @@ printf "%s\n" "#define QT_QPA_PLATFORM_COCOA 1" >>confdefs.h if test "x$use_pkgconfig$qt_bin_path" = xyes; then - qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`" + qt_bin_path="`$PKG_CONFIG --variable=host_bins ${QT_LIB_PREFIX}Core 2>/dev/null`" + fi + if test "x$qt_bin_path" != x && test -d "$qt_bin_path/../libexec"; then + qt_bin_path="$qt_bin_path$PATH_SEPARATOR$qt_bin_path/../libexec" + fi + if test "x$qt_bin_path" != x; then + qt_bin_path="$qt_bin_path$PATH_SEPARATOR$PATH" fi if test "x$use_hardening" != xno; then @@ -29968,7 +31488,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext true if test "x$qt_bin_path" != x; then - for ac_prog in moc-qt5 moc5 moc + for ac_prog in moc-qt6 moc6 moc-qt5 moc5 moc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30019,7 +31539,7 @@ fi done else - for ac_prog in moc-qt5 moc5 moc + for ac_prog in moc-qt6 moc6 moc-qt5 moc5 moc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30097,7 +31617,7 @@ printf "%s\n" "$as_me: WARNING: MOC not found; agrarian-qt frontend will not be true if test "x$qt_bin_path" != x; then - for ac_prog in uic-qt5 uic5 uic + for ac_prog in uic-qt6 uic6 uic-qt5 uic5 uic do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30148,7 +31668,7 @@ fi done else - for ac_prog in uic-qt5 uic5 uic + for ac_prog in uic-qt6 uic6 uic-qt5 uic5 uic do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30226,7 +31746,7 @@ printf "%s\n" "$as_me: WARNING: UIC not found; agrarian-qt frontend will not be true if test "x$qt_bin_path" != x; then - for ac_prog in rcc-qt5 rcc5 rcc + for ac_prog in rcc-qt6 rcc6 rcc-qt5 rcc5 rcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30277,7 +31797,7 @@ fi done else - for ac_prog in rcc-qt5 rcc5 rcc + for ac_prog in rcc-qt6 rcc6 rcc-qt5 rcc5 rcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30355,7 +31875,7 @@ printf "%s\n" "$as_me: WARNING: RCC not found; agrarian-qt frontend will not be true if test "x$qt_bin_path" != x; then - for ac_prog in lrelease-qt5 lrelease5 lrelease + for ac_prog in lrelease-qt6 lrelease6 lrelease-qt5 lrelease5 lrelease do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30406,7 +31926,7 @@ fi done else - for ac_prog in lrelease-qt5 lrelease5 lrelease + for ac_prog in lrelease-qt6 lrelease6 lrelease-qt5 lrelease5 lrelease do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30484,7 +32004,7 @@ printf "%s\n" "$as_me: WARNING: LRELEASE not found; agrarian-qt frontend will no true if test "x$qt_bin_path" != x; then - for ac_prog in lupdate-qt5 lupdate5 lupdate + for ac_prog in lupdate-qt6 lupdate6 lupdate-qt5 lupdate5 lupdate do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30535,7 +32055,7 @@ fi done else - for ac_prog in lupdate-qt5 lupdate5 lupdate + for ac_prog in lupdate-qt6 lupdate6 lupdate-qt5 lupdate5 lupdate do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30749,8 +32269,8 @@ printf "%s\n" "$as_me: WARNING: lupdate is required to update qt translations" > fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bitcoin_enable_qt (Qt5)" >&5 -printf "%s\n" "$bitcoin_enable_qt (Qt5)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bitcoin_enable_qt ($QT_LIB_PREFIX)" >&5 +printf "%s\n" "$bitcoin_enable_qt ($QT_LIB_PREFIX)" >&6; } @@ -30760,7 +32280,6 @@ printf "%s\n" "$bitcoin_enable_qt (Qt5)" >&6; } - QT_SELECT=qt5 diff --git a/configure.ac b/configure.ac index 6e51a29d..de2a973b 100644 --- a/configure.ac +++ b/configure.ac @@ -62,8 +62,8 @@ case $host in lt_cv_deplibs_check_method="pass_all" ;; esac -dnl Require C++11 compiler (no GNU extensions) -AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory], [nodefault]) +dnl Require C++17 compiler (no GNU extensions). Qt 6.8 requires C++17. +AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory], [nodefault]) dnl Check if -latomic is required for CHECK_ATOMIC diff --git a/contrib/build-linux-wallet.sh b/contrib/build-linux-wallet.sh index cc8df6e0..7428782c 100755 --- a/contrib/build-linux-wallet.sh +++ b/contrib/build-linux-wallet.sh @@ -6,10 +6,6 @@ JOBS="${JOBS:-1}" HOST="${HOST:-x86_64-pc-linux-gnu}" PREFIX="$ROOT/depends/$HOST" BASE_CONFIG="$PREFIX/share/config.site" -CONFIG_SITE_FILE="${CONFIG_SITE_FILE:-/tmp/agrarian-linux-wallet-config.site}" -QT_PKG_CONFIG_DIR="${QT_PKG_CONFIG_DIR:-/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig}" -QT_BINDIR="${QT_BINDIR:-/usr/lib/qt5/bin}" -PROTOC_BINDIR="${PROTOC_BINDIR:-/usr/bin}" require_cmd() { if ! command -v "$1" >/dev/null 2>&1; then @@ -31,36 +27,24 @@ require_cmd make require_cmd pkg-config require_cmd gcc require_cmd g++ -require_cmd sed -require_cmd cp -require_cmd "$PROTOC_BINDIR/protoc" -require_path "$QT_BINDIR/moc" -require_path "$QT_BINDIR/uic" -require_path "$QT_BINDIR/rcc" -require_path "$QT_BINDIR/lrelease" -require_path "$QT_BINDIR/lupdate" +require_cmd cmake +require_cmd ninja echo "Building native depends for $HOST..." -make -C depends -j"$JOBS" +make -C depends HOST="$HOST" NO_QT=0 -j"$JOBS" require_path "$BASE_CONFIG" -cp "$BASE_CONFIG" "$CONFIG_SITE_FILE" -sed -i.old \ - -e "s#^with_qt_bindir=.*#with_qt_bindir='$QT_BINDIR'#" \ - -e "s#^with_protoc_bindir=.*#with_protoc_bindir='$PROTOC_BINDIR'#" \ - -e "s#^PKG_CONFIG_LIBDIR=.*#PKG_CONFIG_LIBDIR='$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:$QT_PKG_CONFIG_DIR'#" \ - "$CONFIG_SITE_FILE" - if [[ ! -f configure ]]; then ./autogen.sh fi -echo "Configuring Ubuntu Qt wallet build..." -CONFIG_SITE="$CONFIG_SITE_FILE" ./configure \ +echo "Configuring Ubuntu Qt6 wallet build..." +CONFIG_SITE="$BASE_CONFIG" ./configure \ --disable-maintainer-mode \ --disable-tests \ --disable-bench \ - --with-gui=qt5 + --with-gui=qt6 \ + --with-qtdbus=no echo "Building Ubuntu Qt wallet with JOBS=$JOBS..." make -j"$JOBS" diff --git a/contrib/smoke-test-daemon.sh b/contrib/smoke-test-daemon.sh index 3d3dad12..0308a097 100755 --- a/contrib/smoke-test-daemon.sh +++ b/contrib/smoke-test-daemon.sh @@ -54,17 +54,18 @@ EOF -rpcbind=127.0.0.1 -rpcport="$RPCPORT" -port="$PORT" -keypool=1 -daemon for _ in $(seq 1 "$WAIT_SECONDS"); do - if rpc getinfo >/dev/null 2>&1; then + if rpc getwalletinfo >/dev/null 2>&1; then break fi sleep 1 done -if ! rpc getinfo >/dev/null; then - echo "Timed out waiting for RPC on 127.0.0.1:$RPCPORT" >&2 +if ! rpc getwalletinfo >/dev/null; then + echo "Timed out waiting for wallet RPC on 127.0.0.1:$RPCPORT" >&2 tail -n 80 "$DATADIR/regtest/debug.log" >&2 || true exit 1 fi +rpc getinfo >/dev/null rpc getwalletinfo >/dev/null rpc getmininginfo >/dev/null rpc getstakingstatus >/dev/null diff --git a/contrib/smoke-test-qt.sh b/contrib/smoke-test-qt.sh new file mode 100755 index 00000000..5a667365 --- /dev/null +++ b/contrib/smoke-test-qt.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +DATADIR="${DATADIR:-$(mktemp -d /tmp/agrarian-qt-smoke.XXXXXX)}" +LOGFILE="${LOGFILE:-/tmp/agrarian-qt-smoke.log}" +WAIT_SECONDS="${WAIT_SECONDS:-25}" +AGRARIAN_QT="${AGRARIAN_QT:-$ROOT/src/qt/agrarian-qt}" + +require_path() { + if [[ ! -x "$1" ]]; then + echo "Missing executable: $1" >&2 + exit 1 + fi +} + +require_path "$AGRARIAN_QT" +mkdir -p "$DATADIR" +rm -f "$LOGFILE" + +set +e +timeout --kill-after=5s "${WAIT_SECONDS}s" xvfb-run -a "$AGRARIAN_QT" \ + -regtest -datadir="$DATADIR" -choosedatadir=0 -debug=qt -debug=rpc \ + -printtoconsole -server=0 -listen=0 -dnsseed=0 -connect=0 >"$LOGFILE" 2>&1 +exit_code=$? +set -e + +if [[ "$exit_code" -ne 124 ]]; then + echo "Expected Qt wallet to keep running until timeout, got exit code $exit_code" >&2 + tail -n 80 "$LOGFILE" >&2 || true + exit 1 +fi + +if ! grep -q "init message: Done loading" "$LOGFILE"; then + echo "Qt wallet did not reach Done loading" >&2 + tail -n 120 "$LOGFILE" >&2 || true + exit 1 +fi + +if grep -E "No functional TLS|No such signal|Unknown property" "$LOGFILE" >/dev/null; then + echo "Qt wallet logged a Qt6 runtime compatibility warning" >&2 + grep -E "No functional TLS|No such signal|Unknown property" "$LOGFILE" >&2 || true + exit 1 +fi + +echo "Agrarian Qt smoke test passed" +echo " datadir: $DATADIR" +echo " log: $LOGFILE" diff --git a/contrib/smoke-test-wallet.sh b/contrib/smoke-test-wallet.sh new file mode 100755 index 00000000..31d18293 --- /dev/null +++ b/contrib/smoke-test-wallet.sh @@ -0,0 +1,102 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +DATADIR="${DATADIR:-$(mktemp -d /tmp/agrarian-wallet-smoke.XXXXXX)}" +RPCPORT="${RPCPORT:-36435}" +PORT="${PORT:-36436}" +WAIT_SECONDS="${WAIT_SECONDS:-90}" +AGRARIAND="${AGRARIAND:-$ROOT/src/agrariand}" +AGRARIAN_CLI="${AGRARIAN_CLI:-$ROOT/src/agrarian-cli}" +BACKUP="${BACKUP:-/tmp/agrarian-wallet-backup-smoke.dat}" + +cleanup() { + if [[ -x "$AGRARIAN_CLI" && -d "$DATADIR" ]]; then + "$AGRARIAN_CLI" -datadir="$DATADIR" -regtest \ + -rpcuser=wallet -rpcpassword=wallet-pass -rpcport="$RPCPORT" stop >/dev/null 2>&1 || true + fi +} +trap cleanup EXIT + +require_path() { + if [[ ! -x "$1" ]]; then + echo "Missing executable: $1" >&2 + exit 1 + fi +} + +rpc() { + "$AGRARIAN_CLI" -datadir="$DATADIR" -regtest \ + -rpcuser=wallet -rpcpassword=wallet-pass -rpcconnect=127.0.0.1 \ + -rpcport="$RPCPORT" "$@" +} + +require_path "$AGRARIAND" +require_path "$AGRARIAN_CLI" + +mkdir -p "$DATADIR" +cat > "$DATADIR/agrarian.conf" </dev/null 2>&1; then + break + fi + sleep 1 +done + +if ! rpc getinfo >/dev/null; then + echo "Timed out waiting for RPC on 127.0.0.1:$RPCPORT" >&2 + tail -n 80 "$DATADIR/regtest/debug.log" >&2 || true + exit 1 +fi + +rpc getwalletinfo >/dev/null +receive_address="$(rpc getnewaddress receive)" +send_address="$(rpc getnewaddress sendtest)" +rpc generate 101 >/dev/null +mined_balance="$(rpc getbalance)" +txid="$(rpc sendtoaddress "$send_address" 1.0)" +rpc generate 1 >/dev/null +rpc gettransaction "$txid" >/dev/null + +rm -f "$BACKUP" +rpc backupwallet "$BACKUP" +test -s "$BACKUP" + +set +e +encrypt_output="$(rpc encryptwallet smoke-passphrase 2>&1)" +encrypt_code=$? +set -e +if [[ "$encrypt_code" -ne 0 ]]; then + echo "$encrypt_output" >&2 + exit "$encrypt_code" +fi + +sleep 2 +if rpc getinfo >/dev/null 2>&1; then + echo "Expected encryptwallet to stop the daemon, but RPC is still available" >&2 + exit 1 +fi + +echo "Agrarian wallet smoke test passed" +echo " datadir: $DATADIR" +echo " receive_address: $receive_address" +echo " send_txid: $txid" +echo " mined_balance_before_send: $mined_balance" +echo " backup: $BACKUP" diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index 852b29c8..a1950dda 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -47,7 +47,7 @@ define $(package)_build_cmds endef define $(package)_stage_cmds - $(MAKE) INSTALL_PREFIX=$($(package)_staging_dir) -j1 install_sw + $(MAKE) DESTDIR=$($(package)_staging_dir) -j1 install_sw endef define $(package)_postprocess_cmds diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 68ecf425..40465a2a 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -25,7 +25,7 @@ USE_UPNP ?= 1 qt_native_packages := native_protobuf qt_packages := qrencode protobuf zlib -qt_linux_packages := qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans +qt_linux_packages := qt qt_darwin_packages := qt qt_mingw32_packages := qt diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 5dabfd06..652299d7 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -1,20 +1,18 @@ PACKAGE=qt -$(package)_version=5.9.7 -$(package)_download_path=https://download.qt.io/new_archive/qt/5.9/$($(package)_version)/submodules -$(package)_suffix=opensource-src-$($(package)_version).tar.xz +$(package)_version=6.8.3 +$(package)_download_path=https://download.qt.io/official_releases/qt/6.8/$($(package)_version)/submodules +$(package)_suffix=everywhere-src-$($(package)_version).tar.xz $(package)_file_name=qtbase-$($(package)_suffix) -$(package)_sha256_hash=36dd9574f006eaa1e5af780e4b33d11fe39d09fd7c12f3b9d83294174bd28f00 +$(package)_sha256_hash=56001b905601bb9023d399f3ba780d7fa940f3e4861e496a7c490331f49e0b80 $(package)_dependencies=openssl zlib -$(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext -$(package)_build_subdir=qtbase -$(package)_qt_libs=corelib network widgets gui plugins testlib -$(package)_patches=mac-qmake.conf +$(package)_linux_dependencies= +$(package)_build_subdir=qtbase-build $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) -$(package)_qttranslations_sha256_hash=b36da7d93c3ab6fca56b32053bb73bc619c8b192bb89b74e3bcde2705f1c2a14 +$(package)_qttranslations_sha256_hash=c3c61d79c3d8fe316a20b3617c64673ce5b5519b2e45535f49bee313152fa531 $(package)_qttools_file_name=qttools-$($(package)_suffix) -$(package)_qttools_sha256_hash=d62e0f70d99645d6704dbb8976fb2222443061743689943d40970c52c49367a1 +$(package)_qttools_sha256_hash=02a4e219248b94f1333df843d25763f35251c1074cdc4fb5bda67d340f8c8b3a $(package)_extra_sources = $($(package)_qttranslations_file_name) $(package)_extra_sources += $($(package)_qttools_file_name) @@ -22,100 +20,35 @@ $(package)_extra_sources += $($(package)_qttools_file_name) define $(package)_set_vars $(package)_config_opts_release = -release $(package)_config_opts_debug = -debug -$(package)_config_opts += -bindir $(build_prefix)/bin -$(package)_config_opts += -c++std c++11 +$(package)_config_opts += -bindir bin $(package)_config_opts += -confirm-license -$(package)_config_opts += -dbus-runtime -$(package)_config_opts += -hostprefix $(build_prefix) -$(package)_config_opts += -no-compile-examples $(package)_config_opts += -no-cups -$(package)_config_opts += -no-egl -$(package)_config_opts += -no-eglfs -$(package)_config_opts += -no-freetype -$(package)_config_opts += -no-gif +$(package)_config_opts += -no-dbus $(package)_config_opts += -no-glib $(package)_config_opts += -no-icu -$(package)_config_opts += -no-iconv -$(package)_config_opts += -no-kms -$(package)_config_opts += -no-linuxfb -$(package)_config_opts += -no-libudev -$(package)_config_opts += -no-mtdev -$(package)_config_opts += -no-openvg -$(package)_config_opts += -no-reduce-relocations -$(package)_config_opts += -no-qml-debug -$(package)_config_opts += -no-sql-db2 -$(package)_config_opts += -no-sql-ibase -$(package)_config_opts += -no-sql-oci -$(package)_config_opts += -no-sql-tds -$(package)_config_opts += -no-sql-mysql -$(package)_config_opts += -no-sql-odbc -$(package)_config_opts += -no-sql-psql -$(package)_config_opts += -no-sql-sqlite -$(package)_config_opts += -no-sql-sqlite2 -$(package)_config_opts += -no-use-gold-linker -$(package)_config_opts += -no-xinput2 +$(package)_config_opts += -no-opengl +$(package)_config_opts += -no-pch +$(package)_config_opts += -no-feature-sql $(package)_config_opts += -nomake examples $(package)_config_opts += -nomake tests $(package)_config_opts += -opensource $(package)_config_opts += -openssl-linked -$(package)_config_opts += -optimized-qmake -$(package)_config_opts += -no-pch $(package)_config_opts += -pkg-config $(package)_config_opts += -prefix $(host_prefix) -$(package)_config_opts += -qt-libpng -$(package)_config_opts += -qt-libjpeg -$(package)_config_opts += -qt-pcre $(package)_config_opts += -qt-harfbuzz -$(package)_config_opts += -system-zlib +$(package)_config_opts += -qt-libjpeg +$(package)_config_opts += -qt-libpng +$(package)_config_opts += -qt-pcre $(package)_config_opts += -static -$(package)_config_opts += -silent -$(package)_config_opts += -v -$(package)_config_opts += -no-feature-dial -$(package)_config_opts += -no-feature-ftp -$(package)_config_opts += -no-feature-lcdnumber -$(package)_config_opts += -no-feature-pdf -$(package)_config_opts += -no-feature-printer -$(package)_config_opts += -no-feature-printdialog -$(package)_config_opts += -no-feature-concurrent -$(package)_config_opts += -no-feature-sql -$(package)_config_opts += -no-feature-statemachine -$(package)_config_opts += -no-feature-syntaxhighlighter -$(package)_config_opts += -no-feature-textbrowser -$(package)_config_opts += -no-feature-textodfwriter -$(package)_config_opts += -no-feature-udpsocket -$(package)_config_opts += -no-feature-wizard -$(package)_config_opts += -no-feature-xml - -ifneq ($(build_os),darwin) -$(package)_config_opts_darwin = -xplatform macx-clang-linux -$(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK) -$(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION) -$(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-" -$(package)_config_opts_darwin += -device-option MAC_MIN_VERSION=$(OSX_MIN_VERSION) -$(package)_config_opts_darwin += -device-option MAC_TARGET=$(host) -$(package)_config_opts_darwin += -device-option MAC_LD64_VERSION=$(LD64_VERSION) -endif - -$(package)_config_opts_linux = -qt-xkbcommon-x11 -$(package)_config_opts_linux += -qt-xcb +$(package)_config_opts += -system-zlib +$(package)_config_opts_linux = -fontconfig +$(package)_config_opts_linux += -qpa xcb +$(package)_config_opts_linux += -xcb +$(package)_config_opts_linux += -xkbcommon $(package)_config_opts_linux += -system-freetype $(package)_config_opts_linux += -no-feature-sessionmanager -$(package)_config_opts_linux += -fontconfig -$(package)_config_opts_linux += -no-opengl -$(package)_config_opts_arm_linux += -platform linux-g++ -xplatform agrarian-linux-g++ -$(package)_config_opts_i686_linux = -xplatform linux-g++-32 -$(package)_config_opts_x86_64_linux = -xplatform linux-g++-64 -$(package)_config_opts_aarch64_linux = -xplatform linux-aarch64-gnu-g++ -$(package)_config_opts_riscv64_linux = -platform linux-g++ -xplatform agrarian-linux-g++ -$(package)_config_opts_s390x_linux += -platform linux-g++ -xplatform linux-g++-64 -$(package)_config_opts_powerpc_linux += -platform linux-g++ -xplatform linux-g++-32 -$(package)_config_opts_powerpc64le_linux += -platform linux-g++ -xplatform linux-g++-64 -$(package)_config_opts_sparc64_linux += -platform linux-g++ -xplatform linux-g++-64 -$(package)_config_opts_alpha_linux += -platform linux-g++ -xplatform linux-g++-64 -$(package)_config_opts_m68k_linux += -platform linux-g++ -xplatform linux-g++-32 -$(package)_config_opts_mingw32 = -no-opengl -xplatform win32-g++ -device-option CROSS_COMPILE="$(host)-" -$(package)_build_env = QT_RCC_TEST=1 -$(package)_build_env += QT_RCC_SOURCE_DATE_OVERRIDE=1 +$(package)_config_opts_mingw32 = -qpa windows +$(package)_config_opts_darwin = -qpa cocoa endef define $(package)_fetch_cmds @@ -130,75 +63,28 @@ define $(package)_extract_cmds echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ - mkdir qtbase && \ + mkdir qtbase qtbase-build qttools qttools-build qttranslations qttranslations-build && \ tar --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \ - mkdir qttranslations && \ - tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \ - mkdir qttools && \ - tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools -endef - -define $(package)_preprocess_cmds - sed -i.old "s|FT_Get_Font_Format|FT_Get_X11_Font_Format|" qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp && \ - sed -i.old "/#include /a #include " qtbase/src/corelib/tools/qbytearraymatcher.h && \ - sed -i.old "/#include \"qfloat16_p.h\"/a #include " qtbase/src/corelib/global/qfloat16.cpp && \ - sed -i.old "s/#if defined(Q_CC_MINGW) || !defined(TOUCHEVENTF_MOVE)/#if (defined(Q_CC_MINGW) \&\& WINVER < 0x0601) || !defined(TOUCHEVENTF_MOVE)/" qtbase/src/plugins/platforms/windows/qwindowsmousehandler.cpp && \ - sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ - sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \ - sed -i.old "s/src_plugins.depends = src_sql src_network/src_plugins.depends = src_network/" qtbase/src/src.pro && \ - sed -i.old "s|X11/extensions/XIproto.h|X11/X.h|" qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp && \ - sed -i.old "/SUBDIRS += printsupport/d" qtbase/src/plugins/plugins.pro && \ - sed -i.old -e 's/if \[ "$$$$XPLATFORM_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/if \[ "$$$$BUILD_ON_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/' -e 's|/bin/pwd|pwd|' qtbase/configure && \ - sed -i.old 's/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0)/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft)/' qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm && \ - mkdir -p qtbase/mkspecs/macx-clang-linux &&\ - cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\ - cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\ - cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ - cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ - cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/agrarian-linux-g++ && \ - sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/agrarian-linux-g++/qmake.conf && \ - echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - echo "QMAKE_LINK_OBJECT_MAX = 10" >> qtbase/mkspecs/win32-g++/qmake.conf &&\ - echo "QMAKE_LINK_OBJECT_SCRIPT = object_script" >> qtbase/mkspecs/win32-g++/qmake.conf &&\ - sed -i.old "s|QMAKE_CFLAGS = |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ - sed -i.old "s|QMAKE_LFLAGS = |!host_build: QMAKE_LFLAGS = $($(package)_ldflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ - sed -i.old "s|QMAKE_CXXFLAGS = |!host_build: QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf + tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \ + tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations endef define $(package)_config_cmds - export PKG_CONFIG_SYSROOT_DIR=/ && \ - export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \ - export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \ - ./configure $($(package)_config_opts) && \ - echo "host_build: QT_CONFIG ~= s/system-zlib/zlib" >> mkspecs/qconfig.pri && \ - echo "CONFIG += force_bootstrap" >> mkspecs/qconfig.pri && \ - $(MAKE) sub-src-clean && \ - cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \ - cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. && \ - cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile && \ - cd ../lupdate/ && ../../../../qtbase/bin/qmake lupdate.pro -o Makefile && cd ../../../.. + export PKG_CONFIG_SYSROOT_DIR=/ && \ + export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig && \ + export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \ + ../qtbase/configure $($(package)_config_opts) -- -G Ninja endef define $(package)_build_cmds - $(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \ - $(MAKE) -C ../qttools/src/linguist/lrelease && \ - $(MAKE) -C ../qttools/src/linguist/lupdate && \ - $(MAKE) -C ../qttranslations + cmake --build . --parallel endef define $(package)_stage_cmds - $(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. && \ - $(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \ - $(MAKE) -C qttools/src/linguist/lupdate INSTALL_ROOT=$($(package)_staging_dir) install_target && \ - $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \ - if `test -f qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a`; then \ - cp qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a $($(package)_staging_prefix_dir)/lib; \ - fi + DESTDIR=$($(package)_staging_dir) cmake --install . endef define $(package)_postprocess_cmds - rm -rf native/mkspecs/ native/lib/ lib/cmake/ && \ + rm -rf lib/cmake share/doc share/examples share/qt6/sbom && \ rm -f lib/lib*.la lib/*.prl plugins/*/*.prl endef diff --git a/depends/packages/xcb_proto.mk b/depends/packages/xcb_proto.mk index 44110394..87c1de83 100644 --- a/depends/packages/xcb_proto.mk +++ b/depends/packages/xcb_proto.mk @@ -9,6 +9,15 @@ define $(package)_set_vars $(package)_config_opts_linux=--with-pic endef +define $(package)_preprocess_cmds + sed -i.old \ + -e 's/import sys, os, py_compile, imp/import sys, os, py_compile, importlib.util/' \ + -e "s/hasattr(imp, 'get_tag')/True/g" \ + -e 's/imp.cache_from_source(filepath)/importlib.util.cache_from_source(filepath)/g' \ + -e 's/imp.cache_from_source(filepath, False)/importlib.util.cache_from_source(filepath, optimization="")/g' \ + py-compile +endef + define $(package)_config_cmds $($(package)_autoconf) endef diff --git a/doc/build-ubuntu-24.md b/doc/build-ubuntu-24.md index 8bd81a93..8f882427 100644 --- a/doc/build-ubuntu-24.md +++ b/doc/build-ubuntu-24.md @@ -21,14 +21,12 @@ Install the native daemon build dependencies: sudo apt-get update sudo apt-get install -y \ build-essential pkg-config autoconf automake libtool bsdmainutils \ - libboost-all-dev libevent-dev libgmp-dev libssl-dev \ - libdb5.3-dev libdb5.3++-dev + cmake ninja-build python3 curl git -For the desktop wallet, also install Qt and protobuf tools: +For a headless Qt wallet smoke test, also install: sudo apt-get install -y \ - qtbase5-dev qttools5-dev-tools qtchooser \ - libqrencode-dev libprotobuf-dev protobuf-compiler + xvfb Daemon-only build ----------------- @@ -57,42 +55,40 @@ For the desktop wallet, use: JOBS=1 ./contrib/build-linux-wallet.sh -The wallet helper builds/restores the native depends prefix first, then creates -a temporary config.site that keeps the depends libraries while allowing system -Qt 5 tools and pkg-config files to be used. +The wallet helper builds/restores the native depends prefix first, including +Qt 6.8.3, OpenSSL 3.5.6, and Boost 1.91.0. It then configures the project with +the generated depends `config.site` and builds the Ubuntu Qt wallet. Defaults: HOST=x86_64-pc-linux-gnu - QT_BINDIR=/usr/lib/qt5/bin - PROTOC_BINDIR=/usr/bin - CONFIG_SITE_FILE=/tmp/agrarian-linux-wallet-config.site Warnings -------- -Qt 5.15 and protobuf 3.x emit compatibility/deprecation warnings in a few Qt -translation units. Those warnings are expected while the Windows build remains -pinned to Qt 5.9.7 and protobuf 2.6.1. +The Qt6/OpenSSL3 path should build without Qt compatibility warnings. First-run +runtime logs may report missing cache files such as `peers.dat`, `banlist.dat`, +or masternode cache files; those are created during startup. Functional smoke test --------------------- -After building the daemon, run the isolated regtest smoke test: +After building, run the isolated smoke tests: ./contrib/smoke-test-daemon.sh + ./contrib/smoke-test-wallet.sh + ./contrib/smoke-test-qt.sh -The script starts `agrariand` with a temporary regtest datadir, confirms RPC and -wallet calls work, mines one block with `generate`, checks the block count, and -stops the daemon. +The daemon script confirms RPC and wallet calls work, mines one block, checks +the block count, and stops the daemon. The wallet script checks address +creation, mining, send/confirm, backup, and encryption shutdown. The Qt script +starts `agrarian-qt` under Xvfb and confirms the GUI reaches `Done loading` +without Qt6 TLS, signal, or stylesheet compatibility warnings. OpenSSL 3 --------- -Ubuntu 24.04 ships OpenSSL 3. Agrarian no longer rejects this only because -`RAND_egd` is unavailable. Some deprecated OpenSSL SHA calls still warn during -compilation; those warnings are expected until the hashing helper code is -modernized. +The deterministic depends build currently uses OpenSSL 3.5.6. Berkeley DB ----------- diff --git a/doc/build-wallets.md b/doc/build-wallets.md index 3afbddfa..ea9642b6 100644 --- a/doc/build-wallets.md +++ b/doc/build-wallets.md @@ -32,8 +32,7 @@ Ubuntu package baseline For the native Ubuntu wallet: sudo apt-get install -y \ - qtbase5-dev qttools5-dev-tools qtchooser \ - libqrencode-dev libprotobuf-dev protobuf-compiler + cmake ninja-build xvfb For the Windows wallet: @@ -51,11 +50,9 @@ Why the helpers exist The wallet build is sensitive to tool version mismatches: -* Native Ubuntu uses current system Qt tools and protobuf while keeping the - deterministic depends libraries. -* Windows uses the Qt 5.9.7 and protobuf 2.6.1 libraries from depends. Its host - tools must match those libraries closely enough for generated C++ output to - compile. +* Native Ubuntu uses the deterministic depends Qt6, OpenSSL, Boost, protobuf, + and supporting libraries. +* Cross-target wallets must use the matching Qt host tools staged by depends. The helper scripts keep those rules in one place so the build is repeatable on a fresh server. @@ -80,10 +77,11 @@ After the Windows wallet build: Version checks -------------- -On Ubuntu: +On Ubuntu, use the smoke tests: - QT_QPA_PLATFORM=offscreen src/qt/agrarian-qt --version - src/agrariand --version + ./contrib/smoke-test-daemon.sh + ./contrib/smoke-test-wallet.sh + ./contrib/smoke-test-qt.sh For Windows binaries from the Linux build host: diff --git a/doc/dependencies.md b/doc/dependencies.md index fc70548b..3d5b1732 100644 --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -6,26 +6,26 @@ These are the dependencies currently used by Agrarian Core. You can find instruc | Dependency | Version used | Minimum required | CVEs | Shared | [Bundled Qt library](https://doc.qt.io/qt-5/configure-options.html#third-party-libraries) | | --- | --- | --- | --- | --- | --- | | Berkeley DB | [4.8.30](https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 4.8.x | No | | | -| Boost | [1.64.0](https://www.boost.org/users/download/) | [1.47.0](https://github.com/bitcoin/bitcoin/pull/8920) | No | | | -| Clang | | [3.3+](https://llvm.org/releases/download.html) (C++11 support) | | | | +| Boost | [1.91.0](https://www.boost.org/users/download/) | [1.47.0](https://github.com/bitcoin/bitcoin/pull/8920) | No | | | +| Clang | | C++17 support | | | | | D-Bus | [1.10.18](https://cgit.freedesktop.org/dbus/dbus/tree/NEWS?h=dbus-1.10) | | No | Yes | | | Expat | [2.2.6](https://libexpat.github.io/) | | No | Yes | | | fontconfig | [2.12.1](https://www.freedesktop.org/software/fontconfig/release/) | | No | Yes | | | FreeType | [2.7.1](https://download.savannah.gnu.org/releases/freetype) | | No | | | -| GCC | | [4.8+](https://gcc.gnu.org/) (C++11 support) | | | | +| GCC | | C++17 support | | | | | HarfBuzz-NG | | | | | | | libevent | [2.1.8-stable](https://github.com/libevent/libevent/releases) | 2.0.22 | No | | | | libjpeg | | | | | [Yes](https://github.com/agrarian-project/agrarian/blob/master/depends/packages/qt.mk#L65) | | libpng | | | | | [Yes](https://github.com/agrarian-project/agrarian/blob/master/depends/packages/qt.mk#L64) | | librsvg | | | | | | | MiniUPnPc | [2.0.20180203](http://miniupnp.free.fr/files) | | No | | | -| OpenSSL | [1.0.1k](https://www.openssl.org/source) | | Yes | | | +| OpenSSL | [3.5.6](https://www.openssl.org/source) | | No | | | | GMP | [6.1.2](https://gmplib.org/) | | No | | | | PCRE | | | | | [Yes](https://github.com/agrarian-project/agrarian/blob/master/depends/packages/qt.mk#L66) | | protobuf | [2.6.1](https://github.com/google/protobuf/releases) | | No | | | | Python (tests) | | [3.5](https://www.python.org/downloads) | | | | | qrencode | [3.4.4](https://fukuchi.org/works/qrencode) | | No | | | -| Qt | [5.9.7](https://download.qt.io/official_releases/qt/) | [5.5.1](https://github.com/bitcoin/bitcoin/issues/13478) | No | | | +| Qt | [6.8.3](https://download.qt.io/official_releases/qt/) | 6.8 LTS | No | | | | XCB | | | | | [Yes](https://github.com/agrarian-project/agrarian/blob/master/depends/packages/qt.mk#L87) (Linux only) | | xkbcommon | | | | | [Yes](https://github.com/agrarian-project/agrarian/blob/master/depends/packages/qt.mk#L86) (Linux only) | | ZeroMQ | [4.3.1](https://github.com/zeromq/libzmq/releases) | 4.0.0 | No | | | diff --git a/doc/man/Makefile.in b/doc/man/Makefile.in index 7954ab62..197f4736 100644 --- a/doc/man/Makefile.in +++ b/doc/man/Makefile.in @@ -247,6 +247,7 @@ EVENT_PTHREADS_LIBS = @EVENT_PTHREADS_LIBS@ EXEEXT = @EXEEXT@ EXTENDED_FUNCTIONAL_TESTS = @EXTENDED_FUNCTIONAL_TESTS@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GCOV = @GCOV@ GENHTML = @GENHTML@ GENISOIMAGE = @GENISOIMAGE@ @@ -257,7 +258,7 @@ GREP = @GREP@ HARDENED_CPPFLAGS = @HARDENED_CPPFLAGS@ HARDENED_CXXFLAGS = @HARDENED_CXXFLAGS@ HARDENED_LDFLAGS = @HARDENED_LDFLAGS@ -HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HEXDUMP = @HEXDUMP@ IMAGEMAGICK_CONVERT = @IMAGEMAGICK_CONVERT@ INSTALL = @INSTALL@ @@ -328,8 +329,6 @@ PYTHON = @PYTHON@ PYTHONPATH = @PYTHONPATH@ QR_CFLAGS = @QR_CFLAGS@ QR_LIBS = @QR_LIBS@ -QT5_CFLAGS = @QT5_CFLAGS@ -QT5_LIBS = @QT5_LIBS@ QTACCESSIBILITY_CFLAGS = @QTACCESSIBILITY_CFLAGS@ QTACCESSIBILITY_LIBS = @QTACCESSIBILITY_LIBS@ QTCGL_CFLAGS = @QTCGL_CFLAGS@ @@ -352,6 +351,7 @@ QTTHEME_CFLAGS = @QTTHEME_CFLAGS@ QTTHEME_LIBS = @QTTHEME_LIBS@ QTXCBQPA_CFLAGS = @QTXCBQPA_CFLAGS@ QTXCBQPA_LIBS = @QTXCBQPA_LIBS@ +QT_CFLAGS = @QT_CFLAGS@ QT_DBUS_CFLAGS = @QT_DBUS_CFLAGS@ QT_DBUS_INCLUDES = @QT_DBUS_INCLUDES@ QT_DBUS_LIBS = @QT_DBUS_LIBS@ diff --git a/src/Makefile.in b/src/Makefile.in index 5a0db2e4..cab590ec 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1932,6 +1932,7 @@ EVENT_PTHREADS_LIBS = @EVENT_PTHREADS_LIBS@ EXEEXT = @EXEEXT@ EXTENDED_FUNCTIONAL_TESTS = @EXTENDED_FUNCTIONAL_TESTS@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GCOV = @GCOV@ GENHTML = @GENHTML@ GENISOIMAGE = @GENISOIMAGE@ @@ -1942,7 +1943,7 @@ GREP = @GREP@ HARDENED_CPPFLAGS = @HARDENED_CPPFLAGS@ HARDENED_CXXFLAGS = @HARDENED_CXXFLAGS@ HARDENED_LDFLAGS = @HARDENED_LDFLAGS@ -HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HEXDUMP = @HEXDUMP@ IMAGEMAGICK_CONVERT = @IMAGEMAGICK_CONVERT@ INSTALL = @INSTALL@ @@ -2013,8 +2014,6 @@ PYTHON = @PYTHON@ PYTHONPATH = @PYTHONPATH@ QR_CFLAGS = @QR_CFLAGS@ QR_LIBS = @QR_LIBS@ -QT5_CFLAGS = @QT5_CFLAGS@ -QT5_LIBS = @QT5_LIBS@ QTACCESSIBILITY_CFLAGS = @QTACCESSIBILITY_CFLAGS@ QTACCESSIBILITY_LIBS = @QTACCESSIBILITY_LIBS@ QTCGL_CFLAGS = @QTCGL_CFLAGS@ @@ -2037,6 +2036,7 @@ QTTHEME_CFLAGS = @QTTHEME_CFLAGS@ QTTHEME_LIBS = @QTTHEME_LIBS@ QTXCBQPA_CFLAGS = @QTXCBQPA_CFLAGS@ QTXCBQPA_LIBS = @QTXCBQPA_LIBS@ +QT_CFLAGS = @QT_CFLAGS@ QT_DBUS_CFLAGS = @QT_DBUS_CFLAGS@ QT_DBUS_INCLUDES = @QT_DBUS_INCLUDES@ QT_DBUS_LIBS = @QT_DBUS_LIBS@ diff --git a/src/config/agrarian-config.h.in b/src/config/agrarian-config.h.in index c7520d38..10c86093 100644 --- a/src/config/agrarian-config.h.in +++ b/src/config/agrarian-config.h.in @@ -70,8 +70,8 @@ /* Define this symbol if the consensus lib has been built */ #undef HAVE_CONSENSUS_LIB -/* define if the compiler supports basic C++11 syntax */ -#undef HAVE_CXX11 +/* define if the compiler supports basic C++17 syntax */ +#undef HAVE_CXX17 /* Define to 1 if you have the declaration of `be16toh', and to 0 if you don't. */ @@ -366,6 +366,9 @@ /* Define this symbol if qt plugins are static */ #undef QT_STATICPLUGIN +/* Define this symbol if the Qt OpenSSL TLS backend exists */ +#undef QT_TLS_OPENSSL + /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ diff --git a/src/qt/agrarian.cpp b/src/qt/agrarian.cpp index 37ddce40..8c0cdcd7 100644 --- a/src/qt/agrarian.cpp +++ b/src/qt/agrarian.cpp @@ -58,6 +58,12 @@ #if QT_VERSION < 0x050400 Q_IMPORT_PLUGIN(AccessibleFactory) #endif +#if defined(QT_TLS_OPENSSL) +Q_IMPORT_PLUGIN(QTlsBackendOpenSSL); +#endif +#if defined(QT_QPA_PLATFORM_MINIMAL) +Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin); +#endif #if defined(QT_QPA_PLATFORM_XCB) Q_IMPORT_PLUGIN(QXcbIntegrationPlugin); #elif defined(QT_QPA_PLATFORM_WINDOWS) @@ -120,12 +126,19 @@ static void initTranslations(QTranslator& qtTranslatorBase, QTranslator& qtTrans // - First load the translator for the base language, without territory // - Then load the more specific locale translator + const QString qtTranslationsPath = +#if QT_VERSION >= 0x060000 + QLibraryInfo::path(QLibraryInfo::TranslationsPath); +#else + QLibraryInfo::location(QLibraryInfo::TranslationsPath); +#endif + // Load e.g. qt_de.qm - if (qtTranslatorBase.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + if (qtTranslatorBase.load("qt_" + lang, qtTranslationsPath)) QApplication::installTranslator(&qtTranslatorBase); // Load e.g. qt_de_DE.qm - if (qtTranslator.load("qt_" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + if (qtTranslator.load("qt_" + lang_territory, qtTranslationsPath)) QApplication::installTranslator(&qtTranslator); // Load e.g. bitcoin_de.qm (shortcut "de" needs to be defined in agrarian.qrc) @@ -502,11 +515,11 @@ int main(int argc, char* argv[]) Q_INIT_RESOURCE(agrarian_locale); Q_INIT_RESOURCE(agrarian); -#if QT_VERSION > 0x050100 +#if QT_VERSION > 0x050100 && QT_VERSION < 0x060000 // Generate high-dpi pixmaps QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #endif -#if QT_VERSION >= 0x050600 +#if QT_VERSION >= 0x050600 && QT_VERSION < 0x060000 QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif #ifdef Q_OS_MAC diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp index fd48522a..facda528 100644 --- a/src/qt/bantablemodel.cpp +++ b/src/qt/bantablemodel.cpp @@ -16,6 +16,7 @@ #include #include +#include bool BannedNodeLessThan::operator()(const CCombinedBan& left, const CCombinedBan& right) const { @@ -125,9 +126,8 @@ QVariant BanTableModel::data(const QModelIndex &index, int role) const case Address: return QString::fromStdString(rec->subnet.ToString()); case Bantime: - QDateTime date = QDateTime::fromMSecsSinceEpoch(0); - date = date.addSecs(rec->banEntry.nBanUntil); - return date.toString(Qt::SystemLocaleLongDate); + QDateTime date = QDateTime::fromSecsSinceEpoch(rec->banEntry.nBanUntil); + return QLocale::system().toString(date, QLocale::LongFormat); } } diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index b49b59d2..36d293d8 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -119,7 +119,10 @@ public: opt.rect = rect(); - cachedMinimumSizeHint = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this).expandedTo(QApplication::globalStrut()); + cachedMinimumSizeHint = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + cachedMinimumSizeHint = cachedMinimumSizeHint.expandedTo(QApplication::globalStrut()); +#endif } return cachedMinimumSizeHint; } diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index deccf76b..fd1f043b 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -37,9 +37,12 @@ #include #include +#include #include #include +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include +#endif #include #include #include @@ -305,9 +308,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle) overviewAction->setToolTip(overviewAction->statusTip()); overviewAction->setCheckable(true); #ifdef Q_OS_MAC - overviewAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_1)); + overviewAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_1)); #else - overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); + overviewAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_1)); #endif tabGroup->addAction(overviewAction); @@ -316,9 +319,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle) sendCoinsAction->setToolTip(sendCoinsAction->statusTip()); sendCoinsAction->setCheckable(true); #ifdef Q_OS_MAC - sendCoinsAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_2)); + sendCoinsAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_2)); #else - sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); + sendCoinsAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_2)); #endif tabGroup->addAction(sendCoinsAction); @@ -327,9 +330,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle) receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); receiveCoinsAction->setCheckable(true); #ifdef Q_OS_MAC - receiveCoinsAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_3)); + receiveCoinsAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_3)); #else - receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); + receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_3)); #endif tabGroup->addAction(receiveCoinsAction); @@ -338,9 +341,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle) historyAction->setToolTip(historyAction->statusTip()); historyAction->setCheckable(true); #ifdef Q_OS_MAC - historyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_4)); + historyAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_4)); #else - historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); + historyAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_4)); #endif tabGroup->addAction(historyAction); @@ -349,9 +352,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle) privacyAction->setToolTip(privacyAction->statusTip()); privacyAction->setCheckable(true); #ifdef Q_OS_MAC - privacyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_5)); + privacyAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_5)); #else - privacyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); + privacyAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_5)); #endif tabGroup->addAction(privacyAction); @@ -364,9 +367,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle) masternodeAction->setToolTip(masternodeAction->statusTip()); masternodeAction->setCheckable(true); #ifdef Q_OS_MAC - masternodeAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_6)); + masternodeAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_6)); #else - masternodeAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6)); + masternodeAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_6)); #endif tabGroup->addAction(masternodeAction); connect(masternodeAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); @@ -378,9 +381,9 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle) governanceAction->setToolTip(governanceAction->statusTip()); governanceAction->setCheckable(true); #ifdef Q_OS_MAC - governanceAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_7)); + governanceAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_7)); #else - governanceAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7)); + governanceAction->setShortcut(QKeySequence(Qt::ALT | Qt::Key_7)); #endif tabGroup->addAction(governanceAction); @@ -401,7 +404,7 @@ void BitcoinGUI::createActions(const NetworkStyle* networkStyle) quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); - quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); + quitAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(networkStyle->getAppIcon(), tr("&About Agrarian Core"), this); aboutAction->setStatusTip(tr("Show information about Agrarian Core")); diff --git a/src/qt/blockexplorer.cpp b/src/qt/blockexplorer.cpp index 728bc2c2..2850176f 100644 --- a/src/qt/blockexplorer.cpp +++ b/src/qt/blockexplorer.cpp @@ -72,8 +72,7 @@ static std::string ScriptToString(const CScript& Script, bool Long = false, bool static std::string TimeToString(uint64_t Time) { - QDateTime timestamp; - timestamp.setTime_t(Time); + QDateTime timestamp = QDateTime::fromSecsSinceEpoch(Time); return timestamp.toString("yyyy-MM-dd hh:mm:ss").toUtf8().data(); } diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index cba1ab68..dee288e1 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -110,9 +110,9 @@ QDateTime ClientModel::getLastBlockDate() const { LOCK(cs_main); if (chainActive.Tip()) - return QDateTime::fromTime_t(chainActive.Tip()->GetBlockTime()); + return QDateTime::fromSecsSinceEpoch(chainActive.Tip()->GetBlockTime()); else - return QDateTime::fromTime_t(Params().GenesisBlock().GetBlockTime()); // Genesis block's time of current network + return QDateTime::fromSecsSinceEpoch(Params().GenesisBlock().GetBlockTime()); // Genesis block's time of current network } double ClientModel::getVerificationProgress() const @@ -248,7 +248,7 @@ QString ClientModel::clientName() const QString ClientModel::formatClientStartupTime() const { - return QDateTime::fromTime_t(nClientStartupTime).toString(); + return QDateTime::fromSecsSinceEpoch(nClientStartupTime).toString(); } void ClientModel::updateBanlist() diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 2d20354f..531f1dc3 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -730,7 +730,12 @@ void CoinControlDialog::updateView() ui->treeWidget->setEnabled(false); // performance, otherwise updateLabels would be called for every checked checkbox ui->treeWidget->setAlternatingRowColors(!treeMode); QFlags flgCheckbox = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable; - QFlags flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate; + QFlags flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + Qt::ItemIsAutoTristate; +#else + Qt::ItemIsTristate; +#endif int nDisplayUnit = model->getOptionsModel()->getDisplayUnit(); double mempoolEstimatePriority = mempool.estimatePriority(nTxConfirmTarget); diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 5c38c0e8..7d48becf 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -48,14 +48,21 @@ #include #include #include +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include +#endif +#include #include #include +#include #include #include #include +#include +#include #include #include +#include #include // for Qt::mightBeRichText #include #include @@ -82,12 +89,12 @@ namespace GUIUtil { QString dateTimeStr(const QDateTime& date) { - return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm"); + return QLocale::system().toString(date.date(), QLocale::ShortFormat) + QString(" ") + date.toString("hh:mm"); } QString dateTimeStr(qint64 nTime) { - return dateTimeStr(QDateTime::fromTime_t((qint32)nTime)); + return dateTimeStr(QDateTime::fromSecsSinceEpoch((qint32)nTime)); } QFont bitcoinAddressFont() @@ -269,10 +276,11 @@ QString getSaveFileName(QWidget* parent, const QString& caption, const QString& QString result = QDir::toNativeSeparators(QFileDialog::getSaveFileName(parent, caption, myDir, filter, &selectedFilter)); /* Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...) */ - QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]"); + QRegularExpression filter_re(".* \\(\\*\\.([^\\s\\)]+).*\\)"); QString selectedSuffix; - if (filter_re.exactMatch(selectedFilter)) { - selectedSuffix = filter_re.cap(1); + QRegularExpressionMatch filter_match = filter_re.match(selectedFilter); + if (filter_match.hasMatch()) { + selectedSuffix = filter_match.captured(1); } /* Add suffix if needed */ @@ -310,10 +318,11 @@ QString getOpenFileName(QWidget* parent, const QString& caption, const QString& if (selectedSuffixOut) { /* Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...) */ - QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]"); + QRegularExpression filter_re(".* \\(\\*\\.([^\\s\\)]+).*\\)"); QString selectedSuffix; - if (filter_re.exactMatch(selectedFilter)) { - selectedSuffix = filter_re.cap(1); + QRegularExpressionMatch filter_match = filter_re.match(selectedFilter); + if (filter_match.hasMatch()) { + selectedSuffix = filter_match.captured(1); } *selectedSuffixOut = selectedSuffix; } @@ -809,7 +818,7 @@ bool isExternal(QString theme) if (theme.isEmpty()) return false; - return (theme.operator!=("default")); + return theme != "default"; } // Open CSS when configured diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 5afdb062..524fb565 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -120,7 +120,7 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) : QDialog(paren if(langStr.contains("_")) { /** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */ - ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr)); + ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeTerritoryName() + QString(" (") + langStr + QString(")"), QVariant(langStr)); } else { diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 56a76606..46cb7e22 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -219,12 +219,12 @@ QVariant OptionsModel::data(const QModelIndex& index, int role) const return settings.value("fUseProxy", false); case ProxyIP: { // contains IP at index 0 and port at index 1 - QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts); return strlIpPort.at(0); } case ProxyPort: { // contains IP at index 0 and port at index 1 - QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts); return strlIpPort.at(1); } @@ -308,7 +308,7 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int break; case ProxyIP: { // contains current IP at index 0 and current port at index 1 - QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts); // if that key doesn't exist or has a changed IP if (!settings.contains("addrProxy") || strlIpPort.at(0) != value.toString()) { // construct new value from new IP and current port @@ -319,7 +319,7 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int } break; case ProxyPort: { // contains current IP at index 0 and current port at index 1 - QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts); + QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts); // if that key doesn't exist or has a changed port if (!settings.contains("addrProxy") || strlIpPort.at(1) != value.toString()) { // construct new value from current IP and new port diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index ec9f64be..aa93a6be 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -37,6 +37,7 @@ #include #include +#include class OptionsModel; @@ -48,7 +49,6 @@ class QByteArray; class QLocalServer; class QNetworkAccessManager; class QNetworkReply; -class QSslError; class QUrl; QT_END_NAMESPACE diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index 78f65135..1930381a 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -217,7 +217,7 @@ bool RecentRequestEntryLessThan::operator()(RecentRequestEntry& left, RecentRequ switch (column) { case RecentRequestsTableModel::Date: - return pLeft->date.toTime_t() < pRight->date.toTime_t(); + return pLeft->date.toSecsSinceEpoch() < pRight->date.toSecsSinceEpoch(); case RecentRequestsTableModel::Label: return pLeft->recipient.label < pRight->recipient.label; case RecentRequestsTableModel::Address: diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index f75ee158..131117c8 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -30,7 +30,7 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - unsigned int nDate = date.toTime_t(); + unsigned int nDate = date.toSecsSinceEpoch(); READWRITE(this->nVersion); nVersion = this->nVersion; @@ -39,7 +39,7 @@ public: READWRITE(recipient); if (ser_action.ForRead()) - date = QDateTime::fromTime_t(nDate); + date = QDateTime::fromSecsSinceEpoch(nDate); } }; diff --git a/src/qt/res/css/default.css b/src/qt/res/css/default.css index b217dfac..32852bc2 100644 --- a/src/qt/res/css/default.css +++ b/src/qt/res/css/default.css @@ -72,7 +72,7 @@ width: 70px; } QToolBar > QToolButton { -Alignment: left; +qproperty-alignment: 'AlignLeft'; background-color: #372f44; selection-background-color:transparent; border:0.5px solid #888; diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 8d571af5..1d1c71e2 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -367,7 +367,7 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent* event) case Qt::Key_PageUp: /* pass paging keys to messages widget */ case Qt::Key_PageDown: if (obj == ui->lineEdit) { - QApplication::postEvent(ui->messagesWidget, new QKeyEvent(*keyevt)); + QApplication::postEvent(ui->messagesWidget, new QKeyEvent(keyevt->type(), keyevt->key(), keyevt->modifiers(), keyevt->text(), keyevt->isAutoRepeat(), keyevt->count())); return true; } break; @@ -375,7 +375,7 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent* event) case Qt::Key_Enter: // forward these events to lineEdit if(obj == autoCompleter->popup()) { - QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt)); + QApplication::postEvent(ui->lineEdit, new QKeyEvent(keyevt->type(), keyevt->key(), keyevt->modifiers(), keyevt->text(), keyevt->isAutoRepeat(), keyevt->count())); return true; } break; @@ -386,7 +386,7 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent* event) ((mod & Qt::ControlModifier) && key == Qt::Key_V) || ((mod & Qt::ShiftModifier) && key == Qt::Key_Insert))) { ui->lineEdit->setFocus(); - QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt)); + QApplication::postEvent(ui->lineEdit, new QKeyEvent(keyevt->type(), keyevt->key(), keyevt->modifiers(), keyevt->text(), keyevt->isAutoRepeat(), keyevt->count())); return true; } } @@ -451,7 +451,11 @@ void RPCConsole::setClientModel(ClientModel* model) connect(banAction24h, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(banAction7d, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(banAction365d, SIGNAL(triggered()), signalMapper, SLOT(map())); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + connect(signalMapper, SIGNAL(mappedInt(int)), this, SLOT(banSelectedNode(int))); +#else connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(banSelectedNode(int))); +#endif // peer table context menu signals connect(ui->peerWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showPeersTableContextMenu(const QPoint&))); diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 540274c8..5e6e5c96 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -180,11 +180,19 @@ void SendCoinsDialog::setModel(WalletModel* model) connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateSmartFeeLabel())); connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateGlobalFeeVariables())); connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(coinControlUpdateLabels())); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + connect(ui->groupFee, SIGNAL(idClicked(int)), this, SLOT(updateFeeSectionControls())); + connect(ui->groupFee, SIGNAL(idClicked(int)), this, SLOT(updateGlobalFeeVariables())); + connect(ui->groupFee, SIGNAL(idClicked(int)), this, SLOT(coinControlUpdateLabels())); + connect(ui->groupCustomFee, SIGNAL(idClicked(int)), this, SLOT(updateGlobalFeeVariables())); + connect(ui->groupCustomFee, SIGNAL(idClicked(int)), this, SLOT(coinControlUpdateLabels())); +#else connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(updateFeeSectionControls())); connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(updateGlobalFeeVariables())); connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(coinControlUpdateLabels())); connect(ui->groupCustomFee, SIGNAL(buttonClicked(int)), this, SLOT(updateGlobalFeeVariables())); connect(ui->groupCustomFee, SIGNAL(buttonClicked(int)), this, SLOT(coinControlUpdateLabels())); +#endif connect(ui->customFee, SIGNAL(valueChanged()), this, SLOT(updateGlobalFeeVariables())); connect(ui->customFee, SIGNAL(valueChanged()), this, SLOT(coinControlUpdateLabels())); connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(setMinimumFee())); diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index d2c7f7e7..e8ad190d 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -19,7 +19,9 @@ #include #include +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include +#endif #include #include #include diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp index 72ce0b7c..b9273010 100644 --- a/src/qt/transactionfilterproxy.cpp +++ b/src/qt/transactionfilterproxy.cpp @@ -13,9 +13,9 @@ #include // Earliest date that can be represented (far in the past) -const QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromTime_t(0); +const QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromSecsSinceEpoch(0); // Last date that can be represented (far in the future) -const QDateTime TransactionFilterProxy::MAX_DATE = QDateTime::fromTime_t(0xFFFFFFFF); +const QDateTime TransactionFilterProxy::MAX_DATE = QDateTime::fromSecsSinceEpoch(0xFFFFFFFF); TransactionFilterProxy::TransactionFilterProxy(QObject* parent) : QSortFilterProxyModel(parent), dateFrom(MIN_DATE), diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index cb095196..8d9ce65a 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -608,7 +608,7 @@ QVariant TransactionTableModel::data(const QModelIndex& index, int role) const case TypeRole: return rec->type; case DateRole: - return QDateTime::fromTime_t(static_cast(rec->time)); + return QDateTime::fromSecsSinceEpoch(static_cast(rec->time)); case WatchonlyRole: return rec->involvesWatchAddress; case WatchonlyDecorationRole: diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 4347fac5..61dbd27b 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -175,7 +175,11 @@ TransactionView::TransactionView(QWidget* parent) : QWidget(parent), model(0), t mapperThirdPartyTxUrls = new QSignalMapper(this); // Connect actions +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + connect(mapperThirdPartyTxUrls, SIGNAL(mappedString(QString)), this, SLOT(openThirdPartyTxUrl(QString))); +#else connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this, SLOT(openThirdPartyTxUrl(QString))); +#endif connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int))); connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int))); @@ -231,7 +235,7 @@ void TransactionView::setModel(WalletModel* model) if (model->getOptionsModel()) { // Add third party transaction URLs to context menu - QStringList listUrls = model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts); + QStringList listUrls = model->getOptionsModel()->getThirdPartyTxUrls().split("|", Qt::SkipEmptyParts); for (int i = 0; i < listUrls.size(); ++i) { QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host(); if (!host.isEmpty()) { diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 5dbd16c7..c76fe079 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -52,8 +52,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget* parent, bool about) : QDialog(pare QString licenseInfoHTML = licenseInfo; // Make URLs clickable - QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2); - uri.setMinimal(true); // use non-greedy matching + QRegularExpression uri("<(.*?)>"); licenseInfoHTML.replace(uri, "\\1"); // Replace newlines with HTML breaks licenseInfoHTML.replace("\n\n", "

"); diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index b4f2eb75..fff38b6e 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -65,7 +65,7 @@ WalletView::WalletView(QWidget* parent) : QStackedWidget(parent), QFont fontHeaderLeft; fontHeaderLeft.setPointSize(20); fontHeaderLeft.setBold(true); - fontHeaderLeft.setWeight(75); + fontHeaderLeft.setWeight(QFont::Bold); labelOverviewHeaderLeft->setFont(fontHeaderLeft); horizontalLayout_Header->addWidget(labelOverviewHeaderLeft); diff --git a/src/qt/zagrcontroldialog.cpp b/src/qt/zagrcontroldialog.cpp index 13fdb29d..84d5cca5 100644 --- a/src/qt/zagrcontroldialog.cpp +++ b/src/qt/zagrcontroldialog.cpp @@ -59,7 +59,12 @@ void ZPivControlDialog::updateList() ui->treeWidget->clear(); // add a top level item for each denomination - QFlags flgTristate = Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate; + QFlags flgTristate = Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + Qt::ItemIsAutoTristate; +#else + Qt::ItemIsTristate; +#endif map mapDenomPosition; for (auto denom : libzerocoin::zerocoinDenomList) { CZPivControlWidgetItem* itemDenom(new CZPivControlWidgetItem); diff --git a/src/sync.h b/src/sync.h index 43687604..c7fc2379 100644 --- a/src/sync.h +++ b/src/sync.h @@ -132,8 +132,7 @@ private: bool TryEnter(const char* pszName, const char* pszFile, int nLine) { EnterCritical(pszName, pszFile, nLine, (void*)(lock.mutex()), true); - lock.try_lock(); - if (!lock.owns_lock()) + if (!lock.try_lock()) LeaveCritical(); return lock.owns_lock(); } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index de3cf0c1..12a73b41 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1699,7 +1699,7 @@ UniValue backupwallet(const UniValue& params, bool fHelp) "\nExamples:\n" + HelpExampleCli("backupwallet", "\"backup.dat\"") + HelpExampleRpc("backupwallet", "\"backup.dat\"")); - LOCK2(cs_main, pwalletMain->cs_wallet); + LOCK(pwalletMain->cs_wallet); string strDest = params[0].get_str(); if (!BackupWallet(*pwalletMain, strDest))