Fix Rust static library linking for Windows builds
The library renaming step is necessary because the naming convention used by rustc does not match the naming convention for libtool/MinGW.
This commit is contained in:
parent
a04acde970
commit
684e62e903
|
@ -821,6 +821,7 @@ fi
|
||||||
RUST_LIBS=""
|
RUST_LIBS=""
|
||||||
case $host in
|
case $host in
|
||||||
*mingw*)
|
*mingw*)
|
||||||
|
RUST_LIBS="$RUST_LIBS -luserenv"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
RUST_LIBS="$RUST_LIBS -ldl"
|
RUST_LIBS="$RUST_LIBS -ldl"
|
||||||
|
|
|
@ -38,11 +38,7 @@ LIBBITCOIN_COMMON=libbitcoin_common.a
|
||||||
LIBBITCOIN_CLI=libbitcoin_cli.a
|
LIBBITCOIN_CLI=libbitcoin_cli.a
|
||||||
LIBBITCOIN_UTIL=libbitcoin_util.a
|
LIBBITCOIN_UTIL=libbitcoin_util.a
|
||||||
LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
|
LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
|
||||||
if TARGET_WINDOWS
|
|
||||||
LIBRUSTZCASH=$(top_builddir)/target/$(RUST_TARGET)/release/rustzcash.lib
|
|
||||||
else
|
|
||||||
LIBRUSTZCASH=$(top_builddir)/target/$(RUST_TARGET)/release/librustzcash.a
|
LIBRUSTZCASH=$(top_builddir)/target/$(RUST_TARGET)/release/librustzcash.a
|
||||||
endif
|
|
||||||
LIBSECP256K1=secp256k1/libsecp256k1.la
|
LIBSECP256K1=secp256k1/libsecp256k1.la
|
||||||
LIBUNIVALUE=univalue/libunivalue.la
|
LIBUNIVALUE=univalue/libunivalue.la
|
||||||
LIBZCASH=libzcash.a
|
LIBZCASH=libzcash.a
|
||||||
|
@ -85,7 +81,19 @@ endif
|
||||||
cargo-build: $(CARGO_CONFIGURED)
|
cargo-build: $(CARGO_CONFIGURED)
|
||||||
$(RUST_ENV_VARS) $(CARGO) build $(RUST_BUILD_OPTS) --manifest-path $(top_srcdir)/Cargo.toml
|
$(RUST_ENV_VARS) $(CARGO) build $(RUST_BUILD_OPTS) --manifest-path $(top_srcdir)/Cargo.toml
|
||||||
|
|
||||||
|
if TARGET_WINDOWS
|
||||||
|
LIBRUSTZCASH_WIN=$(top_builddir)/target/$(RUST_TARGET)/release/rustzcash.lib
|
||||||
|
|
||||||
|
$(LIBRUSTZCASH_WIN): cargo-build
|
||||||
|
|
||||||
|
# This ensures that the Rust library is correctly linked in by libtool.
|
||||||
|
# See https://github.com/rust-lang/rust/issues/69904 for the underlying cause.
|
||||||
|
$(LIBRUSTZCASH): $(LIBRUSTZCASH_WIN)
|
||||||
|
$(AM_V_at)cp $< $@
|
||||||
|
|
||||||
|
else
|
||||||
$(LIBRUSTZCASH): cargo-build
|
$(LIBRUSTZCASH): cargo-build
|
||||||
|
endif
|
||||||
|
|
||||||
$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
|
$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
|
||||||
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
|
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
|
||||||
|
|
Loading…
Reference in New Issue