aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-01-08 09:33:36 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-08 09:34:11 +0100
commit7fdbedcaf82c6aec681b4ca7f02f5c3f19fb7556 (patch)
treeb52eb850b5c70bbbe347d148ed8b1ccb813d0904
parent867c600c292cf2a1c0f6f60742d8e23fb01179f6 (diff)
parent2ecd2941edc8d07090b6b4aeaae7bc4c9c333066 (diff)
downloadbitcoin-7fdbedcaf82c6aec681b4ca7f02f5c3f19fb7556.tar.xz
Merge pull request #5542
2ecd294 Bugfix: configure: Correctly detect "nothing to build" condition (Luke Dashjr) b7a4ecc Bugfix: Only check for boost when building code that requires it (Luke Dashjr) a19eeac Bugfix: configure: Check for openssl/ec.h (Luke Dashjr) fe925e2 Use EXTRA_LIBRARIES instead of noinst_LIBRARIES so we can avoid building unused code (Cory Fields)
-rw-r--r--configure.ac74
-rw-r--r--src/Makefile.am4
-rw-r--r--src/Makefile.qt.include2
3 files changed, 54 insertions, 26 deletions
diff --git a/configure.ac b/configure.ac
index 3b912fb164..2859753a31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,6 +171,24 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
fi
CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
+AC_ARG_WITH([utils],
+ [AS_HELP_STRING([--with-utils],
+ [build bitcoin-cli bitcoin-tx (default=yes)])],
+ [build_bitcoin_utils=$withval],
+ [build_bitcoin_utils=yes])
+
+AC_ARG_WITH([libs],
+ [AS_HELP_STRING([--with-libs],
+ [build libraries (default=yes)])],
+ [build_bitcoin_libs=$withval],
+ [build_bitcoin_libs=yes])
+
+AC_ARG_WITH([daemon],
+ [AS_HELP_STRING([--with-daemon],
+ [build bitcoind daemon (default=yes)])],
+ [build_bitcoind=$withval],
+ [build_bitcoind=yes])
+
AC_LANG_PUSH([C++])
use_pkgconfig=yes
@@ -500,6 +518,19 @@ if test x$use_upnp != xno; then
)
fi
+BITCOIN_QT_INIT
+
+dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
+BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])
+
+if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then
+ use_boost=no
+else
+ use_boost=yes
+fi
+
+if test x$use_boost = xyes; then
+
dnl Check for boost libs
AX_BOOST_BASE
AX_BOOST_SYSTEM
@@ -537,6 +568,10 @@ if test x$use_reduce_exports != xno; then
CPPFLAGS="$TEMP_CPPFLAGS"
fi
+elif test x$use_reduce_exports = xauto; then
+ use_reduce_exports=yes
+fi
+
if test x$use_reduce_exports != xno; then
CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS"
AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"])
@@ -549,6 +584,8 @@ if test x$use_tests = xyes; then
fi
+ if test x$use_boost = xyes; then
+
AX_BOOST_UNIT_TEST_FRAMEWORK
dnl Determine if -DBOOST_TEST_DYN_LINK is needed
@@ -568,8 +605,12 @@ if test x$use_tests = xyes; then
[AC_MSG_RESULT(no)])
LIBS="$TEMP_LIBS"
CPPFLAGS="$TEMP_CPPFLAGS"
+
+ fi
fi
+if test x$use_boost = xyes; then
+
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB"
dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however
@@ -626,25 +667,7 @@ if test x$boost_sleep != xyes; then
AC_MSG_ERROR(No working boost sleep implementation found.)
fi
-AC_ARG_WITH([utils],
- [AS_HELP_STRING([--with-utils],
- [build bitcoin-cli bitcoin-tx (default=yes)])],
- [build_bitcoin_utils=$withval],
- [build_bitcoin_utils=yes])
-
-AC_ARG_WITH([libs],
- [AS_HELP_STRING([--with-libs],
- [build libraries (default=yes)])],
- [build_bitcoin_libs=$withval],
- [build_bitcoin_libs=yes])
-
-AC_ARG_WITH([daemon],
- [AS_HELP_STRING([--with-daemon],
- [build bitcoind daemon (default=yes)])],
- [build_bitcoind=$withval],
- [build_bitcoind=yes])
-
-BITCOIN_QT_INIT
+fi
if test x$use_pkgconfig = xyes; then
@@ -678,6 +701,14 @@ else
fi
fi
+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),)
+CFLAGS="$CFLAGS_TEMP"
+LIBS="$LIBS_TEMP"
+
BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path)
AC_MSG_CHECKING([whether to build bitcoind])
@@ -695,9 +726,6 @@ if test x$build_bitcoin_libs = xyes; then
fi
AC_MSG_RESULT($build_bitcoin_libs)
-dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
-BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])
-
AC_LANG_POP
if test "x$use_ccache" != "xno"; then
@@ -811,7 +839,7 @@ else
AC_MSG_RESULT([no])
fi
-if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then
+if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then
AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests])
fi
diff --git a/src/Makefile.am b/src/Makefile.am
index d6ac6e1277..81b16d1ea9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -37,7 +37,7 @@ $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
# But to build the less dependent modules first, we manually select their order here:
-noinst_LIBRARIES = \
+EXTRA_LIBRARIES = \
crypto/libbitcoin_crypto.a \
libbitcoin_util.a \
libbitcoin_common.a \
@@ -46,7 +46,7 @@ noinst_LIBRARIES = \
libbitcoin_cli.a
if ENABLE_WALLET
BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
-noinst_LIBRARIES += libbitcoin_wallet.a
+EXTRA_LIBRARIES += libbitcoin_wallet.a
endif
if BUILD_BITCOIN_LIBS
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 898337ad6f..5812f9aff0 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -1,5 +1,5 @@
bin_PROGRAMS += qt/bitcoin-qt
-noinst_LIBRARIES += qt/libbitcoinqt.a
+EXTRA_LIBRARIES += qt/libbitcoinqt.a
# bitcoin qt core #
QT_TS = \