]> git.lizzy.rs Git - rust.git/commitdiff
rustc_back: add configure options for default linker and ar
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Mon, 10 Aug 2015 23:09:21 +0000 (01:09 +0200)
committerMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Wed, 19 Aug 2015 16:06:34 +0000 (18:06 +0200)
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
configure
mk/target.mk
src/librustc_back/target/mod.rs

index 071788cf79f4c20ca8e23276c09f3a76979d75fb..dc9d7d75310c6b795d87259eb40c4f8637456860 100755 (executable)
--- a/configure
+++ b/configure
@@ -607,6 +607,10 @@ valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
 valopt release-channel "dev" "the name of the release channel to build"
 valopt musl-root "/usr/local" "MUSL root installation directory"
 
+# Used on systems where "cc" and "ar" are unavailable
+valopt default-linker "cc" "the default linker"
+valopt default-ar     "ar" "the default ar"
+
 # Many of these are saved below during the "writing configuration" step
 # (others are conditionally saved).
 opt_nosave manage-submodules 1 "let the build manage the git submodules"
index aae66c45b57e3c2fbb9074de39b7749ecc79c1dc..408ab966908216390eebdec66c5cc43affe2c649 100644 (file)
 # this exists can be found on issue #2400
 export CFG_COMPILER_HOST_TRIPLE
 
+# Used as defaults for the runtime ar and cc tools
+export CFG_DEFAULT_LINKER
+export CFG_DEFAULT_AR
+
 # The standard libraries should be held up to a higher standard than any old
 # code, make sure that these common warnings are denied by default. These can
 # be overridden during development temporarily. For stage0, we allow warnings
index d9cfdaacc905957532d7fa7e4ead7b46648556aa..542791ae90474ce0634fe1d7badfdc688f657253 100644 (file)
@@ -185,8 +185,8 @@ impl Default for TargetOptions {
     fn default() -> TargetOptions {
         TargetOptions {
             data_layout: String::new(),
-            linker: "cc".to_string(),
-            ar: "ar".to_string(),
+            linker: option_env!("CFG_DEFAULT_LINKER").unwrap_or("cc").to_string(),
+            ar: option_env!("CFG_DEFAULT_AR").unwrap_or("ar").to_string(),
             pre_link_args: Vec::new(),
             post_link_args: Vec::new(),
             cpu: "generic".to_string(),