File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -633,6 +633,7 @@ valopt datadir "${CFG_PREFIX}/share" "install data"
633633valopt infodir " ${CFG_PREFIX} /share/info" " install additional info"
634634valopt llvm-root " " " set LLVM root"
635635valopt python " " " set path to python"
636+ valopt nodejs " " " set path to nodejs"
636637valopt jemalloc-root " " " set directory where libjemalloc_pic.a is located"
637638valopt build " ${DEFAULT_BUILD} " " GNUs ./configure syntax LLVM build triple"
638639valopt android-cross-path " " " Android NDK standalone path (deprecated)"
@@ -748,6 +749,9 @@ if [ $(echo $python_version | grep -c '^Python 2\.7') -ne 1 ]; then
748749 err " Found $python_version , but Python 2.7 is required"
749750fi
750751
752+ # Checking for node, but not required
753+ probe CFG_NODEJS nodejs node
754+
751755# If we have no git directory then we are probably a tarball distribution
752756# and shouldn't attempt to load submodules
753757if [ ! -e ${CFG_SRC_DIR} .git ]
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ pub struct Config {
8080 pub musl_root : Option < PathBuf > ,
8181 pub prefix : Option < String > ,
8282 pub codegen_tests : bool ,
83+ pub nodejs : Option < PathBuf > ,
8384}
8485
8586/// Per-target configuration stored in the global configuration structure.
@@ -395,6 +396,9 @@ impl Config {
395396 self . rustc = Some ( PathBuf :: from ( value) . join ( "bin/rustc" ) ) ;
396397 self . cargo = Some ( PathBuf :: from ( value) . join ( "bin/cargo" ) ) ;
397398 }
399+ "CFG_NODEJS" if value. len ( ) > 0 => {
400+ self . nodejs = Some ( PathBuf :: from ( value) ) ;
401+ }
398402 _ => { }
399403 }
400404 }
Original file line number Diff line number Diff line change @@ -75,6 +75,12 @@ pub fn check(build: &mut Build) {
7575
7676 need_cmd ( "python" . as_ref ( ) ) ;
7777
78+ // If a manual nodejs was added to the config,
79+ // of if a nodejs install is detected through config, use it.
80+ if let Some ( ref s) = build. config . nodejs {
81+ need_cmd ( s. as_ref ( ) ) ;
82+ }
83+
7884 // We're gonna build some custom C code here and there, host triples
7985 // also build some C++ shims for LLVM so we need a C++ compiler.
8086 for target in build. config . target . iter ( ) {
You can’t perform that action at this time.
0 commit comments