about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-10-11 04:26:56 -0700
committerGitHub <noreply@github.com>2016-10-11 04:26:56 -0700
commite33562078ff6027c116cb43abd052e256354ab2f (patch)
treeeb1cca34295931ab43dac7443805fcb228d37da5
parent1e4c8b1a81c0b6efb386c85b44b6abee9b39b20c (diff)
parent19d192920b69118619d18ab7dd66faae1f7b61f9 (diff)
downloadrust-e33562078ff6027c116cb43abd052e256354ab2f.tar.gz
rust-e33562078ff6027c116cb43abd052e256354ab2f.zip
Auto merge of #36983 - alexcrichton:configure-multiple-musl, r=brson
configure: Add options for separate musl roots

This allows using the `./configure` script to enable rustbuild to compile
multiple musl targets at once. We'll hopefully use this soon on our bots to
produce a bunch of targets.
-rwxr-xr-xconfigure15
-rw-r--r--src/bootstrap/config.rs30
2 files changed, 36 insertions, 9 deletions
diff --git a/configure b/configure
index 6cef35beb6d..9e65bc789b4 100755
--- a/configure
+++ b/configure
@@ -653,7 +653,12 @@ valopt arm-linux-androideabi-ndk "" "arm-linux-androideabi NDK standalone path"
 valopt armv7-linux-androideabi-ndk "" "armv7-linux-androideabi NDK standalone path"
 valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
 valopt nacl-cross-path  "" "NaCl SDK path (Pepper Canary is recommended). Must be absolute!"
-valopt musl-root "/usr/local" "MUSL root installation directory"
+valopt musl-root "/usr/local" "MUSL root installation directory (deprecated)"
+valopt musl-root-x86_64 "/usr/local" "x86_64-unknown-linux-musl install directory"
+valopt musl-root-i686 "/usr/local" "i686-unknown-linux-musl install directory"
+valopt musl-root-arm "/usr/local" "arm-unknown-linux-musleabi install directory"
+valopt musl-root-armhf "/usr/local" "arm-unknown-linux-musleabihf install directory"
+valopt musl-root-armv7 "/usr/local" "armv7-unknown-linux-musleabihf install directory"
 valopt extra-filename "" "Additional data that is hashed and passed to the -C extra-filename flag"
 
 if [ -e ${CFG_SRC_DIR}.git ]
@@ -1212,14 +1217,6 @@ do
             fi
             ;;
 
-
-        x86_64-*-musl | arm-*-musleabi)
-            if [ ! -f $CFG_MUSL_ROOT/lib/libc.a ]
-            then
-                err "musl libc $CFG_MUSL_ROOT/lib/libc.a not found"
-            fi
-            ;;
-
         *-msvc)
             # There are three builds of cmake on windows: MSVC, MinGW and Cygwin
             # The Cygwin build does not have generators for Visual Studio, so
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index a0901bde5a5..6158e94875e 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -350,6 +350,36 @@ impl Config {
                 "CFG_MUSL_ROOT" if value.len() > 0 => {
                     self.musl_root = Some(PathBuf::from(value));
                 }
+                "CFG_MUSL_ROOT_X86_64" if value.len() > 0 => {
+                    let target = "x86_64-unknown-linux-musl".to_string();
+                    let target = self.target_config.entry(target)
+                                     .or_insert(Target::default());
+                    target.musl_root = Some(PathBuf::from(value));
+                }
+                "CFG_MUSL_ROOT_I686" if value.len() > 0 => {
+                    let target = "i686-unknown-linux-musl".to_string();
+                    let target = self.target_config.entry(target)
+                                     .or_insert(Target::default());
+                    target.musl_root = Some(PathBuf::from(value));
+                }
+                "CFG_MUSL_ROOT_ARM" if value.len() > 0 => {
+                    let target = "arm-unknown-linux-musleabi".to_string();
+                    let target = self.target_config.entry(target)
+                                     .or_insert(Target::default());
+                    target.musl_root = Some(PathBuf::from(value));
+                }
+                "CFG_MUSL_ROOT_ARMHF" if value.len() > 0 => {
+                    let target = "arm-unknown-linux-musleabihf".to_string();
+                    let target = self.target_config.entry(target)
+                                     .or_insert(Target::default());
+                    target.musl_root = Some(PathBuf::from(value));
+                }
+                "CFG_MUSL_ROOT_ARMV7" if value.len() > 0 => {
+                    let target = "armv7-unknown-linux-musleabihf".to_string();
+                    let target = self.target_config.entry(target)
+                                     .or_insert(Target::default());
+                    target.musl_root = Some(PathBuf::from(value));
+                }
                 "CFG_DEFAULT_AR" if value.len() > 0 => {
                     self.rustc_default_ar = Some(value.to_string());
                 }