aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-08-03 15:01:26 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-08-03 15:30:15 +0200
commitfee6554b520c1bebe32bedd66706954c7b1599c7 (patch)
treef668c4c4deef0e0c7df2be66e7b15cc94e93cd99
parent86cfd23f68367af072500b1758a4c446cdd36e74 (diff)
parent31bfc272c7b2d1ff45d70bd19047bfe866296589 (diff)
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)
-rw-r--r--build-aux/m4/bitcoin_qt.m454
-rw-r--r--configure.ac23
2 files changed, 49 insertions, 28 deletions
diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4
index 100b8653a8..121e10bd37 100644
--- a/build-aux/m4/bitcoin_qt.m4
+++ b/build-aux/m4/bitcoin_qt.m4
@@ -110,13 +110,8 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
if test x$bitcoin_qt_got_major_vers = x5; then
_BITCOIN_QT_IS_STATIC
if test x$bitcoin_cv_static_qt = xyes; then
+ _BITCOIN_QT_FIND_STATIC_PLUGINS
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
- if test x$qt_plugin_path != x; then
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
- fi
- if test x$use_pkgconfig = xyes; then
- PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"])
- fi
AC_CACHE_CHECK(for Qt < 5.4, bitcoin_cv_need_acc_widget,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <QtCore>]],[[
#if QT_VERSION >= 0x050400
@@ -127,25 +122,15 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
[bitcoin_cv_need_acc_widget=no])
])
if test "x$bitcoin_cv_need_acc_widget" = "xyes"; then
- if test x$qt_plugin_path != x; then
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
- fi
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets])
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
- PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
- if ${PKG_CONFIG} --exists "Qt5Core >= 5.5" 2>/dev/null; then
- PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
- fi
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static])
AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb])
elif test x$TARGET_OS = xdarwin; then
- if test x$use_pkgconfig = xyes; then
- PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
- fi
AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)])
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa])
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],[
else
if test x$TARGET_OS = xwindows; then
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
- if test x$qt_plugin_path != x; then
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
- fi
_BITCOIN_QT_CHECK_STATIC_PLUGINS([
Q_IMPORT_PLUGIN(qcncodecs)
Q_IMPORT_PLUGIN(qjpcodecs)
@@ -297,6 +278,39 @@ AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[
LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS"
])
+dnl Internal. Find paths necessary for linking qt static plugins
+dnl Inputs: bitcoin_qt_got_major_vers. 4 or 5.
+dnl Inputs: qt_plugin_path. optional.
+dnl Outputs: QT_LIBS is appended
+AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
+ if test x$bitcoin_qt_got_major_vers = x5; then
+ if test x$qt_plugin_path != x; then
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
+ if test -d "$qt_plugin_path/accessible"; then
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
+ fi
+ fi
+ m4_ifdef([PKG_CHECK_MODULES],[
+ if test x$use_pkgconfig = xyes; then
+ PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"])
+ if test x$TARGET_OS = xlinux; then
+ PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
+ if ${PKG_CONFIG} --exists "Qt5Core >= 5.5" 2>/dev/null; then
+ PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
+ fi
+ elif test x$TARGET_OS = xdarwin; then
+ PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
+ fi
+ fi
+ ])
+ else
+ if test x$qt_plugin_path != x; then
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
+ fi
+ fi
+])
+
dnl Internal. Find Qt libraries using pkg-config.
dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to check
dnl first.
diff --git a/configure.ac b/configure.ac
index 7f90b5f395..a524bded6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -680,19 +680,26 @@ else
fi
fi
-AC_CHECK_LIB([crypto],[RAND_egd],[],[
- AC_ARG_WITH([libressl],
- [AS_HELP_STRING([--with-libressl],[Build with system LibreSSL (default is no; DANGEROUS; NOT SUPPORTED)])],
- [AC_MSG_WARN([Detected LibreSSL: This is NOT supported, and may break consensus compatibility!])],
- [AC_MSG_ERROR([Detected LibreSSL: This is NOT supported, and may break consensus compatibility!])]
- )
-])
-
CFLAGS_TEMP="$CFLAGS"
LIBS_TEMP="$LIBS"
CFLAGS="$CFLAGS $SSL_CFLAGS $CRYPTO_CFLAGS"
LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS"
AC_CHECK_HEADER([openssl/ec.h],, AC_MSG_ERROR(OpenSSL ec header missing),)
+
+AC_MSG_CHECKING(for a supported OpenSSL version)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #include <openssl/rand.h>
+ ]],
+ [[RAND_egd(NULL);]])],
+ [AC_MSG_RESULT(yes)],
+ [
+ AC_ARG_WITH([libressl],
+ [AS_HELP_STRING([--with-libressl],[Build with system LibreSSL (default is no; DANGEROUS; NOT SUPPORTED)])],
+ [AC_MSG_WARN([Detected LibreSSL: This is NOT supported, and may break consensus compatibility!])],
+ [AC_MSG_ERROR([Detected LibreSSL: This is NOT supported, and may break consensus compatibility!])]
+ )]
+)
+
CFLAGS="$CFLAGS_TEMP"
LIBS="$LIBS_TEMP"