File tree 3 files changed +14
-0
lines changed
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"
633
633
valopt infodir " ${CFG_PREFIX} /share/info" " install additional info"
634
634
valopt llvm-root " " " set LLVM root"
635
635
valopt python " " " set path to python"
636
+ valopt nodejs " " " set path to nodejs"
636
637
valopt jemalloc-root " " " set directory where libjemalloc_pic.a is located"
637
638
valopt build " ${DEFAULT_BUILD} " " GNUs ./configure syntax LLVM build triple"
638
639
valopt android-cross-path " " " Android NDK standalone path (deprecated)"
@@ -748,6 +749,9 @@ if [ $(echo $python_version | grep -c '^Python 2\.7') -ne 1 ]; then
748
749
err " Found $python_version , but Python 2.7 is required"
749
750
fi
750
751
752
+ # Checking for node, but not required
753
+ probe CFG_NODEJS nodejs node
754
+
751
755
# If we have no git directory then we are probably a tarball distribution
752
756
# and shouldn't attempt to load submodules
753
757
if [ ! -e ${CFG_SRC_DIR} .git ]
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ pub struct Config {
80
80
pub musl_root : Option < PathBuf > ,
81
81
pub prefix : Option < String > ,
82
82
pub codegen_tests : bool ,
83
+ pub nodejs : Option < PathBuf > ,
83
84
}
84
85
85
86
/// Per-target configuration stored in the global configuration structure.
@@ -395,6 +396,9 @@ impl Config {
395
396
self . rustc = Some ( PathBuf :: from ( value) . join ( "bin/rustc" ) ) ;
396
397
self . cargo = Some ( PathBuf :: from ( value) . join ( "bin/cargo" ) ) ;
397
398
}
399
+ "CFG_NODEJS" if value. len ( ) > 0 => {
400
+ self . nodejs = Some ( PathBuf :: from ( value) ) ;
401
+ }
398
402
_ => { }
399
403
}
400
404
}
Original file line number Diff line number Diff line change @@ -75,6 +75,12 @@ pub fn check(build: &mut Build) {
75
75
76
76
need_cmd ( "python" . as_ref ( ) ) ;
77
77
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
+
78
84
// We're gonna build some custom C code here and there, host triples
79
85
// also build some C++ shims for LLVM so we need a C++ compiler.
80
86
for target in build. config . target . iter ( ) {
You can’t perform that action at this time.
0 commit comments