Skip to content

Commit fee6554

Browse files
committed
Merge pull request #6501
31bfc27 build: make sure pkg-config checks are guarded by an m4_ifdef (Cory Fields) d9add71 build: fix libressl detection (Cory Fields)
2 parents 86cfd23 + 31bfc27 commit fee6554

File tree

2 files changed

+49
-28
lines changed

2 files changed

+49
-28
lines changed

build-aux/m4/bitcoin_qt.m4

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,8 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
110110
if test x$bitcoin_qt_got_major_vers = x5; then
111111
_BITCOIN_QT_IS_STATIC
112112
if test x$bitcoin_cv_static_qt = xyes; then
113+
_BITCOIN_QT_FIND_STATIC_PLUGINS
113114
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
114-
if test x$qt_plugin_path != x; then
115-
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
116-
fi
117-
if test x$use_pkgconfig = xyes; then
118-
PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"])
119-
fi
120115
AC_CACHE_CHECK(for Qt < 5.4, bitcoin_cv_need_acc_widget,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
121116
[[#include <QtCore>]],[[
122117
#if QT_VERSION >= 0x050400
@@ -127,25 +122,15 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
127122
[bitcoin_cv_need_acc_widget=no])
128123
])
129124
if test "x$bitcoin_cv_need_acc_widget" = "xyes"; then
130-
if test x$qt_plugin_path != x; then
131-
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
132-
fi
133125
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets])
134126
fi
135127
if test x$TARGET_OS = xwindows; then
136128
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows])
137129
AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows])
138130
elif test x$TARGET_OS = xlinux; then
139-
PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
140-
if ${PKG_CONFIG} --exists "Qt5Core >= 5.5" 2>/dev/null; then
141-
PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
142-
fi
143131
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static])
144132
AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb])
145133
elif test x$TARGET_OS = xdarwin; then
146-
if test x$use_pkgconfig = xyes; then
147-
PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
148-
fi
149134
AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)])
150135
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa])
151136
AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa])
@@ -154,10 +139,6 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
154139
else
155140
if test x$TARGET_OS = xwindows; then
156141
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
157-
if test x$qt_plugin_path != x; then
158-
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
159-
QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
160-
fi
161142
_BITCOIN_QT_CHECK_STATIC_PLUGINS([
162143
Q_IMPORT_PLUGIN(qcncodecs)
163144
Q_IMPORT_PLUGIN(qjpcodecs)
@@ -297,6 +278,39 @@ AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[
297278
LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS"
298279
])
299280

281+
dnl Internal. Find paths necessary for linking qt static plugins
282+
dnl Inputs: bitcoin_qt_got_major_vers. 4 or 5.
283+
dnl Inputs: qt_plugin_path. optional.
284+
dnl Outputs: QT_LIBS is appended
285+
AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
286+
if test x$bitcoin_qt_got_major_vers = x5; then
287+
if test x$qt_plugin_path != x; then
288+
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
289+
if test -d "$qt_plugin_path/accessible"; then
290+
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
291+
fi
292+
fi
293+
m4_ifdef([PKG_CHECK_MODULES],[
294+
if test x$use_pkgconfig = xyes; then
295+
PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"])
296+
if test x$TARGET_OS = xlinux; then
297+
PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
298+
if ${PKG_CONFIG} --exists "Qt5Core >= 5.5" 2>/dev/null; then
299+
PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
300+
fi
301+
elif test x$TARGET_OS = xdarwin; then
302+
PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
303+
fi
304+
fi
305+
])
306+
else
307+
if test x$qt_plugin_path != x; then
308+
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
309+
QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
310+
fi
311+
fi
312+
])
313+
300314
dnl Internal. Find Qt libraries using pkg-config.
301315
dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to check
302316
dnl first.

configure.ac

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -680,19 +680,26 @@ else
680680
fi
681681
fi
682682

683-
AC_CHECK_LIB([crypto],[RAND_egd],[],[
684-
AC_ARG_WITH([libressl],
685-
[AS_HELP_STRING([--with-libressl],[Build with system LibreSSL (default is no; DANGEROUS; NOT SUPPORTED)])],
686-
[AC_MSG_WARN([Detected LibreSSL: This is NOT supported, and may break consensus compatibility!])],
687-
[AC_MSG_ERROR([Detected LibreSSL: This is NOT supported, and may break consensus compatibility!])]
688-
)
689-
])
690-
691683
CFLAGS_TEMP="$CFLAGS"
692684
LIBS_TEMP="$LIBS"
693685
CFLAGS="$CFLAGS $SSL_CFLAGS $CRYPTO_CFLAGS"
694686
LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS"
695687
AC_CHECK_HEADER([openssl/ec.h],, AC_MSG_ERROR(OpenSSL ec header missing),)
688+
689+
AC_MSG_CHECKING(for a supported OpenSSL version)
690+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
691+
#include <openssl/rand.h>
692+
]],
693+
[[RAND_egd(NULL);]])],
694+
[AC_MSG_RESULT(yes)],
695+
[
696+
AC_ARG_WITH([libressl],
697+
[AS_HELP_STRING([--with-libressl],[Build with system LibreSSL (default is no; DANGEROUS; NOT SUPPORTED)])],
698+
[AC_MSG_WARN([Detected LibreSSL: This is NOT supported, and may break consensus compatibility!])],
699+
[AC_MSG_ERROR([Detected LibreSSL: This is NOT supported, and may break consensus compatibility!])]
700+
)]
701+
)
702+
696703
CFLAGS="$CFLAGS_TEMP"
697704
LIBS="$LIBS_TEMP"
698705

0 commit comments

Comments
 (0)