Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ This will allow you to properly configure
the build for the target device environment.
Build with:

BUILD=x86_64 MAKE_HOST=arm-linux-androideabi \
CROSS_BUILD=x86_64 CROSS_HOST=arm-linux-androideabi \
make PIE=1 DEVELOPER=0 \
CONFIGURATOR_CC="arm-linux-androideabi-clang -static"

Expand All @@ -257,13 +257,13 @@ Depending on your toolchain location and target arch, source env variables will
Install the `qemu-user` package. This will allow you to properly configure the build for the target device environment. Then, build with the following commands. (A 64-bit build system is assumed here.)

make CC=gcc clean ccan/tools/configurator/configurator
BUILD=x86_64 MAKE_HOST=arm-linux-gnueabihf make PIE=1 DEVELOPER=0 CONFIGURATOR_CC="arm-linux-gnueabihf-gcc -static" LDFLAGS="-L/path/to/gmp-and-sqlite/lib" CFLAGS="-std=gnu11 -I /path/to/gmp-and-sqlite/include -I . -I ccan -I external/libwally-core/src/secp256k1/include -I external/libsodium/src/libsodium/include -I external/jsmn -I external/libwally-core/include -I external/libbacktrace -I external/libbase58"
CROSS_BUILD=x86_64 CROSS_HOST=arm-linux-gnueabihf make PIE=1 DEVELOPER=0 CONFIGURATOR_CC="arm-linux-gnueabihf-gcc -static" LDFLAGS="-L/path/to/gmp-and-sqlite/lib" CFLAGS="-std=gnu11 -I /path/to/gmp-and-sqlite/include -I . -I ccan -I external/libwally-core/src/secp256k1/include -I external/libsodium/src/libsodium/include -I external/jsmn -I external/libwally-core/include -I external/libbacktrace -I external/libbase58"

The compilation will eventually fail due to a compile error in the `cdump` CCAN module. Recompile the module, and then re-run the make system.

make clean -C ccan/ccan/cdump/tools
make CC=gcc -C ccan/ccan/cdump/tools
BUILD=x86_64 MAKE_HOST=arm-linux-gnueabihf make PIE=1 DEVELOPER=0 CONFIGURATOR_CC="arm-linux-gnueabihf-gcc -static" LDFLAGS="-L/path/to/gmp-and-sqlite/lib" CFLAGS="-std=gnu11 -I /path/to/gmp-and-sqlite/include -I . -I ccan -I external/libwally-core/src/secp256k1/include -I external/libsodium/src/libsodium/include -I external/jsmn -I external/libwally-core/include -I external/libbacktrace -I external/libbase58"
CROSS_BUILD=x86_64 CROSS_HOST=arm-linux-gnueabihf make PIE=1 DEVELOPER=0 CONFIGURATOR_CC="arm-linux-gnueabihf-gcc -static" LDFLAGS="-L/path/to/gmp-and-sqlite/lib" CFLAGS="-std=gnu11 -I /path/to/gmp-and-sqlite/include -I . -I ccan -I external/libwally-core/src/secp256k1/include -I external/libsodium/src/libsodium/include -I external/jsmn -I external/libwally-core/include -I external/libbacktrace -I external/libbase58"

Additional steps
--------------------
Expand Down
6 changes: 3 additions & 3 deletions external/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ external/libsodium.a: external/libsodium/src/libsodium/libsodium.la
external/libsodium/src/libsodium/include/sodium.h: submodcheck-libsodium

external/libsodium/src/libsodium/libsodium.la: external/libsodium/src/libsodium/include/sodium.h
cd external/libsodium && ./autogen.sh && ./configure CC="$(CC)" --enable-static=yes --host="$(MAKE_HOST)" --build="$(BUILD)" --enable-shared=no --enable-tests=no --prefix=/ --libdir=/ && $(MAKE)
cd external/libsodium && ./autogen.sh && ./configure CC="$(CC)" --enable-static=yes --host="$(CROSS_HOST)" --build="$(CROSS_BUILD)" --enable-shared=no --enable-tests=no --prefix=/ --libdir=/ && $(MAKE)

$(LIBWALLY_HEADERS) $(LIBSECP_HEADERS): submodcheck-libwally-core

Expand All @@ -42,7 +42,7 @@ external/libsecp256k1.% external/libwallycore.%: external/libwally-core/src/secp
$(MAKE) -C external/libwally-core DESTDIR=$$(pwd)/external install-exec

external/libwally-core/src/libwallycore.% external/libwally-core/src/secp256k1/libsecp256k1.%: $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS)
cd external/libwally-core && ./tools/autogen.sh && ./configure CC="$(CC)" --enable-static=yes --host="$(MAKE_HOST)" --build="$(BUILD)" --enable-module-recovery --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)
cd external/libwally-core && ./tools/autogen.sh && ./configure CC="$(CC)" --enable-static=yes --host="$(CROSS_HOST)" --build="$(CROSS_BUILD)" --enable-module-recovery --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)

external/jsmn/jsmn.h: submodcheck-jsmn

Expand Down Expand Up @@ -75,7 +75,7 @@ external/libbacktrace/backtrace.h: submodcheck-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 --host="$(MAKE_HOST)" --build="$(BUILD)" --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)
cd external/libbacktrace-build && ../libbacktrace/configure CC="$(CC)" --enable-static=yes --host="$(CROSS_HOST)" --build="$(CROSS_BUILD)" --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)
$(MAKE) -C external/libbacktrace-build DESTDIR=$$(pwd)/external install-exec

distclean: external-distclean
Expand Down