Skip to content

Commit c9600ce

Browse files
committed
Merge pull request #4312
fda3fed libsecp256k1 integration (Pieter Wuille) 5566826 secp256k1: Add build-side changes for libsecp256k1 (Cory Fields) b150b09 secp256k1: add libtool as a dependency (Cory Fields)
2 parents e442c82 + fda3fed commit c9600ce

File tree

12 files changed

+159
-14
lines changed

12 files changed

+159
-14
lines changed

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
3535

3636
dist-hook:
3737
-$(MAKE) -C $(top_distdir)/src/leveldb clean
38+
-$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
3839
-$(GIT) archive --format=tar HEAD -- src/version.cpp | $(AMTAR) -C $(top_distdir) -xf -
3940

4041
distcheck-hook:

autogen.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
set -e
33
srcdir="$(dirname $0)"
44
cd "$srcdir"
5+
if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then
6+
export LIBTOOLIZE="${GLIBTOOLIZE}"
7+
fi
58
autoreconf --install --force

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ define(_COPYRIGHT_YEAR, 2014)
99
AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[[email protected]],[bitcoin])
1010
AC_CONFIG_AUX_DIR([src/build-aux])
1111
AC_CONFIG_MACRO_DIR([src/m4])
12+
LT_INIT([disable-shared])
1213
AC_CANONICAL_HOST
1314
AH_TOP([#ifndef BITCOIN_CONFIG_H])
1415
AH_TOP([#define BITCOIN_CONFIG_H])
@@ -679,6 +680,7 @@ AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes])
679680
AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])
680681
AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno])
681682
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
683+
AM_CONDITIONAL([USE_LIBSECP256K1],[test x$use_libsecp256k1 = xyes])
682684

683685
AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
684686
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])

contrib/debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Uploaders: Micah Anderson <[email protected]>
66
Build-Depends: debhelper,
77
devscripts,
88
automake,
9+
libtool,
910
bash-completion,
1011
libboost-system-dev (>> 1.35) | libboost-system1.35-dev,
1112
libdb4.8++-dev,

contrib/gitian-descriptors/gitian-osx-bitcoin.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ packages:
1111
- "bsdmainutils"
1212
- "pkg-config"
1313
- "p7zip-full"
14+
- "libtool"
1415

1516
reference_datetime: "2013-06-01 00:00:00"
1617
remotes:

doc/build-osx.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Instructions: MacPorts
4141

4242
### Install dependencies
4343

44-
sudo port install boost db48@+no_java openssl miniupnpc autoconf pkgconfig automake
44+
sudo port install boost db48@+no_java openssl miniupnpc autoconf pkgconfig automake libtool
4545

4646
Optional: install Qt4
4747

@@ -69,7 +69,7 @@ Instructions: Homebrew
6969

7070
#### Install dependencies using Homebrew
7171

72-
brew install autoconf automake berkeley-db4 boost miniupnpc openssl pkg-config protobuf qt
72+
brew install autoconf automake libtool berkeley-db4 boost miniupnpc openssl pkg-config protobuf qt
7373

7474
Note: After you have installed the dependencies, you should check that the Homebrew installed version of OpenSSL is the one available for compilation. You can check this by typing
7575

src/Makefile.am

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
AM_CPPFLAGS = $(INCLUDES)
22
AM_LDFLAGS = $(PTHREAD_CFLAGS)
33

4+
if USE_LIBSECP256K1
5+
secp256k1/libsecp256k1.la: $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
6+
@$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
7+
endif
48

59
if EMBEDDED_LEVELDB
610
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
@@ -20,6 +24,10 @@ endif
2024
BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
2125
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS)
2226

27+
if USE_LIBSECP256K1
28+
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
29+
endif
30+
2331
LIBBITCOIN_SERVER=libbitcoin_server.a
2432
LIBBITCOIN_WALLET=libbitcoin_wallet.a
2533
LIBBITCOIN_COMMON=libbitcoin_common.a
@@ -220,6 +228,11 @@ bitcoind_LDADD = \
220228
$(LIBBITCOIN_CRYPTO) \
221229
$(LIBLEVELDB) \
222230
$(LIBMEMENV)
231+
232+
if USE_LIBSECP256K1
233+
bitcoind_LDADD += secp256k1/libsecp256k1.la
234+
endif
235+
223236
if ENABLE_WALLET
224237
bitcoind_LDADD += libbitcoin_wallet.a
225238
endif
@@ -242,6 +255,10 @@ bitcoin_cli_LDADD = \
242255
$(BOOST_LIBS)
243256
bitcoin_cli_SOURCES = \
244257
bitcoin-cli.cpp
258+
259+
if USE_LIBSECP256K1
260+
bitcoin_cli_LDADD += secp256k1/libsecp256k1.la
261+
endif
245262
bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
246263
#
247264

@@ -253,10 +270,11 @@ CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
253270

254271
DISTCLEANFILES = obj/build.h
255272

256-
EXTRA_DIST = leveldb
273+
EXTRA_DIST = leveldb secp256k1
257274

258275
clean-local:
259276
-$(MAKE) -C leveldb clean
277+
-$(MAKE) -C secp256k1 clean
260278
rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
261279
-rm -f config.h
262280

src/Makefile.qt.include

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
357357
endif
358358
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) $(LIBMEMENV) \
359359
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS)
360+
if USE_LIBSECP256K1
361+
qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
362+
endif
360363
qt_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS)
361364

362365
#locale/foo.ts -> locale/foo.qm

src/Makefile.qttest.include

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ endif
3333
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) \
3434
$(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
3535
$(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS)
36+
if USE_LIBSECP256K1
37+
qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
38+
endif
3639
qt_test_test_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS)
3740

3841
CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno

src/Makefile.test.include

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_CO
6969
if ENABLE_WALLET
7070
test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
7171
endif
72+
73+
if USE_LIBSECP256K1
74+
test_test_bitcoin_LDADD += secp256k1/libsecp256k1.la
75+
endif
76+
7277
test_test_bitcoin_LDADD += $(BDB_LIBS)
7378

7479
nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)

0 commit comments

Comments
 (0)