diff --git a/CHANGELOG.md b/CHANGELOG.md index 7219e625e..624853ab0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - JSON API: `listpeers` now includes `funding_allocation_msat`, which returns a map of the amounts initially funded to the channel by each peer, indexed by channel id. - `option_data_loss_protect` is now enabled by default. - JSON API: `help` with a `command` argument gives a JSON array, like other commands. +- build: we'll use the system libbase58 and libsodium if found suitable. ### Deprecated diff --git a/configure b/configure index 385413855..c30c3dc70 100755 --- a/configure +++ b/configure @@ -171,6 +171,20 @@ int main(void) exit(0); } /*END*/ +var=HAVE_SYSTEM_LIBBASE58 +desc=libbase58 +style=DEFINES_EVERYTHING|EXECUTE|MAY_NOT_COMPILE +link=-lbase58 +code= +#include +#include + +int main(void) +{ + printf("%p\n", b58check); + exit(0); +} +/*END*/ EOF mv $CONFIG_VAR_FILE.$$ $CONFIG_VAR_FILE diff --git a/doc/INSTALL.md b/doc/INSTALL.md index 29014ff89..2457182f6 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -36,7 +36,8 @@ Get dependencies: sudo apt-get update sudo apt-get install -y \ autoconf automake build-essential git libtool libgmp-dev \ - libsqlite3-dev python python3 net-tools zlib1g-dev libsodium + libsqlite3-dev python python3 net-tools zlib1g-dev libsodium \ + libbase58-dev If you don't have Bitcoin installed locally you'll need to install that as well: diff --git a/external/Makefile b/external/Makefile index ccaf7d3fb..816b95fb1 100644 --- a/external/Makefile +++ b/external/Makefile @@ -15,13 +15,12 @@ JSMN_HEADERS := external/jsmn/jsmn.h LIBBASE58_HEADERS := external/libbase58/libbase58.h EXTERNAL_HEADERS := $(LIBSODIUM_HEADERS) $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS) $(JSMN_HEADERS) $(LIBBASE58_HEADERS) -EXTERNAL_LIBS := external/libwallycore.a external/libsecp256k1.a external/libjsmn.a external/libbase58.a external/libbacktrace.a +EXTERNAL_LIBS := external/libwallycore.a external/libsecp256k1.a external/libjsmn.a external/libbacktrace.a EXTERNAL_INCLUDE_FLAGS := \ -I external/libwally-core/include/ \ -I external/libwally-core/src/secp256k1/include/ \ -I external/jsmn/ \ - -I external/libbase58/ \ -I external/libbacktrace/ \ -I external/libbacktrace-build @@ -32,6 +31,13 @@ else LDLIBS += -lsodium endif +ifneq ($(HAVE_SYSTEM_LIBBASE58),1) +EXTERNAL_INCLUDE_FLAGS += -I external/libbase58/ +EXTERNAL_LIBS += external/libbase58.a +else +LDLIBS += -lbase58 +endif + EXTERNAL_LDLIBS := -Lexternal $(patsubst lib%.a,-l%,$(notdir $(EXTERNAL_LIBS))) submodcheck: FORCE