Bug 1329737 - part 1 - define a RUST_TARGET_ENV_NAME config variable; r=rillian
authorNathan Froyd <froydnj@mozilla.com>
Fri, 28 Apr 2017 14:06:42 -0400
changeset 355701 acd67da3b84aac3693893726701f88fb4b41743b
parent 355700 2cd1662bcc5bd6cc7b41e9a7666d6e0741e59c43
child 355702 fbbceb56e0d9da91ea3b622f6e7b7fda4b83b4ae
push id31736
push userarchaeopteryx@coole-files.de
push dateSat, 29 Apr 2017 09:10:55 +0000
treeherdermozilla-central@308cdb913d71 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1329737
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1329737 - part 1 - define a RUST_TARGET_ENV_NAME config variable; r=rillian We need this for forming various Cargo environment variables.
build/moz.configure/rust.configure
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -218,12 +218,21 @@ def rust_triple_alias(host_or_target):
     return rust_target
 
 rust_target_triple = rust_triple_alias(target)
 rust_host_triple = rust_triple_alias(host)
 
 set_config('RUST_TARGET', rust_target_triple)
 set_config('RUST_HOST_TARGET', rust_host_triple)
 
+@depends(rust_target_triple)
+def rust_target_env_name(triple):
+    return triple.upper().replace('-','_')
+
+# We need this to form various Cargo environment variables, as there is no
+# uppercase function in make, and we don't want to shell out just for
+# converting a string to uppercase.
+set_config('RUST_TARGET_ENV_NAME', rust_target_env_name)
+
 # Until we remove all the other Rust checks in old-configure.
 add_old_configure_assignment('MOZ_RUST', rust_compiler)
 add_old_configure_assignment('RUSTC', rustc)
 add_old_configure_assignment('RUST_TARGET', rust_target_triple)