Bug 1205012 - Allow rust source code in SpiderMonkey; r=mshal
authorTerrence Cole <terrence@mozilla.com>
Fri, 18 Sep 2015 13:55:29 -0700
changeset 266188 15d9f056935dd28dbd452f166d85b0240b06524f
parent 266187 be709ac91a4fa322015a6d589d24f713620b2e36
child 266189 1763e148406574a02a516e199a820f7a33297e3d
push id29483
push usercbook@mozilla.com
push dateTue, 06 Oct 2015 10:01:59 +0000
treeherdermozilla-central@89732fcdb0ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1205012
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1205012 - Allow rust source code in SpiderMonkey; r=mshal
aclocal.m4
build/autoconf/rust.m4
configure.in
js/src/aclocal.m4
js/src/configure.in
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -29,16 +29,17 @@ builtin(include, build/autoconf/linux.m4
 builtin(include, build/autoconf/python-virtualenv.m4)dnl
 builtin(include, build/autoconf/winsdk.m4)dnl
 builtin(include, build/autoconf/icu.m4)dnl
 builtin(include, build/autoconf/ffi.m4)dnl
 builtin(include, build/autoconf/clang-plugin.m4)dnl
 builtin(include, build/autoconf/alloc.m4)dnl
 builtin(include, build/autoconf/ios.m4)dnl
 builtin(include, build/autoconf/jemalloc.m4)dnl
+builtin(include, build/autoconf/rust.m4)dnl
 
 MOZ_PROG_CHECKMSYS()
 
 # Read the user's .mozconfig script.  We can't do this in
 # configure.in: autoconf puts the argument parsing code above anything
 # expanded from configure.in, and we need to get the configure options
 # from .mozconfig in place before that argument parsing code.
 MOZ_READ_MOZCONFIG(.)
new file mode 100644
--- /dev/null
+++ b/build/autoconf/rust.m4
@@ -0,0 +1,35 @@
+dnl This Source Code Form is subject to the terms of the Mozilla Public
+dnl License, v. 2.0. If a copy of the MPL was not distributed with this
+dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+AC_DEFUN([MOZ_RUST_SUPPORT], [
+  MOZ_PATH_PROG(RUSTC, rustc)
+  if test -n "$RUSTC"; then
+    AC_MSG_CHECKING([rustc version])
+    RUSTC_VERSION=`$RUSTC --version | cut -d ' ' -f 2`
+    # Parse out semversion elements.
+    _RUSTC_MAJOR_VERSION=`echo ${RUSTC_VERSION} | cut -d . -f 1`
+    _RUSTC_MINOR_VERSION=`echo ${RUSTC_VERSION} | cut -d . -f 2`
+    _RUSTC_EXTRA_VERSION=`echo ${RUSTC_VERSION} | cut -d . -f 3 | cut -d + -f 1`
+    _RUSTC_PATCH_VERSION=`echo ${_RUSTC_EXTRA_VERSION} | cut -d '-' -f 1`
+    AC_MSG_RESULT([$RUSTC_VERSION (v${_RUSTC_MAJOR_VERSION}.${_RUSTC_MINOR_VERSION}.${_RUSTC_PATCH_VERSION})])
+  fi
+  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
+  if test -n "$MOZ_RUST" && test -z "$_RUSTC_MAJOR_VERSION" -o \
+    "$_RUSTC_MAJOR_VERSION" -lt 1; then
+    AC_MSG_ERROR([Rust compiler ${RUSTC_VERSION} is too old.
+      To compile Rust language sources please install at least
+      version 1.0 of the 'rustc' toolchain and make sure it is
+      first in your path.
+      You can verify this by typing 'rustc --version'.])
+  fi
+  AC_SUBST(MOZ_RUST)
+])
--- a/configure.in
+++ b/configure.in
@@ -409,45 +409,17 @@ fi
 if test -n "$MOZ_WINCONSOLE"; then
     AC_DEFINE(MOZ_WINCONSOLE)
 fi
 
 MOZ_TOOL_VARIABLES
 
 MOZ_CHECK_COMPILER_WRAPPER
 
-MOZ_PATH_PROG(RUSTC, rustc)
-if test -n "$RUSTC"; then
-  AC_MSG_CHECKING([rustc version])
-  RUSTC_VERSION=`$RUSTC --version | cut -d ' ' -f 2`
-  # Parse out semversion elements.
-  _RUSTC_MAJOR_VERSION=`echo ${RUSTC_VERSION} | cut -d . -f 1`
-  _RUSTC_MINOR_VERSION=`echo ${RUSTC_VERSION} | cut -d . -f 2`
-  _RUSTC_EXTRA_VERSION=`echo ${RUSTC_VERSION} | cut -d . -f 3 | cut -d + -f 1`
-  _RUSTC_PATCH_VERSION=`echo ${_RUSTC_EXTRA_VERSION} | cut -d '-' -f 1`
-  AC_MSG_RESULT([$RUSTC_VERSION (v${_RUSTC_MAJOR_VERSION}.${_RUSTC_MINOR_VERSION}.${_RUSTC_PATCH_VERSION})])
-fi
-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
-if test -n "$MOZ_RUST" && test -z "$_RUSTC_MAJOR_VERSION" -o \
-  "$_RUSTC_MAJOR_VERSION" -lt 1; then
-  AC_MSG_ERROR([Rust compiler ${RUSTC_VERSION} is too old.
-    To compile Rust language sources please install at least
-    version 1.0 of the 'rustc' toolchain and make sure it is
-    first in your path.
-    You can verify this by typing 'rustc --version'.])
-fi
-AC_SUBST(MOZ_RUST)
+MOZ_RUST_SUPPORT
 
 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],
--- a/js/src/aclocal.m4
+++ b/js/src/aclocal.m4
@@ -28,16 +28,17 @@ builtin(include, ../../build/autoconf/li
 builtin(include, ../../build/autoconf/python-virtualenv.m4)dnl
 builtin(include, ../../build/autoconf/winsdk.m4)dnl
 builtin(include, ../../build/autoconf/icu.m4)dnl
 builtin(include, ../../build/autoconf/ffi.m4)dnl
 builtin(include, ../../build/autoconf/clang-plugin.m4)dnl
 builtin(include, ../../build/autoconf/alloc.m4)dnl
 builtin(include, ../../build/autoconf/jemalloc.m4)dnl
 builtin(include, ../../build/autoconf/ios.m4)dnl
+builtin(include, ../../build/autoconf/rust.m4)dnl
 
 define([__MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
 define([AC_INIT_PREPARE],
 [if test -z "$srcdir"; then
   srcdir=`dirname "[$]0"`
 fi
 srcdir="$srcdir/../.."
 __MOZ_AC_INIT_PREPARE($1)
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -300,16 +300,18 @@ else
         HOST_AR_FLAGS='$(AR_FLAGS)'
     fi
 fi
 
 MOZ_TOOL_VARIABLES
 
 MOZ_CHECK_COMPILER_WRAPPER
 
+MOZ_RUST_SUPPORT
+
 dnl Special win32 checks
 dnl ========================================================
 
 # Target the Windows 8.1 SDK by default
 WINSDK_TARGETVER=603
 WINVER=502
 
 MOZ_ARG_WITH_STRING(windows-version,