Bug 1205012 - Allow rust source code in SpiderMonkey; r=mshal

This commit is contained in:
Terrence Cole 2015-09-18 13:55:29 -07:00
parent 1091f40c74
commit cbf92c5e64
5 changed files with 40 additions and 29 deletions

1
aclocal.m4 vendored
View File

@ -34,6 +34,7 @@ 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()

35
build/autoconf/rust.m4 Normal file
View File

@ -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)
])

View File

@ -414,35 +414,7 @@ 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

1
js/src/aclocal.m4 vendored
View File

@ -33,6 +33,7 @@ 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],

View File

@ -305,6 +305,8 @@ MOZ_TOOL_VARIABLES
MOZ_CHECK_COMPILER_WRAPPER
MOZ_RUST_SUPPORT
dnl Special win32 checks
dnl ========================================================