From f8ca805422db8ff5c5112526db0794603b259577 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sun, 12 Feb 2017 11:27:39 -0800 Subject: configure: Remove --build detection This commit removes detection of CFG_OSTYPE and CFG_CPUTYPE from the configure script, which means that the default value of `--build` is no longer present in the configure script. All this logic is now available in rustbuild itself, so there's no need to duplicate it. --- src/bootstrap/bootstrap.py | 23 +++++++++++++++++++---- src/bootstrap/config.rs | 15 +++++++-------- 2 files changed, 26 insertions(+), 12 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 4f41d337592..b326f95e505 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -296,8 +296,10 @@ class RustBuild(object): def get_mk(self, key): for line in iter(self.config_mk.splitlines()): - if line.startswith(key): - return line[line.find(':=') + 2:].strip() + if line.startswith(key + ' '): + var = line[line.find(':=') + 2:].strip() + if var != '': + return var return None def cargo(self): @@ -438,6 +440,8 @@ class RustBuild(object): sys.exit(err) elif ostype == 'Darwin': ostype = 'apple-darwin' + elif ostype == 'Haiku': + ostype = 'unknown-haiku' elif ostype.startswith('MINGW'): # msys' `uname` does not print gcc configuration, but prints msys # configuration. so we cannot believe `uname -m`: @@ -465,9 +469,12 @@ class RustBuild(object): cputype = 'i686' elif cputype in {'xscale', 'arm'}: cputype = 'arm' - elif cputype in {'armv7l', 'armv8l'}: + elif cputype in {'armv6l', 'armv7l', 'armv8l'}: cputype = 'arm' ostype += 'eabihf' + elif cputype == 'armv7l': + cputype = 'armv7' + ostype += 'eabihf' elif cputype == 'aarch64': cputype = 'aarch64' elif cputype == 'arm64': @@ -488,12 +495,20 @@ class RustBuild(object): raise ValueError('unknown byteorder: ' + sys.byteorder) # only the n64 ABI is supported, indicate it ostype += 'abi64' - elif cputype in {'powerpc', 'ppc', 'ppc64'}: + elif cputype in {'powerpc', 'ppc'}: cputype = 'powerpc' + elif cputype in {'powerpc64', 'ppc64'}: + cputype = 'powerpc64' + elif cputype in {'powerpc64le', 'ppc64le'}: + cputype = 'powerpc64le' elif cputype == 'sparcv9': pass elif cputype in {'amd64', 'x86_64', 'x86-64', 'x64'}: cputype = 'x86_64' + elif cputype == 's390x': + cputype = 's390x' + elif cputype == 'BePC': + cputype = 'i686' else: err = "unknown cpu type: " + cputype if self.verbose: diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 87c35e0502c..431d4a333d3 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -463,14 +463,13 @@ impl Config { } match key { - "CFG_BUILD" => self.build = value.to_string(), - "CFG_HOST" => { - self.host = value.split(" ").map(|s| s.to_string()) - .collect(); - } - "CFG_TARGET" => { - self.target = value.split(" ").map(|s| s.to_string()) - .collect(); + "CFG_BUILD" if value.len() > 0 => self.build = value.to_string(), + "CFG_HOST" if value.len() > 0 => { + self.host.extend(value.split(" ").map(|s| s.to_string())); + + } + "CFG_TARGET" if value.len() > 0 => { + self.target.extend(value.split(" ").map(|s| s.to_string())); } "CFG_MUSL_ROOT" if value.len() > 0 => { self.musl_root = Some(parse_configure_path(value)); -- cgit 1.4.1-3-g733a5