Bug 1161339 - Check for the rust compiler. r=ted
authorRalph Giles <giles@mozilla.com>
Tue, 05 May 2015 10:48:00 -0700
changeset 243147 b811c7d4f39bd5b9d88e72a6a428a20cbdb52712
parent 243146 fd24ed68c6426e372e0d9a148f8d35d3a9fcdb88
child 243148 ea593c621ffe1ce2c4cc16bf91a33bc8ab9027fa
push id12855
push userphilringnalda@gmail.com
push dateSat, 09 May 2015 21:54:24 +0000
treeherderfx-team@e8362616653b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1161339
milestone40.0a1
Bug 1161339 - Check for the rust compiler. r=ted Add a configure switch --enable-rust to control compilation of rust source. This serves as a basic conditional for experimentation with gecko code written in rust. It presumes we can use a rustc installed on the system, e.g. by the developer or by tooltool. Requesting rust support without making rustc available will fail since we don't want the build configuration to change based on the available environment.
configure.in
--- a/configure.in
+++ b/configure.in
@@ -424,16 +424,28 @@ fi
 if test -n "$MOZ_WINCONSOLE"; then
     AC_DEFINE(MOZ_WINCONSOLE)
 fi
 
 MOZ_TOOL_VARIABLES
 
 MOZ_CHECK_COMPILER_WRAPPER
 
+MOZ_PATH_PROG(RUSTC, rustc)
+MOZ_ARG_ENABLE_BOOL([rust],
+                    [  --enable-rust  Include rust language sources],
+                    [MOZ_RUST=1],
+                    [MOZ_RUST= ])
+if test -z "$RUSTC" -a -n "$MOZ_RUST"; then
+  AC_MSG_ERROR([Rust compiler not found.
+    To compile rust language sources, you must have 'rustc' in your path.
+    See http://www.rust-lang.org/ for more information.])
+fi
+AC_SUBST(MOZ_RUST)
+
 dnl ========================================================
 dnl Check for MacOS deployment target version
 dnl ========================================================
 
 MOZ_ARG_ENABLE_STRING(macos-target,
                       [  --enable-macos-target=VER (default=10.6)
                           Set the minimum MacOS version needed at runtime],
                       [_MACOSX_DEPLOYMENT_TARGET=$enableval])