Skip to content

Commit 76f52e3

Browse files
committed
build: Fix Qt processing of configure script for depends with DEBUG=1
Now, if depends is built with DEBUG=1, the configure script correctly finds Qt for macOS and Windows.
1 parent 5082324 commit 76f52e3

File tree

2 files changed

+31
-20
lines changed

2 files changed

+31
-20
lines changed

build-aux/m4/bitcoin_qt.m4

+27-20
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ AC_DEFUN([BITCOIN_QT_INIT],[
6464
],
6565
[bitcoin_qt_want_version=auto])
6666
67+
AS_IF([test "x$with_gui" = xqt5_debug],
68+
[AS_CASE([$host],
69+
[*darwin*], [qt_lib_suffix=_debug],
70+
[*mingw*], [qt_lib_suffix=d],
71+
[qt_lib_suffix= ]); bitcoin_qt_want_version=qt5],
72+
[qt_lib_suffix= ])
73+
6774
AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], [])
6875
AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], [])
6976
AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], [])
@@ -285,13 +292,13 @@ dnl Output: QT_LIBS is prepended or configure exits.
285292
AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[
286293
AC_MSG_CHECKING(for static Qt plugins: $2)
287294
CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS"
288-
LIBS="$2 $QT_LIBS $LIBS"
295+
LIBS="$2${qt_lib_suffix} $QT_LIBS $LIBS"
289296
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
290297
#define QT_STATICPLUGIN
291298
#include <QtPlugin>
292299
$1]],
293300
[[return 0;]])],
294-
[AC_MSG_RESULT(yes); QT_LIBS="$2 $QT_LIBS"],
301+
[AC_MSG_RESULT(yes); QT_LIBS="$2${qt_lib_suffix} $QT_LIBS"],
295302
[AC_MSG_RESULT(no); BITCOIN_QT_FAIL(Could not resolve: $2)])
296303
LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS"
297304
])
@@ -308,18 +315,18 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
308315
if test -d "$qt_plugin_path/platforms/android"; then
309316
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL"
310317
fi
311-
PKG_CHECK_MODULES([QTFONTDATABASE], [Qt5FontDatabaseSupport], [QT_LIBS="-lQt5FontDatabaseSupport $QT_LIBS"])
312-
PKG_CHECK_MODULES([QTEVENTDISPATCHER], [Qt5EventDispatcherSupport], [QT_LIBS="-lQt5EventDispatcherSupport $QT_LIBS"])
313-
PKG_CHECK_MODULES([QTTHEME], [Qt5ThemeSupport], [QT_LIBS="-lQt5ThemeSupport $QT_LIBS"])
314-
PKG_CHECK_MODULES([QTDEVICEDISCOVERY], [Qt5DeviceDiscoverySupport], [QT_LIBS="-lQt5DeviceDiscoverySupport $QT_LIBS"])
315-
PKG_CHECK_MODULES([QTACCESSIBILITY], [Qt5AccessibilitySupport], [QT_LIBS="-lQt5AccessibilitySupport $QT_LIBS"])
316-
PKG_CHECK_MODULES([QTFB], [Qt5FbSupport], [QT_LIBS="-lQt5FbSupport $QT_LIBS"])
318+
PKG_CHECK_MODULES([QTFONTDATABASE], [Qt5FontDatabaseSupport${qt_lib_suffix}], [QT_LIBS="-lQt5FontDatabaseSupport${qt_lib_suffix} $QT_LIBS"])
319+
PKG_CHECK_MODULES([QTEVENTDISPATCHER], [Qt5EventDispatcherSupport${qt_lib_suffix}], [QT_LIBS="-lQt5EventDispatcherSupport${qt_lib_suffix} $QT_LIBS"])
320+
PKG_CHECK_MODULES([QTTHEME], [Qt5ThemeSupport${qt_lib_suffix}], [QT_LIBS="-lQt5ThemeSupport${qt_lib_suffix} $QT_LIBS"])
321+
PKG_CHECK_MODULES([QTDEVICEDISCOVERY], [Qt5DeviceDiscoverySupport${qt_lib_suffix}], [QT_LIBS="-lQt5DeviceDiscoverySupport${qt_lib_suffix} $QT_LIBS"])
322+
PKG_CHECK_MODULES([QTACCESSIBILITY], [Qt5AccessibilitySupport${qt_lib_suffix}], [QT_LIBS="-lQt5AccessibilitySupport${qt_lib_suffix} $QT_LIBS"])
323+
PKG_CHECK_MODULES([QTFB], [Qt5FbSupport${qt_lib_suffix}], [QT_LIBS="-lQt5FbSupport${qt_lib_suffix} $QT_LIBS"])
317324
if test "x$TARGET_OS" = xlinux; then
318325
PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
319326
elif test "x$TARGET_OS" = xdarwin; then
320-
PKG_CHECK_MODULES([QTCLIPBOARD], [Qt5ClipboardSupport], [QT_LIBS="-lQt5ClipboardSupport $QT_LIBS"])
321-
PKG_CHECK_MODULES([QTGRAPHICS], [Qt5GraphicsSupport], [QT_LIBS="-lQt5GraphicsSupport $QT_LIBS"])
322-
PKG_CHECK_MODULES([QTCGL], [Qt5CglSupport], [QT_LIBS="-lQt5CglSupport $QT_LIBS"])
327+
PKG_CHECK_MODULES([QTCLIPBOARD], [Qt5ClipboardSupport${qt_lib_suffix}], [QT_LIBS="-lQt5ClipboardSupport${qt_lib_suffix} $QT_LIBS"])
328+
PKG_CHECK_MODULES([QTGRAPHICS], [Qt5GraphicsSupport${qt_lib_suffix}], [QT_LIBS="-lQt5GraphicsSupport${qt_lib_suffix} $QT_LIBS"])
329+
PKG_CHECK_MODULES([QTCGL], [Qt5CglSupport${qt_lib_suffix}], [QT_LIBS="-lQt5CglSupport${qt_lib_suffix} $QT_LIBS"])
323330
fi
324331
fi
325332
])
@@ -329,26 +336,26 @@ dnl Outputs: All necessary QT_* variables are set.
329336
dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
330337
AC_DEFUN([_BITCOIN_QT_FIND_LIBS],[
331338
BITCOIN_QT_CHECK([
332-
PKG_CHECK_MODULES([QT_CORE], [${qt_lib_prefix}Core $qt_version], [],
333-
[BITCOIN_QT_FAIL([${qt_lib_prefix}Core $qt_version not found])])
339+
PKG_CHECK_MODULES([QT_CORE], [${qt_lib_prefix}Core${qt_lib_suffix} $qt_version], [],
340+
[BITCOIN_QT_FAIL([${qt_lib_prefix}Core${qt_lib_suffix} $qt_version not found])])
334341
])
335342
BITCOIN_QT_CHECK([
336-
PKG_CHECK_MODULES([QT_GUI], [${qt_lib_prefix}Gui $qt_version], [],
337-
[BITCOIN_QT_FAIL([${qt_lib_prefix}Gui $qt_version not found])])
343+
PKG_CHECK_MODULES([QT_GUI], [${qt_lib_prefix}Gui${qt_lib_suffix} $qt_version], [],
344+
[BITCOIN_QT_FAIL([${qt_lib_prefix}Gui${qt_lib_suffix} $qt_version not found])])
338345
])
339346
BITCOIN_QT_CHECK([
340-
PKG_CHECK_MODULES([QT_WIDGETS], [${qt_lib_prefix}Widgets $qt_version], [],
341-
[BITCOIN_QT_FAIL([${qt_lib_prefix}Widgets $qt_version not found])])
347+
PKG_CHECK_MODULES([QT_WIDGETS], [${qt_lib_prefix}Widgets${qt_lib_suffix} $qt_version], [],
348+
[BITCOIN_QT_FAIL([${qt_lib_prefix}Widgets${qt_lib_suffix} $qt_version not found])])
342349
])
343350
BITCOIN_QT_CHECK([
344-
PKG_CHECK_MODULES([QT_NETWORK], [${qt_lib_prefix}Network $qt_version], [],
345-
[BITCOIN_QT_FAIL([${qt_lib_prefix}Network $qt_version not found])])
351+
PKG_CHECK_MODULES([QT_NETWORK], [${qt_lib_prefix}Network${qt_lib_suffix} $qt_version], [],
352+
[BITCOIN_QT_FAIL([${qt_lib_prefix}Network${qt_lib_suffix} $qt_version not found])])
346353
])
347354
QT_INCLUDES="$QT_CORE_CFLAGS $QT_GUI_CFLAGS $QT_WIDGETS_CFLAGS $QT_NETWORK_CFLAGS"
348355
QT_LIBS="$QT_CORE_LIBS $QT_GUI_LIBS $QT_WIDGETS_LIBS $QT_NETWORK_LIBS"
349356
350357
BITCOIN_QT_CHECK([
351-
PKG_CHECK_MODULES([QT_TEST], [${qt_lib_prefix}Test $qt_version], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
358+
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])
352359
if test "x$use_dbus" != xno; then
353360
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])
354361
fi

depends/config.site.in

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ if test -z "$with_gui" && test -n "@no_qt@"; then
5454
with_gui=no
5555
fi
5656

57+
if test -n "@debug@" && test -z "@no_qt@" && test "x$with_gui" != xno; then
58+
with_gui=qt5_debug
59+
fi
60+
5761
if test -z "$enable_zmq" && test -n "@no_zmq@"; then
5862
enable_zmq=no
5963
fi

0 commit comments

Comments
 (0)