From dba27188b75ea4267974a3cbf8f1630b51e468ea Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 12 Sep 2017 14:26:26 +0930 Subject: [PATCH] external/libbacktrace: new external library for backtrace support. Signed-off-by: Rusty Russell --- .gitmodules | 3 +++ external/Makefile | 17 ++++++++++++++--- external/libbacktrace | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) create mode 160000 external/libbacktrace diff --git a/.gitmodules b/.gitmodules index 5168862f9..b9188af1b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "libsodium"] path = external/libsodium url = https://github.com/jedisct1/libsodium.git +[submodule "external/libbacktrace"] + path = external/libbacktrace + url = https://github.com/ianlancetaylor/libbacktrace.git diff --git a/external/Makefile b/external/Makefile index 9da1d3239..0f4a03b24 100644 --- a/external/Makefile +++ b/external/Makefile @@ -8,14 +8,15 @@ 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/libsodium.a external/libjsmn.a external/libbase58.a +EXTERNAL_LIBS := external/libwallycore.a external/libsecp256k1.a external/libsodium.a external/libjsmn.a external/libbase58.a external/libbacktrace.a EXTERNAL_INCLUDE_FLAGS := \ -I external/libsodium/src/libsodium/include \ -I external/libwally-core/include/ \ -I external/libwally-core/src/secp256k1/include/ \ -I external/jsmn/ \ - -I external/libbase58/ + -I external/libbase58/ \ + -I external/libbacktrace EXTERNAL_LDLIBS := -Lexternal $(patsubst lib%.a,-l%,$(notdir $(EXTERNAL_LIBS))) @@ -69,6 +70,16 @@ external/base58.o: $(LIBBASE58_SRC) external/libbase58.a: external/base58.o $(AR) rc $@ $< +external/libbacktrace/backtrace.h: + git submodule update external/libbacktrace/ + [ -f $@ ] || git submodule update --init external/libbacktrace/ + +# Need separate build dir: changes inside submodule make git think it's dirty. +external/libbacktrace.a: external/libbacktrace/backtrace.h + @mkdir external/libbacktrace-build 2>/dev/null || true + cd external/libbacktrace-build && ../libbacktrace/configure CC="$(CC)" --enable-static=yes --enable-shared=no --libdir=`pwd`/.. && $(MAKE) + $(MAKE) -C external/libbacktrace-build install-exec + distclean: external-distclean clean: external-clean @@ -77,7 +88,7 @@ external-clean: external-distclean: make -C external/libsodium distclean || true - make -C external/libbase64 distclean || true + $(RM) -rf external/libbacktrace-build $(RM) external/libsodium.la external/libsodium/src/libsodium/libsodium.la $(RM) external/libwally-core/src/secp256k1/libsecp256k1.la external/libwally-core/src/libwallycore.la cd external/libwally-core && tools/cleanup.sh diff --git a/external/libbacktrace b/external/libbacktrace new file mode 160000 index 000000000..14d377e9b --- /dev/null +++ b/external/libbacktrace @@ -0,0 +1 @@ +Subproject commit 14d377e9be7c89511c472d728e1b88b4e96f1946