mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
detecting nodejs in configure
This commit is contained in:
parent
79644ac3c4
commit
0adcf46cdf
4
configure
vendored
4
configure
vendored
@ -634,6 +634,7 @@ valopt datadir "${CFG_PREFIX}/share" "install data"
|
|||||||
valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
|
valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
|
||||||
valopt llvm-root "" "set LLVM root"
|
valopt llvm-root "" "set LLVM root"
|
||||||
valopt python "" "set path to python"
|
valopt python "" "set path to python"
|
||||||
|
valopt nodejs "" "set path to nodejs"
|
||||||
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
|
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
|
||||||
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
|
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
|
||||||
valopt android-cross-path "" "Android NDK standalone path (deprecated)"
|
valopt android-cross-path "" "Android NDK standalone path (deprecated)"
|
||||||
@ -749,6 +750,9 @@ if [ $(echo $python_version | grep -c '^Python 2\.7') -ne 1 ]; then
|
|||||||
err "Found $python_version, but Python 2.7 is required"
|
err "Found $python_version, but Python 2.7 is required"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Checking for node, but not required
|
||||||
|
probe CFG_NODEJS nodejs node
|
||||||
|
|
||||||
# If we have no git directory then we are probably a tarball distribution
|
# If we have no git directory then we are probably a tarball distribution
|
||||||
# and shouldn't attempt to load submodules
|
# and shouldn't attempt to load submodules
|
||||||
if [ ! -e ${CFG_SRC_DIR}.git ]
|
if [ ! -e ${CFG_SRC_DIR}.git ]
|
||||||
|
@ -236,15 +236,6 @@ class RustBuild:
|
|||||||
return config + '/bin/rustc' + self.exe_suffix()
|
return config + '/bin/rustc' + self.exe_suffix()
|
||||||
return os.path.join(self.bin_root(), "bin/rustc" + self.exe_suffix())
|
return os.path.join(self.bin_root(), "bin/rustc" + self.exe_suffix())
|
||||||
|
|
||||||
def nodejs(self):
|
|
||||||
config = self.get_toml('nodejs')
|
|
||||||
if config:
|
|
||||||
return config
|
|
||||||
if os.path.exists(os.path.join(self.bin_root(), "bin/nodejs")):
|
|
||||||
return os.path.join(self.bin_root(), "bin/nodejs" + self.exe_suffix())
|
|
||||||
elif os.path.exists(os.path.join(self.bin_root(), "bin/node")):
|
|
||||||
return os.path.join(self.bin_root(), "bin/node" + self.exe_suffix())
|
|
||||||
|
|
||||||
def get_string(self, line):
|
def get_string(self, line):
|
||||||
start = line.find('"')
|
start = line.find('"')
|
||||||
end = start + 1 + line[start+1:].find('"')
|
end = start + 1 + line[start+1:].find('"')
|
||||||
|
@ -67,7 +67,6 @@ pub struct Config {
|
|||||||
pub target: Vec<String>,
|
pub target: Vec<String>,
|
||||||
pub rustc: Option<PathBuf>,
|
pub rustc: Option<PathBuf>,
|
||||||
pub cargo: Option<PathBuf>,
|
pub cargo: Option<PathBuf>,
|
||||||
pub nodejs: Option<PathBuf>,
|
|
||||||
pub local_rebuild: bool,
|
pub local_rebuild: bool,
|
||||||
|
|
||||||
// libstd features
|
// libstd features
|
||||||
@ -112,7 +111,6 @@ struct Build {
|
|||||||
host: Vec<String>,
|
host: Vec<String>,
|
||||||
target: Vec<String>,
|
target: Vec<String>,
|
||||||
cargo: Option<String>,
|
cargo: Option<String>,
|
||||||
nodejs: Option<String>,
|
|
||||||
rustc: Option<String>,
|
rustc: Option<String>,
|
||||||
compiler_docs: Option<bool>,
|
compiler_docs: Option<bool>,
|
||||||
docs: Option<bool>,
|
docs: Option<bool>,
|
||||||
@ -217,7 +215,6 @@ impl Config {
|
|||||||
}
|
}
|
||||||
config.rustc = build.rustc.map(PathBuf::from);
|
config.rustc = build.rustc.map(PathBuf::from);
|
||||||
config.cargo = build.cargo.map(PathBuf::from);
|
config.cargo = build.cargo.map(PathBuf::from);
|
||||||
config.nodejs = build.nodejs.map(PathBuf::from);
|
|
||||||
set(&mut config.compiler_docs, build.compiler_docs);
|
set(&mut config.compiler_docs, build.compiler_docs);
|
||||||
set(&mut config.docs, build.docs);
|
set(&mut config.docs, build.docs);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user