Skip to content

Commit 67caef6

Browse files
committed
Merge #8314: Fix pkg-config issues for 0.13
b556bed build: fix Windows builds without pkg-config (Cory Fields) 0c928cb build: Fix Qt5PlatformSupport check without pkg-config (Cory Fields)
2 parents 2e51590 + b556bed commit 67caef6

File tree

2 files changed

+34
-13
lines changed

2 files changed

+34
-13
lines changed

build-aux/m4/bitcoin_qt.m4

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
331331
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
332332
fi
333333
fi
334-
m4_ifdef([PKG_CHECK_MODULES],[
335334
if test x$use_pkgconfig = xyes; then
335+
: dnl
336+
m4_ifdef([PKG_CHECK_MODULES],[
336337
PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"])
337338
if test x$TARGET_OS = xlinux; then
338339
PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
@@ -342,12 +343,23 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
342343
elif test x$TARGET_OS = xdarwin; then
343344
PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
344345
fi
346+
])
345347
else
346-
if ${PKG_CONFIG} --exists "Qt5Core >= 5.6" 2>/dev/null; then
347-
QT_LIBS="-lQt5PlatformSupport $QT_LIBS"
348+
if test x$TARGET_OS = xwindows; then
349+
AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
350+
[[#include <QtCore>]],[[
351+
#if QT_VERSION < 0x050600
352+
choke;
353+
#endif
354+
]])],
355+
[bitcoin_cv_need_platformsupport=yes],
356+
[bitcoin_cv_need_platformsupport=no])
357+
])
358+
if test x$bitcoin_cv_need_platformsupport = xyes; then
359+
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXPlatformSupport not found)))
360+
fi
348361
fi
349362
fi
350-
])
351363
else
352364
if test x$qt_plugin_path != x; then
353365
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"

configure.ac

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ AC_PATH_TOOL(OBJCOPY, objcopy)
7979

8080
AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files)
8181

82-
dnl pkg-config check.
83-
PKG_PROG_PKG_CONFIG
84-
8582
# Enable wallet
8683
AC_ARG_ENABLE([wallet],
8784
[AS_HELP_STRING([--disable-wallet],
@@ -375,6 +372,16 @@ case $host in
375372
;;
376373
esac
377374

375+
if test x$use_pkgconfig = xyes; then
376+
m4_ifndef([PKG_PROG_PKG_CONFIG], [AC_MSG_ERROR(PKG_PROG_PKG_CONFIG macro not found. Please install pkg-config and re-run autogen.sh.)])
377+
m4_ifdef([PKG_PROG_PKG_CONFIG], [
378+
PKG_PROG_PKG_CONFIG
379+
if test x"$PKG_CONFIG" = "x"; then
380+
AC_MSG_ERROR(pkg-config not found.)
381+
fi
382+
])
383+
fi
384+
378385
if test x$use_comparison_tool != xno; then
379386
AC_SUBST(JAVA_COMPARISON_TOOL, $use_comparison_tool)
380387
fi
@@ -752,12 +759,7 @@ fi
752759
fi
753760

754761
if test x$use_pkgconfig = xyes; then
755-
756-
if test x"$PKG_CONFIG" = "x"; then
757-
AC_MSG_ERROR(pkg-config not found.)
758-
fi
759-
760-
: #NOP
762+
: dnl
761763
m4_ifdef(
762764
[PKG_CHECK_MODULES],
763765
[
@@ -1058,6 +1060,13 @@ AC_SUBST(TESTDEFS)
10581060
AC_SUBST(LEVELDB_TARGET_FLAGS)
10591061
AC_SUBST(MINIUPNPC_CPPFLAGS)
10601062
AC_SUBST(MINIUPNPC_LIBS)
1063+
AC_SUBST(CRYPTO_LIBS)
1064+
AC_SUBST(SSL_LIBS)
1065+
AC_SUBST(EVENT_LIBS)
1066+
AC_SUBST(EVENT_PTHREADS_LIBS)
1067+
AC_SUBST(ZMQ_LIBS)
1068+
AC_SUBST(PROTOBUF_LIBS)
1069+
AC_SUBST(QR_LIBS)
10611070
AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
10621071
AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
10631072
AC_CONFIG_FILES([qa/pull-tester/tests_config.py],[chmod +x qa/pull-tester/tests_config.py])

0 commit comments

Comments
 (0)