build: fix automake warnings about the use of INCLUDES
While we're at it, reduce the use of LIBS as well. This makes dependencies explicit. Fixes building with (the not-yet-merged) libsecp256k1 as well. Github-Pull: #4689 Rebased-By: Wladimir J. van der laan <laanwj@gmail.com> Rebased-From: 909b347 c0e5dda
This commit is contained in:
parent
7accb7dbad
commit
6b099402b4
11
configure.ac
11
configure.ac
@ -304,7 +304,6 @@ AC_C_BIGENDIAN([AC_MSG_ERROR("Big Endian not supported")])
|
|||||||
|
|
||||||
dnl Check for pthread compile/link requirements
|
dnl Check for pthread compile/link requirements
|
||||||
AX_PTHREAD
|
AX_PTHREAD
|
||||||
INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
|
|
||||||
|
|
||||||
# The following macro will add the necessary defines to bitcoin-config.h, but
|
# The following macro will add the necessary defines to bitcoin-config.h, but
|
||||||
# they also need to be passed down to any subprojects. Pull the results out of
|
# they also need to be passed down to any subprojects. Pull the results out of
|
||||||
@ -456,7 +455,6 @@ if test x$use_tests = xyes; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB"
|
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB"
|
||||||
BOOST_INCLUDES="$BOOST_CPPFLAGS"
|
|
||||||
|
|
||||||
dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however
|
dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however
|
||||||
dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if
|
dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if
|
||||||
@ -536,8 +534,8 @@ if test x$use_pkgconfig = xyes; then
|
|||||||
m4_ifdef(
|
m4_ifdef(
|
||||||
[PKG_CHECK_MODULES],
|
[PKG_CHECK_MODULES],
|
||||||
[
|
[
|
||||||
PKG_CHECK_MODULES([SSL], [libssl], [INCLUDES="$INCLUDES $SSL_CFLAGS"; LIBS="$LIBS $SSL_LIBS"], [AC_MSG_ERROR(openssl not found.)])
|
PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)])
|
||||||
PKG_CHECK_MODULES([CRYPTO], [libcrypto], [INCLUDES="$INCLUDES $CRYPTO_CFLAGS"; LIBS="$LIBS $CRYPTO_LIBS"], [AC_MSG_ERROR(libcrypto not found.)])
|
PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
|
||||||
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])])
|
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])])
|
||||||
if test x$use_qr != xno; then
|
if test x$use_qr != xno; then
|
||||||
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
|
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
|
||||||
@ -546,10 +544,10 @@ if test x$use_pkgconfig = xyes; then
|
|||||||
)
|
)
|
||||||
else
|
else
|
||||||
AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
|
AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
|
||||||
AC_CHECK_LIB([crypto], [main],, AC_MSG_ERROR(libcrypto missing))
|
AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
|
||||||
|
|
||||||
AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
|
AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
|
||||||
AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR(libssl missing))
|
AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing))
|
||||||
|
|
||||||
BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],,BITCOIN_QT_FAIL(libprotobuf not found)))
|
BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],,BITCOIN_QT_FAIL(libprotobuf not found)))
|
||||||
if test x$use_qr != xno; then
|
if test x$use_qr != xno; then
|
||||||
@ -709,7 +707,6 @@ AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)
|
|||||||
AC_SUBST(LIBTOOL_LDFLAGS)
|
AC_SUBST(LIBTOOL_LDFLAGS)
|
||||||
AC_SUBST(USE_UPNP)
|
AC_SUBST(USE_UPNP)
|
||||||
AC_SUBST(USE_QRCODE)
|
AC_SUBST(USE_QRCODE)
|
||||||
AC_SUBST(INCLUDES)
|
|
||||||
AC_SUBST(BOOST_LIBS)
|
AC_SUBST(BOOST_LIBS)
|
||||||
AC_SUBST(TESTDEFS)
|
AC_SUBST(TESTDEFS)
|
||||||
AC_SUBST(LEVELDB_TARGET_FLAGS)
|
AC_SUBST(LEVELDB_TARGET_FLAGS)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
AM_CPPFLAGS = $(INCLUDES)
|
|
||||||
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
|
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
|
||||||
|
|
||||||
if USE_LIBSECP256K1
|
if USE_LIBSECP256K1
|
||||||
@ -22,7 +21,7 @@ $(LIBLEVELDB) $(LIBMEMENV):
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
|
BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
|
||||||
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS)
|
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
|
||||||
|
|
||||||
if USE_LIBSECP256K1
|
if USE_LIBSECP256K1
|
||||||
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
|
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
|
||||||
@ -261,7 +260,7 @@ if TARGET_WINDOWS
|
|||||||
bitcoind_SOURCES += bitcoind-res.rc
|
bitcoind_SOURCES += bitcoind-res.rc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS)
|
bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
|
||||||
bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
|
bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
|
||||||
|
|
||||||
# bitcoin-cli binary #
|
# bitcoin-cli binary #
|
||||||
@ -270,7 +269,10 @@ bitcoin_cli_LDADD = \
|
|||||||
$(LIBBITCOIN_COMMON) \
|
$(LIBBITCOIN_COMMON) \
|
||||||
$(LIBBITCOIN_UTIL) \
|
$(LIBBITCOIN_UTIL) \
|
||||||
$(LIBBITCOIN_CRYPTO) \
|
$(LIBBITCOIN_CRYPTO) \
|
||||||
$(BOOST_LIBS)
|
$(BOOST_LIBS) \
|
||||||
|
$(SSL_LIBS) \
|
||||||
|
$(CRYPTO_LIBS)
|
||||||
|
|
||||||
bitcoin_cli_SOURCES = \
|
bitcoin_cli_SOURCES = \
|
||||||
bitcoin-cli.cpp
|
bitcoin-cli.cpp
|
||||||
|
|
||||||
@ -285,8 +287,15 @@ bitcoin_tx_LDADD = \
|
|||||||
$(LIBBITCOIN_UNIVALUE) \
|
$(LIBBITCOIN_UNIVALUE) \
|
||||||
$(LIBBITCOIN_COMMON) \
|
$(LIBBITCOIN_COMMON) \
|
||||||
$(LIBBITCOIN_UTIL) \
|
$(LIBBITCOIN_UTIL) \
|
||||||
$(LIBBITCOIN_CRYPTO) \
|
$(LIBBITCOIN_CRYPTO)
|
||||||
$(BOOST_LIBS)
|
|
||||||
|
if USE_LIBSECP256K1
|
||||||
|
bitcoin_tx_LDADD += secp256k1/libsecp256k1.la
|
||||||
|
endif
|
||||||
|
|
||||||
|
bitcoin_tx_LDADD += $(BOOST_LIBS) \
|
||||||
|
$(SSL_LIBS) \
|
||||||
|
$(CRYPTO_LIBS)
|
||||||
bitcoin_tx_SOURCES = bitcoin-tx.cpp
|
bitcoin_tx_SOURCES = bitcoin-tx.cpp
|
||||||
bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
|
bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
|
||||||
#
|
#
|
||||||
|
@ -358,7 +358,7 @@ if ENABLE_WALLET
|
|||||||
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
|
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
|
||||||
endif
|
endif
|
||||||
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
|
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
|
||||||
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS)
|
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
|
||||||
if USE_LIBSECP256K1
|
if USE_LIBSECP256K1
|
||||||
qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
|
qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
|
||||||
endif
|
endif
|
||||||
|
@ -32,7 +32,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
|
|||||||
endif
|
endif
|
||||||
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \
|
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \
|
||||||
$(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
|
$(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
|
||||||
$(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS)
|
$(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
|
||||||
if USE_LIBSECP256K1
|
if USE_LIBSECP256K1
|
||||||
qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
|
qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
|
||||||
endif
|
endif
|
||||||
|
@ -74,7 +74,7 @@ if USE_LIBSECP256K1
|
|||||||
test_test_bitcoin_LDADD += secp256k1/libsecp256k1.la
|
test_test_bitcoin_LDADD += secp256k1/libsecp256k1.la
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test_test_bitcoin_LDADD += $(BDB_LIBS)
|
test_test_bitcoin_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
|
||||||
|
|
||||||
nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
|
nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user