rustc: use RUSTC_{HOST,TARGET}_NAME
authorEric Le Bihan <eric.le.bihan.dev@free.fr>
Tue, 13 Feb 2018 07:21:27 +0000 (08:21 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 13 Feb 2018 22:09:47 +0000 (23:09 +0100)
utils/check-package complains as follows:

  package/rustc/rustc.mk:10: possible typo: RUST_TARGET_NAME -> *RUSTC*
  package/rustc/rustc.mk:18: possible typo: RUST_HOST_NAME -> *RUSTC*

As RUST_{HOST,TARGET}_NAME are related to the Rust compiler, it
sounds sensible to rename them to RUSTC_{HOST,TARGET}_NAME.

So update all rust related packages to use the new variables.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
docs/manual/adding-packages-cargo.txt
package/cargo-bin/cargo-bin.mk
package/cargo/cargo.mk
package/cargo/config.in
package/rust-bin/rust-bin.mk
package/rust/rust.mk
package/rustc/rustc.mk

index 3f9ddfed166f6a98318a1108dc9413ff28aa852a..b78163e6a1c74932bb03da087fe88f62a486f3ff 100644 (file)
@@ -49,11 +49,11 @@ package. Let's start with an example:
 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
index 0f235748ffc77e675b1b697d042c14799c8f977d..3c834d9033357b35f5d7d831e4f3a8af50144ea4 100644 (file)
@@ -6,7 +6,7 @@
 
 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
 
index 5625127fcd5af0fa710d4959fbfc2d7c890f9887..3fd088d727bb4d99545ae7fe9d63f5690438d605 100644 (file)
@@ -82,7 +82,7 @@ define HOST_CARGO_INSTALL_CMDS
        $(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
index cc048c71c43d2069f663c995c6d7b0c6130dd755..47fad026be5728aa82253fc14211ef05b597b904 100644 (file)
@@ -1,2 +1,2 @@
-[target.@RUST_TARGET_NAME@]
+[target.@RUSTC_TARGET_NAME@]
 linker = "@CROSS_PREFIX@gcc"
index 5ace7bf08fa3b80ef5a3dc3d480f85ba7de9c5e0..cd5844b11590069baaead950a73e14d81d1d4b52 100644 (file)
@@ -11,13 +11,13 @@ RUST_BIN_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
 
 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
@@ -26,7 +26,7 @@ define HOST_RUST_BIN_LIBSTD_EXTRACT
                        $(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
@@ -42,12 +42,12 @@ define HOST_RUST_BIN_INSTALL_RUSTC
 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
index 6d6ac4370a5f6c5b626cee55d56f3e6665d92d95..ff2634b99605ee87367ec0c317ee984ba3bc0f7e 100644 (file)
@@ -48,7 +48,7 @@ HOST_RUST_POST_EXTRACT_HOOKS += HOST_RUST_EXCLUDE_ORIG_FILES
 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"'; \
@@ -61,7 +61,7 @@ define HOST_RUST_CONFIGURE_CMDS
                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
index 7a951c0cfdf24a2d2492478ac58d62dcb5ae60d4..bed74f3c2c4e9fbec383717058913c5d0bf470bf 100644 (file)
@@ -7,7 +7,7 @@
 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
@@ -15,6 +15,6 @@ else
 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))