15: FOO_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
16: FOO_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
17:
-18: FOO_BIN_DIR = target/$(RUST_TARGET_NAME)/$(FOO_CARGO_MODE)
+18: FOO_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(FOO_CARGO_MODE)
19:
20: FOO_CARGO_OPTS = \
21: --$(FOO_CARGO_MODE) \
-22: --target=$(RUST_TARGET_NAME) \
+22: --target=$(RUSTC_TARGET_NAME) \
23: --manifest-path=$(@D)/Cargo.toml
24:
25: define FOO_BUILD_CMDS
CARGO_BIN_VERSION = 0.24.0
CARGO_BIN_SITE = https://static.rust-lang.org/dist
-CARGO_BIN_SOURCE = cargo-$(CARGO_BIN_VERSION)-$(RUST_HOST_NAME).tar.xz
+CARGO_BIN_SOURCE = cargo-$(CARGO_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz
CARGO_BIN_LICENSE = Apache-2.0 or MIT
CARGO_BIN_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
$(INSTALL) -D -m 0755 $(@D)/target/release/cargo $(HOST_DIR)/bin/cargo
$(INSTALL) -D package/cargo/config.in \
$(HOST_DIR)/share/cargo/config
- $(SED) 's/@RUST_TARGET_NAME@/$(RUST_TARGET_NAME)/' \
+ $(SED) 's/@RUSTC_TARGET_NAME@/$(RUSTC_TARGET_NAME)/' \
$(HOST_DIR)/share/cargo/config
$(SED) 's/@CROSS_PREFIX@/$(notdir $(TARGET_CROSS))/' \
$(HOST_DIR)/share/cargo/config
-[target.@RUST_TARGET_NAME@]
+[target.@RUSTC_TARGET_NAME@]
linker = "@CROSS_PREFIX@gcc"
HOST_RUST_BIN_PROVIDES = host-rustc
-HOST_RUST_BIN_SOURCE = rustc-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME).tar.xz
+HOST_RUST_BIN_SOURCE = rustc-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz
HOST_RUST_BIN_EXTRA_DOWNLOADS = \
- rust-std-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME).tar.xz \
- rust-std-$(RUST_BIN_VERSION)-$(RUST_TARGET_NAME).tar.xz
+ rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz \
+ rust-std-$(RUST_BIN_VERSION)-$(RUSTC_TARGET_NAME).tar.xz
-HOST_RUST_BIN_LIBSTD_HOST_PREFIX = rust-std-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME)/rust-std-$(RUST_HOST_NAME)
+HOST_RUST_BIN_LIBSTD_HOST_PREFIX = rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME)/rust-std-$(RUSTC_HOST_NAME)
define HOST_RUST_BIN_LIBSTD_EXTRACT
mkdir -p $(@D)/std
$(TAR) -C $(@D)/std $(TAR_OPTIONS) -
)
cd $(@D)/rustc/lib/rustlib; \
- ln -sf ../../../std/$(HOST_RUST_BIN_LIBSTD_HOST_PREFIX)/lib/rustlib/$(RUST_HOST_NAME)
+ ln -sf ../../../std/$(HOST_RUST_BIN_LIBSTD_HOST_PREFIX)/lib/rustlib/$(RUSTC_HOST_NAME)
endef
HOST_RUST_BIN_POST_EXTRACT_HOOKS += HOST_RUST_BIN_LIBSTD_EXTRACT
endef
define HOST_RUST_BIN_INSTALL_LIBSTD_HOST
- (cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME); \
+ (cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME); \
./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
endef
define HOST_RUST_BIN_INSTALL_LIBSTD_TARGET
- (cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUST_TARGET_NAME); \
+ (cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUSTC_TARGET_NAME); \
./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
endef
endif
define HOST_RUST_CONFIGURE_CMDS
( \
echo '[build]'; \
- echo 'target = ["$(RUST_TARGET_NAME)"]'; \
+ echo 'target = ["$(RUSTC_TARGET_NAME)"]'; \
echo 'cargo = "$(HOST_CARGO_BIN_DIR)/cargo/bin/cargo"'; \
echo 'rustc = "$(HOST_RUST_BIN_DIR)/rustc/bin/rustc"'; \
echo 'python = "$(HOST_DIR)/bin/python2"'; \
echo 'prefix = "$(HOST_DIR)"'; \
echo '[rust]'; \
echo 'use-jemalloc = $(HOST_RUST_JEMALLOC_ENABLED)'; \
- echo '[target.$(RUST_TARGET_NAME)]'; \
+ echo '[target.$(RUSTC_TARGET_NAME)]'; \
echo 'cc = "$(TARGET_CROSS)gcc"'; \
echo $(HOST_RUST_JEMALLOC_CONF); \
) > $(@D)/config.toml
RUSTC_ARCH = $(call qstrip,$(BR2_PACKAGE_HOST_RUSTC_ARCH))
RUSTC_ABI = $(call qstrip,$(BR2_PACKAGE_HOST_RUSTC_ABI))
-RUST_TARGET_NAME = $(RUSTC_ARCH)-unknown-linux-gnu$(RUSTC_ABI)
+RUSTC_TARGET_NAME = $(RUSTC_ARCH)-unknown-linux-gnu$(RUSTC_ABI)
ifeq ($(HOSTARCH),x86)
RUSTC_HOST_ARCH = i686
RUSTC_HOST_ARCH = $(HOSTARCH)
endif
-RUST_HOST_NAME = $(RUSTC_HOST_ARCH)-unknown-linux-gnu
+RUSTC_HOST_NAME = $(RUSTC_HOST_ARCH)-unknown-linux-gnu
$(eval $(host-virtual-package))