aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/command_base.py
diff options
context:
space:
mode:
authorUK992 <urbankrajnc92@gmail.com>2016-08-01 15:20:26 +0200
committerUK992 <urbankrajnc92@gmail.com>2016-09-07 22:45:05 +0200
commitfc3555556cfe5ee775281eb05cfeea232efa68c7 (patch)
tree686a39846f6b03c85a1c97abe19c75022ad8de2d /python/servo/command_base.py
parentdd33be45485fefd148759c77462c484157026055 (diff)
downloadservo-fc3555556cfe5ee775281eb05cfeea232efa68c7.tar.gz
servo-fc3555556cfe5ee775281eb05cfeea232efa68c7.zip
Create `mach bootstrap` based on Mozilla's mozboot bootstrapper
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r--python/servo/command_base.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 821f7553312..7c4827f8b62 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -372,6 +372,18 @@ class CommandBase(object):
env['PATH'] = env['PATH'].encode('ascii', 'ignore')
extra_path = []
extra_lib = []
+ if "msvc" in (target or host_triple()):
+ msvc_x64 = "64" if "x86_64" in (target or host_triple()) else ""
+ msvc_deps_dir = path.join(self.context.sharedir, "msvc-dependencies")
+ extra_path += [path.join(msvc_deps_dir, "cmake", "bin")]
+ extra_path += [path.join(msvc_deps_dir, "ninja", "bin")]
+ # Link openssl
+ env["OPENSSL_INCLUDE_DIR"] = path.join(msvc_deps_dir, "openssl", "include")
+ env["OPENSSL_LIB_DIR"] = path.join(msvc_deps_dir, "openssl", "lib" + msvc_x64)
+ env["OPENSSL_LIBS"] = "ssleay32MD:libeay32MD"
+ # Link moztools
+ env["MOZTOOLS_PATH"] = path.join(msvc_deps_dir, "moztools", "bin")
+
if not self.config["tools"]["system-rust"] \
or self.config["tools"]["rust-root"]:
env["RUST_ROOT"] = self.config["tools"]["rust-root"]
@@ -493,6 +505,8 @@ class CommandBase(object):
if self.context.bootstrapped:
return
+ target_platform = target or host_triple()
+
rust_root = self.config["tools"]["rust-root"]
rustc_path = path.join(
rust_root, "rustc", "bin", "rustc" + BIN_SUFFIX
@@ -501,9 +515,13 @@ class CommandBase(object):
base_target_path = path.join(rust_root, "rustc", "lib", "rustlib")
- target_path = path.join(base_target_path, target or host_triple())
+ target_path = path.join(base_target_path, target_platform)
target_exists = path.exists(target_path)
+ # Always check if all needed MSVC dependencies are installed
+ if "msvc" in target_platform:
+ Registrar.dispatch("bootstrap", context=self.context)
+
if not (self.config['tools']['system-rust'] or (rustc_binary_exists and target_exists)):
print("looking for rustc at %s" % (rustc_path))
Registrar.dispatch("bootstrap-rust", context=self.context, target=filter(None, [target]),