Merge pull request #4005 from xdustinface/pr-fix-qt-debug

depends|build: Make sure configuration detects Qt built with DEBUG=1
This commit is contained in:
PastaPastaPasta 2021-02-21 16:36:25 -06:00 committed by GitHub
commit 64b05b61d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 157 additions and 332 deletions

6
.gitignore vendored
View File

@ -63,8 +63,6 @@ libconftest.dylib*
*.pyc *.pyc
*.o *.o
*.o-* *.o-*
*.patch
!depends/patches/*/*.patch
*.a *.a
*.pb.cc *.pb.cc
*.pb.h *.pb.h
@ -76,6 +74,10 @@ libconftest.dylib*
*.json.h *.json.h
*.raw.h *.raw.h
# Only ignore unexpected patches
*.patch
!depends/patches/**/*.patch
#libtool object files #libtool object files
*.lo *.lo
*.la *.la

View File

@ -64,6 +64,13 @@ AC_DEFUN([BITCOIN_QT_INIT],[
], ],
[bitcoin_qt_want_version=auto]) [bitcoin_qt_want_version=auto])
AS_IF([test "x$with_gui" = xqt5_debug],
[AS_CASE([$host],
[*darwin*], [qt_lib_suffix=_debug],
[*mingw*], [qt_lib_suffix=d],
[qt_lib_suffix= ]); bitcoin_qt_want_version=qt5],
[qt_lib_suffix= ])
AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], []) AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], [])
AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], []) AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], [])
AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], []) AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], [])
@ -79,25 +86,17 @@ AC_DEFUN([BITCOIN_QT_INIT],[
AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path) AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path)
]) ])
dnl Find the appropriate version of Qt libraries and includes. dnl Find Qt libraries and includes.
dnl Inputs: $1: Whether or not pkg-config should be used. yes|no. Default: yes. dnl
dnl Inputs: $2: If $1 is "yes" and --with-gui=auto, which qt version should be dnl BITCOIN_QT_CONFIGURE([MINIMUM-VERSION])
dnl tried first. dnl
dnl Outputs: See _BITCOIN_QT_FIND_LIBS_* dnl Outputs: See _BITCOIN_QT_FIND_LIBS
dnl Outputs: Sets variables for all qt-related tools. dnl Outputs: Sets variables for all qt-related tools.
dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test
AC_DEFUN([BITCOIN_QT_CONFIGURE],[ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
use_pkgconfig=$1 qt_version=">= $1"
qt_lib_prefix="Qt5"
if test "x$use_pkgconfig" = x; then BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS])
use_pkgconfig=yes
fi
if test "x$use_pkgconfig" = xyes; then
BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG])
else
BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG])
fi
dnl This is ugly and complicated. Yuck. Works as follows: dnl This is ugly and complicated. Yuck. Works as follows:
dnl For Qt5, we can check a header to find out whether Qt is build dnl For Qt5, we can check a header to find out whether Qt is build
@ -134,7 +133,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
CXXFLAGS=$TEMP_CXXFLAGS CXXFLAGS=$TEMP_CXXFLAGS
]) ])
if test "x$use_pkgconfig$qt_bin_path" = xyes; then if test "x$qt_bin_path" = x; then
qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`" qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`"
fi fi
@ -223,7 +222,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
dnl enable qt support dnl enable qt support
AC_MSG_CHECKING(whether to build ]AC_PACKAGE_NAME[ GUI) AC_MSG_CHECKING([whether to build ]AC_PACKAGE_NAME[ GUI])
BITCOIN_QT_CHECK([ BITCOIN_QT_CHECK([
bitcoin_enable_qt=yes bitcoin_enable_qt=yes
bitcoin_enable_qt_test=yes bitcoin_enable_qt_test=yes
@ -243,7 +242,11 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
],[ ],[
bitcoin_enable_qt=no bitcoin_enable_qt=no
]) ])
AC_MSG_RESULT([$bitcoin_enable_qt (Qt5)]) if test x$bitcoin_enable_qt = xyes; then
AC_MSG_RESULT([$bitcoin_enable_qt ($qt_lib_prefix)])
else
AC_MSG_RESULT([$bitcoin_enable_qt])
fi
AC_SUBST(QT_PIE_FLAGS) AC_SUBST(QT_PIE_FLAGS)
AC_SUBST(QT_INCLUDES) AC_SUBST(QT_INCLUDES)
@ -261,57 +264,15 @@ dnl All macros below are internal and should _not_ be used from the main
dnl configure.ac. dnl configure.ac.
dnl ---- dnl ----
dnl Internal. Check included version of Qt against minimum specified in doc/dependencies.md
dnl Requires: INCLUDES must be populated as necessary.
dnl Output: bitcoin_cv_qt5=yes|no
AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[
AC_CACHE_CHECK(for Qt 5, bitcoin_cv_qt5,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h>
#ifndef QT_VERSION
# include <QtCore/qglobal.h>
#endif
]],
[[
#if QT_VERSION < 0x050501 || QT_VERSION_MAJOR < 5
choke
#endif
]])],
[bitcoin_cv_qt5=yes],
[bitcoin_cv_qt5=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
AC_DEFUN([_BITCOIN_QT_CHECK_QT58],[
AC_CACHE_CHECK(for > Qt 5.7, bitcoin_cv_qt58,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h>
#ifndef QT_VERSION
# include <QtCore/qglobal.h>
#endif
]],
[[
#if QT_VERSION_MINOR < 8
choke
#endif
]])],
[bitcoin_cv_qt58=yes],
[bitcoin_cv_qt58=no])
])])
dnl Internal. Check if the linked version of Qt was built as static libs. dnl Internal. Check if the linked version of Qt was built as static libs.
dnl Requires: Qt5. dnl Requires: Qt5.
dnl Requires: INCLUDES and LIBS must be populated as necessary. dnl Requires: INCLUDES and LIBS must be populated as necessary.
dnl Output: bitcoin_cv_static_qt=yes|no dnl Output: bitcoin_cv_static_qt=yes|no
dnl Output: Defines QT_STATICPLUGIN if plugins are static.
AC_DEFUN([_BITCOIN_QT_IS_STATIC],[ AC_DEFUN([_BITCOIN_QT_IS_STATIC],[
AC_CACHE_CHECK(for static Qt, bitcoin_cv_static_qt,[ AC_CACHE_CHECK(for static Qt, bitcoin_cv_static_qt,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h> #include <QtCore/qconfig.h>
#ifndef QT_VERSION OR QT_VERSION_STR #ifndef QT_VERSION
# include <QtCore/qglobal.h> # include <QtCore/qglobal.h>
#endif #endif
]], ]],
@ -323,9 +284,6 @@ AC_DEFUN([_BITCOIN_QT_IS_STATIC],[
[bitcoin_cv_static_qt=yes], [bitcoin_cv_static_qt=yes],
[bitcoin_cv_static_qt=no]) [bitcoin_cv_static_qt=no])
]) ])
if test "x$bitcoin_cv_static_qt" = xyes; then
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol for static Qt plugins])
fi
]) ])
dnl Internal. Check if the link-requirements for static plugins are met. dnl Internal. Check if the link-requirements for static plugins are met.
@ -336,13 +294,13 @@ dnl Output: QT_LIBS is prepended or configure exits.
AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[ AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[
AC_MSG_CHECKING(for static Qt plugins: $2) AC_MSG_CHECKING(for static Qt plugins: $2)
CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS" CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS"
LIBS="$2 $QT_LIBS $LIBS" LIBS="$2${qt_lib_suffix} $QT_LIBS $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#define QT_STATICPLUGIN #define QT_STATICPLUGIN
#include <QtPlugin> #include <QtPlugin>
$1]], $1]],
[[return 0;]])], [[return 0;]])],
[AC_MSG_RESULT(yes); QT_LIBS="$2 $QT_LIBS"], [AC_MSG_RESULT(yes); QT_LIBS="$2${qt_lib_suffix} $QT_LIBS"],
[AC_MSG_RESULT(no); BITCOIN_QT_FAIL(Could not resolve: $2)]) [AC_MSG_RESULT(no); BITCOIN_QT_FAIL(Could not resolve: $2)])
LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS" LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS"
]) ])
@ -356,169 +314,49 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
if test -d "$qt_plugin_path/accessible"; then if test -d "$qt_plugin_path/accessible"; then
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
fi fi
if test "x$use_pkgconfig" = xyes; then PKG_CHECK_MODULES([QTFONTDATABASE], [Qt5FontDatabaseSupport${qt_lib_suffix}], [QT_LIBS="-lQt5FontDatabaseSupport${qt_lib_suffix} $QT_LIBS"])
: dnl PKG_CHECK_MODULES([QTEVENTDISPATCHER], [Qt5EventDispatcherSupport${qt_lib_suffix}], [QT_LIBS="-lQt5EventDispatcherSupport${qt_lib_suffix} $QT_LIBS"])
m4_ifdef([PKG_CHECK_MODULES],[ PKG_CHECK_MODULES([QTTHEME], [Qt5ThemeSupport${qt_lib_suffix}], [QT_LIBS="-lQt5ThemeSupport${qt_lib_suffix} $QT_LIBS"])
if test x$bitcoin_cv_qt58 = xno; then PKG_CHECK_MODULES([QTDEVICEDISCOVERY], [Qt5DeviceDiscoverySupport${qt_lib_suffix}], [QT_LIBS="-lQt5DeviceDiscoverySupport${qt_lib_suffix} $QT_LIBS"])
PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"]) PKG_CHECK_MODULES([QTACCESSIBILITY], [Qt5AccessibilitySupport${qt_lib_suffix}], [QT_LIBS="-lQt5AccessibilitySupport${qt_lib_suffix} $QT_LIBS"])
else PKG_CHECK_MODULES([QTFB], [Qt5FbSupport${qt_lib_suffix}], [QT_LIBS="-lQt5FbSupport${qt_lib_suffix} $QT_LIBS"])
PKG_CHECK_MODULES([QTFONTDATABASE], [Qt5FontDatabaseSupport], [QT_LIBS="-lQt5FontDatabaseSupport $QT_LIBS"]) if test "x$TARGET_OS" = xlinux; then
PKG_CHECK_MODULES([QTEVENTDISPATCHER], [Qt5EventDispatcherSupport], [QT_LIBS="-lQt5EventDispatcherSupport $QT_LIBS"]) PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QTTHEME], [Qt5ThemeSupport], [QT_LIBS="-lQt5ThemeSupport $QT_LIBS"]) elif test "x$TARGET_OS" = xdarwin; then
PKG_CHECK_MODULES([QTDEVICEDISCOVERY], [Qt5DeviceDiscoverySupport], [QT_LIBS="-lQt5DeviceDiscoverySupport $QT_LIBS"]) PKG_CHECK_MODULES([QTCLIPBOARD], [Qt5ClipboardSupport${qt_lib_suffix}], [QT_LIBS="-lQt5ClipboardSupport${qt_lib_suffix} $QT_LIBS"])
PKG_CHECK_MODULES([QTACCESSIBILITY], [Qt5AccessibilitySupport], [QT_LIBS="-lQt5AccessibilitySupport $QT_LIBS"]) PKG_CHECK_MODULES([QTGRAPHICS], [Qt5GraphicsSupport${qt_lib_suffix}], [QT_LIBS="-lQt5GraphicsSupport${qt_lib_suffix} $QT_LIBS"])
PKG_CHECK_MODULES([QTFB], [Qt5FbSupport], [QT_LIBS="-lQt5FbSupport $QT_LIBS"]) PKG_CHECK_MODULES([QTCGL], [Qt5CglSupport${qt_lib_suffix}], [QT_LIBS="-lQt5CglSupport${qt_lib_suffix} $QT_LIBS"])
fi fi
if test "x$TARGET_OS" = xlinux; then fi
PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
elif test "x$TARGET_OS" = xdarwin; then
PKG_CHECK_MODULES([QTCLIPBOARD], [Qt5ClipboardSupport], [QT_LIBS="-lQt5ClipboardSupport $QT_LIBS"])
PKG_CHECK_MODULES([QTGRAPHICS], [Qt5GraphicsSupport], [QT_LIBS="-lQt5GraphicsSupport $QT_LIBS"])
PKG_CHECK_MODULES([QTCGL], [Qt5CglSupport], [QT_LIBS="-lQt5CglSupport $QT_LIBS"])
fi
])
else
if test "x$TARGET_OS" = xwindows; then
AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h>
#ifndef QT_VERSION
# include <QtCore/qglobal.h>
#endif
]],
[[
#if QT_VERSION < 0x050600 || QT_VERSION_MINOR < 6
choke
#endif
]])],
[bitcoin_cv_need_platformsupport=yes],
[bitcoin_cv_need_platformsupport=no])
])
if test "x$bitcoin_cv_need_platformsupport" = xyes; then
if test x$bitcoin_cv_qt58 = xno; then
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXPlatformSupport not found)))
else
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}FontDatabaseSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXFontDatabaseSupport not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}EventDispatcherSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXEventDispatcherSupport not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}ThemeSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXThemeSupport not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}FbSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXFbSupport not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}DeviceDiscoverySupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXDeviceDiscoverySupport not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}AccessibilitySupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXAccessibilitySupport not found)))
QT_LIBS="$QT_LIBS -lversion -ldwmapi -luxtheme"
fi
fi
fi
fi
fi
]) ])
dnl Internal. Find Qt libraries using pkg-config. dnl Internal. Find Qt libraries using pkg-config.
dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to check
dnl first.
dnl Inputs: $1: If bitcoin_qt_want_version is "auto", check for this version
dnl first.
dnl Outputs: All necessary QT_* variables are set. dnl Outputs: All necessary QT_* variables are set.
dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[ AC_DEFUN([_BITCOIN_QT_FIND_LIBS],[
m4_ifdef([PKG_CHECK_MODULES],[
QT_LIB_PREFIX=Qt5
qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets"
BITCOIN_QT_CHECK([
PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" have_qt=yes],[have_qt=no])
if test "x$have_qt" != xyes; then
have_qt=no
BITCOIN_QT_FAIL([Qt dependencies not found])
fi
])
BITCOIN_QT_CHECK([
PKG_CHECK_MODULES([QT_TEST], [${QT_LIB_PREFIX}Test], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
if test "x$use_dbus" != xno; then
PKG_CHECK_MODULES([QT_DBUS], [${QT_LIB_PREFIX}DBus], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no])
fi
])
])
true; dnl
])
dnl Internal. Find Qt libraries without using pkg-config. Version is deduced
dnl from the discovered headers.
dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to use.
dnl If "auto", the version will be discovered by _BITCOIN_QT_CHECK_QT5.
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_WITHOUT_PKGCONFIG],[
TEMP_CPPFLAGS="$CPPFLAGS"
TEMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$PIC_FLAGS $CXXFLAGS"
TEMP_LIBS="$LIBS"
BITCOIN_QT_CHECK([ BITCOIN_QT_CHECK([
if test "x$qt_include_path" != x; then PKG_CHECK_MODULES([QT_CORE], [${qt_lib_prefix}Core${qt_lib_suffix} $qt_version], [],
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" [BITCOIN_QT_FAIL([${qt_lib_prefix}Core${qt_lib_suffix} $qt_version not found])])
CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
fi
]) ])
BITCOIN_QT_CHECK([
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtPlugin],,BITCOIN_QT_FAIL(QtCore headers missing))]) PKG_CHECK_MODULES([QT_GUI], [${qt_lib_prefix}Gui${qt_lib_suffix} $qt_version], [],
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QApplication],, BITCOIN_QT_FAIL(QtGui headers missing))]) [BITCOIN_QT_FAIL([${qt_lib_prefix}Gui${qt_lib_suffix} $qt_version not found])])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QLocalSocket],, BITCOIN_QT_FAIL(QtNetwork headers missing))]) ])
BITCOIN_QT_CHECK([
PKG_CHECK_MODULES([QT_WIDGETS], [${qt_lib_prefix}Widgets${qt_lib_suffix} $qt_version], [],
[BITCOIN_QT_FAIL([${qt_lib_prefix}Widgets${qt_lib_suffix} $qt_version not found])])
])
BITCOIN_QT_CHECK([
PKG_CHECK_MODULES([QT_NETWORK], [${qt_lib_prefix}Network${qt_lib_suffix} $qt_version], [],
[BITCOIN_QT_FAIL([${qt_lib_prefix}Network${qt_lib_suffix} $qt_version not found])])
])
QT_INCLUDES="$QT_CORE_CFLAGS $QT_GUI_CFLAGS $QT_WIDGETS_CFLAGS $QT_NETWORK_CFLAGS"
QT_LIBS="$QT_CORE_LIBS $QT_GUI_LIBS $QT_WIDGETS_LIBS $QT_NETWORK_LIBS"
BITCOIN_QT_CHECK([ BITCOIN_QT_CHECK([
if test "x$bitcoin_qt_want_version" = xauto; then PKG_CHECK_MODULES([QT_TEST], [${qt_lib_prefix}Test${qt_lib_suffix} $qt_version], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
_BITCOIN_QT_CHECK_QT5
_BITCOIN_QT_CHECK_QT58
fi
QT_LIB_PREFIX=Qt5
])
BITCOIN_QT_CHECK([
LIBS=
if test "x$qt_lib_path" != x; then
LIBS="$LIBS -L$qt_lib_path"
fi
if test "x$TARGET_OS" = xwindows; then
AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found))
fi
])
BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,AC_MSG_WARN([zlib not found. Assuming qt has it built-in])))
BITCOIN_QT_CHECK(AC_SEARCH_LIBS([jpeg_create_decompress] ,[qtjpeg jpeg],,AC_MSG_WARN([libjpeg not found. Assuming qt has it built-in])))
if test x$bitcoin_cv_qt58 = xno; then
BITCOIN_QT_CHECK(AC_SEARCH_LIBS([png_error] ,[qtpng png],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in])))
BITCOIN_QT_CHECK(AC_SEARCH_LIBS([pcre16_exec], [qtpcre pcre16],,AC_MSG_WARN([libpcre16 not found. Assuming qt has it built-in])))
else
BITCOIN_QT_CHECK(AC_SEARCH_LIBS([png_error] ,[qtlibpng png],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in])))
BITCOIN_QT_CHECK(AC_SEARCH_LIBS([pcre2_match_16], [qtpcre2 libqtpcre2],,AC_MSG_WARN([libqtpcre2 not found. Assuming qt has it built-in])))
fi
BITCOIN_QT_CHECK(AC_SEARCH_LIBS([hb_ot_tags_from_script] ,[qtharfbuzzng qtharfbuzz harfbuzz],,AC_MSG_WARN([libharfbuzz not found. Assuming qt has it built-in or support is disabled])))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Core not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Gui not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Network not found)))
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Widgets not found)))
QT_LIBS="$LIBS"
LIBS="$TEMP_LIBS"
BITCOIN_QT_CHECK([
LIBS=
if test "x$qt_lib_path" != x; then
LIBS="-L$qt_lib_path"
fi
AC_CHECK_LIB([${QT_LIB_PREFIX}Test], [main],, have_qt_test=no)
AC_CHECK_HEADER([QTest],, have_qt_test=no)
QT_TEST_LIBS="$LIBS"
if test "x$use_dbus" != xno; then if test "x$use_dbus" != xno; then
LIBS= PKG_CHECK_MODULES([QT_DBUS], [${qt_lib_prefix}DBus $qt_version], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no])
if test "x$qt_lib_path" != x; then
LIBS="-L$qt_lib_path"
fi
AC_CHECK_LIB([${QT_LIB_PREFIX}DBus], [main],, have_qt_dbus=no)
AC_CHECK_HEADER([QtDBus],, have_qt_dbus=no)
QT_DBUS_LIBS="$LIBS"
fi fi
]) ])
CPPFLAGS="$TEMP_CPPFLAGS"
CXXFLAGS="$TEMP_CXXFLAGS"
LIBS="$TEMP_LIBS"
]) ])

