Bug 1254873 - Make --disable-js-shell the default for non-js-standalone builds. r=chmanchester

The implementation is a bit circumvoluted, but we do need to share
options between the top-level and js/src configures, possibly with
different defaults, and to properly pass things down from one to
the other. Until we are further down the road and can actually merge
both configures, this is a necessary evil.
This commit is contained in:
Mike Hommey 2016-03-09 15:59:39 +09:00
Родитель 06634bfcb4
Коммит e6d395b495
5 изменённых файлов: 44 добавлений и 8 удалений

Просмотреть файл

@ -228,8 +228,27 @@ def include_project_configure(project, build_env, help):
error('Cannot find project %s' % project[0])
return path
include(include_project_configure)
@depends('--enable-project')
def build_app(project):
@depends('--enable-project', '--help')
def build_project(project, help):
return project[0]
# This is temporary until js/src/configure and configure are merged.
@depends(build_project)
def extra_old_configure_args(build_project):
if build_project != 'js':
return []
return False
# Use instead of option() in js/moz.configure
@template
def js_option(*args, **kwargs):
opt = option(*args, **kwargs)
@depends(opt.option, extra_old_configure_args)
def js_option(value, extra_old_configure_args):
if extra_old_configure_args is not False:
extra_old_configure_args.append(value.format(opt.option))
include(include_project_configure)

Просмотреть файл

@ -60,10 +60,12 @@ def autoconf(mozconfig, autoconf):
option(env='OLD_CONFIGURE', nargs=1, help='Path to the old configure script')
@depends('OLD_CONFIGURE', mozconfig, autoconf, check_build_environment, shell,
virtualenv_python, compile_environment, build_app)
virtualenv_python, compile_environment, build_project,
extra_old_configure_args)
@advanced
def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
python, compile_env, build_app):
python, compile_env, build_project,
extra_old_configure_args):
import glob
import itertools
import subprocess
@ -126,7 +128,10 @@ def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
print('PYTHON=%s' % quote(python), file=out)
if compile_env:
print('COMPILE_ENVIRONMENT=1', file=out)
print('MOZ_BUILD_APP=%s' % build_app, file=out)
print('MOZ_BUILD_APP=%s' % build_project, file=out)
if extra_old_configure_args:
cmd += extra_old_configure_args
return cmd

Просмотреть файл

@ -16,4 +16,6 @@ ac_add_options --enable-crashreporter
ac_add_options --enable-release
ac_add_options --enable-js-shell
. "$topsrcdir/build/mozconfig.automation"

Просмотреть файл

@ -4,7 +4,15 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
option('--disable-js-shell', help='Do not build the JS shell')
# /!\ Use js_option() instead of option() in this file. /!\
# =========================================================
@depends(build_project, '--help')
def js_shell_default(build_project, help):
return build_project == 'js'
js_option('--disable-js-shell', default=js_shell_default,
help='Do not build the JS shell')
@depends('--disable-js-shell')
def js_shell(value):

Просмотреть файл

@ -3,3 +3,5 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include('../js/moz.configure')