View File

@ -936,7 +936,7 @@ fi
BITCOIN_QT_INIT BITCOIN_QT_INIT
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
BITCOIN_QT_CONFIGURE([$use_pkgconfig]) BITCOIN_QT_CONFIGURE([5.5.1])
if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononono; then if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononono; then
use_boost=no use_boost=no

View File

@ -62,8 +62,6 @@ ALLOWED_LIBRARIES = {
'ld-linux-x86-64.so.2', # 64-bit dynamic linker 'ld-linux-x86-64.so.2', # 64-bit dynamic linker
'ld-linux.so.2', # 32-bit dynamic linker 'ld-linux.so.2', # 32-bit dynamic linker
# dash-qt only # dash-qt only
'libX11-xcb.so.1', # part of X11
'libX11.so.6', # part of X11
'libxcb.so.1', # part of X11 'libxcb.so.1', # part of X11
'libfontconfig.so.1', # font support 'libfontconfig.so.1', # font support
'libfreetype.so.6', # font parsing 'libfreetype.so.6', # font parsing

View File

@ -33,20 +33,15 @@ if test -z $with_gui && test -n "@no_qt@"; then
with_gui=no with_gui=no
fi fi
if test -n "@debug@" && test -z "@no_qt@" && test "x$with_gui" != xno; then
with_gui=qt5_debug
fi
if test x@host_os@ = xdarwin; then if test x@host_os@ = xdarwin; then
BREW=no BREW=no
PORT=no PORT=no
fi fi
if test x@host_os@ = xmingw32; then
if test -z $with_qt_incdir; then
with_qt_incdir=$depends_prefix/include
fi
if test -z $with_qt_libdir; then
with_qt_libdir=$depends_prefix/lib
fi
fi
PATH=$depends_prefix/native/bin:$PATH PATH=$depends_prefix/native/bin:$PATH
PKG_CONFIG="`which pkg-config` --static" PKG_CONFIG="`which pkg-config` --static"

View File

@ -1,23 +0,0 @@
package=libX11
$(package)_version=1.6.2
$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=2aa027e837231d2eeea90f3a4afe19948a6eb4c8b2bec0241eba7dbc8106bd16
$(package)_dependencies=libxcb xtrans xextproto xproto
define $(package)_set_vars
$(package)_config_opts=--disable-xkb --disable-static
$(package)_config_opts_linux=--with-pic
endef
define $(package)_config_cmds
$($(package)_autoconf)
endef
define $(package)_build_cmds
$(MAKE)
endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

View File

@ -1,22 +0,0 @@
package=libXext
$(package)_version=1.3.2
$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=f829075bc646cdc085fa25d98d5885d83b1759ceb355933127c257e8e50432e0
$(package)_dependencies=xproto xextproto libX11 libXau
define $(package)_set_vars
$(package)_config_opts=--disable-static
endef
define $(package)_config_cmds
$($(package)_autoconf)
endef
define $(package)_build_cmds
$(MAKE)
endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

View File

@ -3,7 +3,7 @@ $(package)_version=1.10
$(package)_download_path=http://xcb.freedesktop.org/dist $(package)_download_path=http://xcb.freedesktop.org/dist
$(package)_file_name=$(package)-$($(package)_version).tar.bz2 $(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=98d9ab05b636dd088603b64229dd1ab2d2cc02ab807892e107d674f9c3f2d5b5 $(package)_sha256_hash=98d9ab05b636dd088603b64229dd1ab2d2cc02ab807892e107d674f9c3f2d5b5
$(package)_dependencies=xcb_proto libXau xproto $(package)_dependencies=xcb_proto libXau
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--disable-static $(package)_config_opts=--disable-static

View File

@ -3,7 +3,7 @@ packages:=boost openssl libevent zeromq gmp chia_bls backtrace
qt_native_packages = native_protobuf qt_native_packages = native_protobuf
qt_packages = qrencode protobuf zlib 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 expat dbus libxcb xcb_proto libXau xproto freetype fontconfig
qt_darwin_packages=qt qt_darwin_packages=qt
qt_mingw32_packages=qt qt_mingw32_packages=qt

View File

@ -5,10 +5,10 @@ $(package)_suffix=opensource-src-$($(package)_version).tar.xz
$(package)_file_name=qtbase-$($(package)_suffix) $(package)_file_name=qtbase-$($(package)_suffix)
$(package)_sha256_hash=eed620cb268b199bd83b3fc6a471c51d51e1dc2dbb5374fc97a0cc75facbe36f $(package)_sha256_hash=eed620cb268b199bd83b3fc6a471c51d51e1dc2dbb5374fc97a0cc75facbe36f
$(package)_dependencies=openssl zlib $(package)_dependencies=openssl zlib
$(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext $(package)_linux_dependencies=freetype fontconfig libxcb
$(package)_build_subdir=qtbase $(package)_build_subdir=qtbase
$(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_qt_libs=corelib network widgets gui plugins testlib
$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch xkb-default.patch $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch xkb-default.patch no-xlib.patch
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
$(package)_qttranslations_sha256_hash=9822084f8e2d2939ba39f4af4c0c2320e45d5996762a9423f833055607604ed8 $(package)_qttranslations_sha256_hash=9822084f8e2d2939ba39f4af4c0c2320e45d5996762a9423f833055607604ed8
@ -86,6 +86,8 @@ endif
$(package)_config_opts_linux = -qt-xkbcommon-x11 $(package)_config_opts_linux = -qt-xkbcommon-x11
$(package)_config_opts_linux += -qt-xcb $(package)_config_opts_linux += -qt-xcb
$(package)_config_opts_linux += -no-xcb-xlib
$(package)_config_opts_linux += -no-feature-xlib
$(package)_config_opts_linux += -system-freetype $(package)_config_opts_linux += -system-freetype
$(package)_config_opts_linux += -no-feature-sessionmanager $(package)_config_opts_linux += -no-feature-sessionmanager
$(package)_config_opts_linux += -fontconfig $(package)_config_opts_linux += -fontconfig
@ -142,6 +144,7 @@ define $(package)_preprocess_cmds
echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.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_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 "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
patch -p1 -i $($(package)_patch_dir)/no-xlib.patch &&\
echo "QMAKE_LINK_OBJECT_MAX = 10" >> qtbase/mkspecs/win32-g++/qmake.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 &&\ 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_CFLAGS = |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \

View File

@ -1,25 +0,0 @@
package=xextproto
$(package)_version=7.3.0
$(package)_download_path=http://xorg.freedesktop.org/releases/individual/proto
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0
define $(package)_preprocess_cmds
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
endef
define $(package)_set_vars
$(package)_config_opts=--disable-shared
endef
define $(package)_config_cmds
$($(package)_autoconf)
endef
define $(package)_build_cmds
$(MAKE)
endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

View File

@ -1,22 +0,0 @@
package=xtrans
$(package)_version=1.3.4
$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=054d4ee3efd52508c753e9f7bc655ef185a29bd2850dd9e2fc2ccc33544f583a
$(package)_dependencies=
define $(package)_set_vars
$(package)_config_opts_linux=--with-pic --disable-static
endef
define $(package)_config_cmds
$($(package)_autoconf)
endef
define $(package)_build_cmds
$(MAKE)
endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

View File

@ -1,11 +1,23 @@
--- old/qtbase/mkspecs/features/qt_module.prf --- old/qtbase/mkspecs/features/qt_module.prf
+++ new/qtbase/mkspecs/features/qt_module.prf +++ new/qtbase/mkspecs/features/qt_module.prf
@@ -245,7 +245,7 @@ @@ -264,7 +264,7 @@
load(qt_targets) load(qt_targets)
# this builds on top of qt_common # this builds on top of qt_common
-!internal_module:!lib_bundle:if(unix|mingw) { -!internal_module:!lib_bundle:if(unix|mingw) {
+unix|mingw { +if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) {
CONFIG += create_pc CONFIG += create_pc
QMAKE_PKGCONFIG_DESTDIR = pkgconfig QMAKE_PKGCONFIG_DESTDIR = pkgconfig
host_build: \ host_build: \
@@ -274,9 +274,9 @@
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$QT_MAJOR_VERSION ")
- QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)
+ QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)$$qtPlatformTargetSuffix()
for(i, MODULE_DEPENDS): \
- QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))
+ QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))$$qtPlatformTargetSuffix()
isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \
QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module
pclib_replace.match = $$lib_replace.match

View File

@ -0,0 +1,69 @@
From 9563cef873ae82e06f60708d706d054717e801ce Mon Sep 17 00:00:00 2001
From: Carl Dong <contact@carldong.me>
Date: Thu, 18 Jul 2019 17:22:05 -0400
Subject: [PATCH] Wrap xlib related code blocks in #if's
They are not necessary to compile QT.
---
qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
index 7c62c2e2b3..c05c6c0a07 100644
--- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -49,7 +49,9 @@
#include <QtGui/QWindow>
#include <QtGui/QBitmap>
#include <QtGui/private/qguiapplication_p.h>
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
#include <X11/cursorfont.h>
+#endif
#include <xcb/xfixes.h>
#include <xcb/xcb_image.h>
@@ -384,6 +386,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *widget)
w->setCursor(c, isBitmapCursor);
}
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
static int cursorIdForShape(int cshape)
{
int cursorId = 0;
@@ -437,6 +440,7 @@ static int cursorIdForShape(int cshape)
}
return cursorId;
}
+#endif
xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape)
{
@@ -558,7 +562,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
{
xcb_connection_t *conn = xcb_connection();
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
int cursorId = cursorIdForShape(cshape);
+#endif
xcb_cursor_t cursor = XCB_NONE;
// Try Xcursor first
@@ -589,6 +595,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
// Non-standard X11 cursors are created from bitmaps
cursor = createNonStandardCursor(cshape);
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
// Create a glpyh cursor if everything else failed
if (!cursor && cursorId) {
cursor = xcb_generate_id(conn);
@@ -596,6 +603,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
cursorId, cursorId + 1,
0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0);
}
+#endif
if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) {
const char *name = cursorNames[cshape];
--
2.22.0