|
@@ -0,0 +1,1675 @@
|
|
|
|
+# HG changeset patch
|
|
|
|
+# User Mike Hommey <mh+mozilla@glandium.org>
|
|
|
|
+# Date 1602130066 0
|
|
|
|
+# Node ID 6f0cd585ec0ad534c56fcdbdab1d3cce51faff8f
|
|
|
|
+# Parent da58a370db707194c2a76240b0b4258b415ea58d
|
|
|
|
+Bug 1520395 - Remove the python configure distinction between option and js_option. r=firefox-build-system-reviewers,andi,rstewart
|
|
|
|
+
|
|
|
|
+Now that we don't recurse into the js python configure, we don't need to
|
|
|
|
+have a special treatment for the options that need to be passed down to
|
|
|
|
+that subconfigure, which is what js_option was for.
|
|
|
|
+
|
|
|
|
+Differential Revision: https://phabricator.services.mozilla.com/D92727
|
|
|
|
+
|
|
|
|
+diff --git a/build/moz.configure/android-ndk.configure b/build/moz.configure/android-ndk.configure
|
|
|
|
+--- a/build/moz.configure/android-ndk.configure
|
|
|
|
++++ b/build/moz.configure/android-ndk.configure
|
|
|
|
+@@ -1,34 +1,34 @@
|
|
|
|
+ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
|
|
+ # vim: set filetype=python:
|
|
|
|
+ # 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/.
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--with-android-ndk', nargs=1,
|
|
|
|
+- help='location where the Android NDK can be found')
|
|
|
|
++option('--with-android-ndk', nargs=1,
|
|
|
|
++ help='location where the Android NDK can be found{|}')
|
|
|
|
+
|
|
|
|
+-js_option('--with-android-toolchain', nargs=1,
|
|
|
|
+- help='location of the Android toolchain')
|
|
|
|
++option('--with-android-toolchain', nargs=1,
|
|
|
|
++ help='location of the Android toolchain')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(target)
|
|
|
|
+ def min_android_version(target):
|
|
|
|
+ if target.cpu in ['aarch64', 'x86_64', 'mips64']:
|
|
|
|
+ # 64-bit support was added in API 21.
|
|
|
|
+ return '21'
|
|
|
|
+ return '9'
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--with-android-version',
|
|
|
|
+- nargs=1,
|
|
|
|
+- help='android platform version{|}',
|
|
|
|
+- default=min_android_version)
|
|
|
|
++option('--with-android-version',
|
|
|
|
++ nargs=1,
|
|
|
|
++ help='android platform version{|}',
|
|
|
|
++ default=min_android_version)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--with-android-version', min_android_version, '--help')
|
|
|
|
+ @imports(_from='__builtin__', _import='ValueError')
|
|
|
|
+ def android_version(value, min_version, _):
|
|
|
|
+ if not value:
|
|
|
|
+ # Someone has passed --without-android-version.
|
|
|
|
+ die('--with-android-version cannot be disabled.')
|
|
|
|
+@@ -190,19 +190,19 @@ set_config('ANDROID_TOOLCHAIN', android_
|
|
|
|
+ def android_toolchain_prefix_base(target):
|
|
|
|
+ if target.cpu == 'x86':
|
|
|
|
+ # Ideally, the --target should just have the right x86 variant
|
|
|
|
+ # in the first place.
|
|
|
|
+ return 'i686-linux-android'
|
|
|
|
+ return target.toolchain
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option(env='STLPORT_CPPFLAGS',
|
|
|
|
+- nargs=1,
|
|
|
|
+- help='Options compiler should pass for standard C++ library')
|
|
|
|
++option(env='STLPORT_CPPFLAGS',
|
|
|
|
++ nargs=1,
|
|
|
|
++ help='Options compiler should pass for standard C++ library')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('STLPORT_CPPFLAGS', ndk, '--help')
|
|
|
|
+ @imports(_from='os.path', _import='isdir')
|
|
|
|
+ def stlport_cppflags(value, ndk, _):
|
|
|
|
+ if value and len(value):
|
|
|
|
+ return value.split()
|
|
|
|
+ if not ndk:
|
|
|
|
+diff --git a/build/moz.configure/arm.configure b/build/moz.configure/arm.configure
|
|
|
|
+--- a/build/moz.configure/arm.configure
|
|
|
|
++++ b/build/moz.configure/arm.configure
|
|
|
|
+@@ -21,33 +21,33 @@ def arm_option_defaults(os, _):
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Note: '{...|}' in the help of all options with a non-constant default to
|
|
|
|
+ # make the lint happy. The first arm is always going to be used, because a
|
|
|
|
+ # default is always returned. The lint is fooled by this file being
|
|
|
|
+ # conditional. If it weren't conditional, the lint wouldn't ask for '{|}' to
|
|
|
|
+ # be there.
|
|
|
|
+-js_option('--with-arch', nargs=1,
|
|
|
|
+- default=arm_option_defaults.arch,
|
|
|
|
+- help='{Use specific CPU features (-march=type). Resets thumb, fpu, '
|
|
|
|
+- 'float-abi, etc. defaults when set|}')
|
|
|
|
++option('--with-arch', nargs=1,
|
|
|
|
++ default=arm_option_defaults.arch,
|
|
|
|
++ help='{Use specific CPU features (-march=type). Resets thumb, fpu, '
|
|
|
|
++ 'float-abi, etc. defaults when set|}')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--with-arch')
|
|
|
|
+ def arch_option(value):
|
|
|
|
+ if value:
|
|
|
|
+ if value[0] != 'toolchain-default':
|
|
|
|
+ return ['-march={}'.format(value[0])]
|
|
|
|
+ return []
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--with-thumb', choices=('yes', 'no', 'toolchain-default'),
|
|
|
|
+- default=arm_option_defaults.thumb,
|
|
|
|
+- nargs='?', help='{Use Thumb instruction set (-mthumb)|}')
|
|
|
|
++option('--with-thumb', choices=('yes', 'no', 'toolchain-default'),
|
|
|
|
++ default=arm_option_defaults.thumb,
|
|
|
|
++ nargs='?', help='{Use Thumb instruction set (-mthumb)|}')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ def normalize_arm_option(value):
|
|
|
|
+ if value:
|
|
|
|
+ if len(value):
|
|
|
|
+ if value[0] == 'yes':
|
|
|
|
+ return True
|
|
|
|
+ elif value[0] == 'no':
|
|
|
|
+@@ -62,60 +62,60 @@ def thumb_option(value):
|
|
|
|
+ value = normalize_arm_option(value)
|
|
|
|
+ if value is True:
|
|
|
|
+ return ['-mthumb']
|
|
|
|
+ if value is False:
|
|
|
|
+ return ['-marm']
|
|
|
|
+ return []
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--with-thumb-interwork', choices=('yes', 'no', 'toolchain-default'),
|
|
|
|
+- default='toolchain-default',
|
|
|
|
+- nargs='?', help='Use Thumb/ARM instuctions interwork (-mthumb-interwork)')
|
|
|
|
++option('--with-thumb-interwork', choices=('yes', 'no', 'toolchain-default'),
|
|
|
|
++ default='toolchain-default',
|
|
|
|
++ nargs='?', help='Use Thumb/ARM instuctions interwork (-mthumb-interwork)')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--with-thumb-interwork')
|
|
|
|
+ def thumb_interwork_option(value):
|
|
|
|
+ value = normalize_arm_option(value)
|
|
|
|
+ if value is True:
|
|
|
|
+ return ['-mthumb-interwork']
|
|
|
|
+ if value is False:
|
|
|
|
+ return ['-mno-thumb-interwork']
|
|
|
|
+ return []
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--with-fpu', nargs=1,
|
|
|
|
+- default=arm_option_defaults.fpu,
|
|
|
|
+- help='{Use specific FPU type (-mfpu=type)|}')
|
|
|
|
++option('--with-fpu', nargs=1,
|
|
|
|
++ default=arm_option_defaults.fpu,
|
|
|
|
++ help='{Use specific FPU type (-mfpu=type)|}')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--with-fpu')
|
|
|
|
+ def fpu_option(value):
|
|
|
|
+ if value:
|
|
|
|
+ if value[0] != 'toolchain-default':
|
|
|
|
+ return ['-mfpu={}'.format(value[0])]
|
|
|
|
+ return []
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--with-float-abi', nargs=1,
|
|
|
|
+- default=arm_option_defaults.float_abi,
|
|
|
|
+- help='{Use specific arm float ABI (-mfloat-abi=type)|}')
|
|
|
|
++option('--with-float-abi', nargs=1,
|
|
|
|
++ default=arm_option_defaults.float_abi,
|
|
|
|
++ help='{Use specific arm float ABI (-mfloat-abi=type)|}')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--with-float-abi')
|
|
|
|
+ def float_abi_option(value):
|
|
|
|
+ if value:
|
|
|
|
+ if value[0] != 'toolchain-default':
|
|
|
|
+ return ['-mfloat-abi={}'.format(value[0])]
|
|
|
|
+ return []
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--with-soft-float', choices=('yes', 'no', 'toolchain-default'),
|
|
|
|
+- default='toolchain-default',
|
|
|
|
+- nargs='?', help='Use soft float library (-msoft-float)')
|
|
|
|
++option('--with-soft-float', choices=('yes', 'no', 'toolchain-default'),
|
|
|
|
++ default='toolchain-default',
|
|
|
|
++ nargs='?', help='Use soft float library (-msoft-float)')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--with-soft-float')
|
|
|
|
+ def soft_float_option(value):
|
|
|
|
+ value = normalize_arm_option(value)
|
|
|
|
+ if value is True:
|
|
|
|
+ return ['-msoft-float']
|
|
|
|
+ if value is False:
|
|
|
|
+diff --git a/build/moz.configure/bindgen.configure b/build/moz.configure/bindgen.configure
|
|
|
|
+--- a/build/moz.configure/bindgen.configure
|
|
|
|
++++ b/build/moz.configure/bindgen.configure
|
|
|
|
+@@ -57,17 +57,17 @@ def cbindgen(cbindgen_override, toolchai
|
|
|
|
+ `cargo install cbindgen`, ensure that `cbindgen` is on your PATH,
|
|
|
|
+ or point at an executable with `CBINDGEN`.
|
|
|
|
+ '''))
|
|
|
|
+ check_cbindgen_version(candidates[0], fatal=True)
|
|
|
|
+
|
|
|
|
+ set_config('CBINDGEN', cbindgen)
|
|
|
|
+
|
|
|
|
+ # Bindgen can use rustfmt to format Rust file, but it's not required.
|
|
|
|
+-js_option(env='RUSTFMT', nargs=1, help='Path to the rustfmt program')
|
|
|
|
++option(env='RUSTFMT', nargs=1, help='Path to the rustfmt program')
|
|
|
|
+
|
|
|
|
+ rustfmt = check_prog('RUSTFMT', ['rustfmt'], paths=toolchain_search_path,
|
|
|
|
+ input='RUSTFMT', allow_missing=True)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # We support setting up the appropriate options for bindgen via setting
|
|
|
|
+ # LLVM_CONFIG or by providing explicit configure options. The Windows
|
|
|
|
+ # installer of LLVM/Clang doesn't provide llvm-config, so we need both
|
|
|
|
+@@ -105,25 +105,25 @@ def llvm_config_paths(host):
|
|
|
|
+ mozbuild_state_dir = os.environ.get('MOZBUILD_STATE_PATH',
|
|
|
|
+ os.path.expanduser(os.path.join('~', '.mozbuild')))
|
|
|
|
+ bootstrap_llvm_config = os.path.join(mozbuild_state_dir, 'clang', 'bin', 'llvm-config')
|
|
|
|
+
|
|
|
|
+ llvm_config_progs.append(bootstrap_llvm_config)
|
|
|
|
+
|
|
|
|
+ return llvm_config_progs
|
|
|
|
+
|
|
|
|
+-js_option(env='LLVM_CONFIG', nargs=1, help='Path to llvm-config')
|
|
|
|
++option(env='LLVM_CONFIG', nargs=1, help='Path to llvm-config')
|
|
|
|
+
|
|
|
|
+ llvm_config = check_prog('LLVM_CONFIG', llvm_config_paths, input='LLVM_CONFIG',
|
|
|
|
+ what='llvm-config', allow_missing=True)
|
|
|
|
+
|
|
|
|
+-js_option('--with-libclang-path', nargs=1,
|
|
|
|
+- help='Absolute path to a directory containing Clang/LLVM libraries for bindgen (version 3.9.x or above)')
|
|
|
|
+-js_option('--with-clang-path', nargs=1,
|
|
|
|
+- help='Absolute path to a Clang binary for bindgen (version 3.9.x or above)')
|
|
|
|
++option('--with-libclang-path', nargs=1,
|
|
|
|
++ help='Absolute path to a directory containing Clang/LLVM libraries for bindgen (version 3.9.x or above)')
|
|
|
|
++option('--with-clang-path', nargs=1,
|
|
|
|
++ help='Absolute path to a Clang binary for bindgen (version 3.9.x or above)')
|
|
|
|
+
|
|
|
|
+ def invoke_llvm_config(llvm_config, *options):
|
|
|
|
+ '''Invoke llvm_config with the given options and return the first line of
|
|
|
|
+ output.'''
|
|
|
|
+ lines = check_cmd_output(llvm_config, *options).splitlines()
|
|
|
|
+ return lines[0]
|
|
|
|
+
|
|
|
|
+ @imports(_from='textwrap', _import='dedent')
|
|
|
|
+@@ -353,19 +353,19 @@ def basic_bindgen_cflags(target, is_unix
|
|
|
|
+ # XXX We wouldn't have to do this if we were using the compiler from
|
|
|
|
+ # toolchain.configure, rather than just `check_compiler`.
|
|
|
|
+ if macos_sdk and target.os == 'OSX':
|
|
|
|
+ args += ['-isysroot', macos_sdk]
|
|
|
|
+
|
|
|
|
+ return args
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option(env='BINDGEN_CFLAGS',
|
|
|
|
+- nargs=1,
|
|
|
|
+- help='Options bindgen should pass to the C/C++ parser')
|
|
|
|
++option(env='BINDGEN_CFLAGS',
|
|
|
|
++ nargs=1,
|
|
|
|
++ help='Options bindgen should pass to the C/C++ parser')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(basic_bindgen_cflags, 'BINDGEN_CFLAGS')
|
|
|
|
+ @checking('bindgen cflags', lambda s: s if s else 'no')
|
|
|
|
+ def bindgen_cflags(base_flags, extra_flags):
|
|
|
|
+ flags = base_flags
|
|
|
|
+ if extra_flags and len(extra_flags):
|
|
|
|
+ flags += extra_flags[0].split()
|
|
|
|
+diff --git a/build/moz.configure/headers.configure b/build/moz.configure/headers.configure
|
|
|
|
+--- a/build/moz.configure/headers.configure
|
|
|
|
++++ b/build/moz.configure/headers.configure
|
|
|
|
+@@ -68,19 +68,19 @@ check_headers(
|
|
|
|
+ 'byteswap.h',
|
|
|
|
+ when=non_msvc_compiler,
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ # TODO: Move these checks to file specific to --enable-project=js.
|
|
|
|
+ have_perf_event_h = check_header('linux/perf_event.h',
|
|
|
|
+ when=building_linux)
|
|
|
|
+
|
|
|
|
+-js_option('--with-linux-headers',
|
|
|
|
+- help='location where the Linux kernel headers can be found',
|
|
|
|
+- nargs=1)
|
|
|
|
++option('--with-linux-headers',
|
|
|
|
++ help='location where the Linux kernel headers can be found',
|
|
|
|
++ nargs=1)
|
|
|
|
+
|
|
|
|
+ passed_linux_header_flags = depends_if(
|
|
|
|
+ '--with-linux-headers')(lambda v: ['-I%s' % v[0]])
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(try_compile(includes=['asm/unistd.h'],
|
|
|
|
+ body='return sizeof(__NR_perf_event_open);',
|
|
|
|
+ flags=passed_linux_header_flags,
|
|
|
|
+diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
|
|
|
|
+--- a/build/moz.configure/init.configure
|
|
|
|
++++ b/build/moz.configure/init.configure
|
|
|
|
+@@ -1048,34 +1048,16 @@ def build_project(include_project_config
|
|
|
|
+ return ret
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_BUILD_APP', build_project)
|
|
|
|
+ set_define('MOZ_BUILD_APP', build_project)
|
|
|
|
+ add_old_configure_assignment('MOZ_BUILD_APP', build_project)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-# This is temporary until js/src/configure and configure are merged.
|
|
|
|
+-# Use instead of option() in js/moz.configure and more generally, for
|
|
|
|
+-# options that are shared between configure and js/src/configure.
|
|
|
|
+-@dependable
|
|
|
|
+-def js_configure_args():
|
|
|
|
+- return []
|
|
|
|
+-
|
|
|
|
+-@template
|
|
|
|
+-def js_option(*args, **kwargs):
|
|
|
|
+- opt = option(*args, **kwargs)
|
|
|
|
+-
|
|
|
|
+- @depends(js_configure_args, opt.option, build_project, when=kwargs.get('when'))
|
|
|
|
+- def js_option(js_configure_args, value, build_project):
|
|
|
|
+- if build_project != 'js':
|
|
|
|
+- arg = value.format(opt.option)
|
|
|
|
+- js_configure_args.append(arg)
|
|
|
|
+-
|
|
|
|
+-
|
|
|
|
+ # set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in
|
|
|
|
+ # The logic works like this:
|
|
|
|
+ # - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD)
|
|
|
|
+ # - otherwise, if we have "a" in GRE_MILESTONE, we're building Nightly or Aurora
|
|
|
|
+ # - otherwise, we're building Release/Beta (define RELEASE_OR_BETA)
|
|
|
|
+ @depends(check_build_environment, '--help')
|
|
|
|
+ @imports(_from='__builtin__', _import='open')
|
|
|
|
+ @imports('re')
|
|
|
|
+diff --git a/build/moz.configure/memory.configure b/build/moz.configure/memory.configure
|
|
|
|
+--- a/build/moz.configure/memory.configure
|
|
|
|
++++ b/build/moz.configure/memory.configure
|
|
|
|
+@@ -5,36 +5,36 @@
|
|
|
|
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(target)
|
|
|
|
+ def jemalloc_default(target):
|
|
|
|
+ return target.kernel in ('Darwin', 'Linux', 'WINNT')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-jemalloc', env='MOZ_MEMORY', default=jemalloc_default,
|
|
|
|
+- help='{Replace|Do not replace} memory allocator with jemalloc')
|
|
|
|
++option('--enable-jemalloc', env='MOZ_MEMORY', default=jemalloc_default,
|
|
|
|
++ help='{Replace|Do not replace} memory allocator with jemalloc')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_MEMORY', True, when='--enable-jemalloc')
|
|
|
|
+ set_define('MOZ_MEMORY', True, when='--enable-jemalloc')
|
|
|
|
+ add_old_configure_assignment('MOZ_MEMORY', True, when='--enable-jemalloc')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(milestone, build_project)
|
|
|
|
+ def replace_malloc_default(milestone, build_project):
|
|
|
|
+ if build_project == 'memory':
|
|
|
|
+ return True
|
|
|
|
+ if milestone.is_nightly and build_project != 'js':
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-replace-malloc', default=replace_malloc_default,
|
|
|
|
+- when='--enable-jemalloc',
|
|
|
|
+- help='{Enable|Disable} ability to dynamically replace the malloc implementation')
|
|
|
|
++option('--enable-replace-malloc', default=replace_malloc_default,
|
|
|
|
++ when='--enable-jemalloc',
|
|
|
|
++ help='{Enable|Disable} ability to dynamically replace the malloc implementation')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_REPLACE_MALLOC', True, when='--enable-replace-malloc')
|
|
|
|
+ set_define('MOZ_REPLACE_MALLOC', True, when='--enable-replace-malloc')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(build_project, when='--enable-replace-malloc')
|
|
|
|
+ def replace_malloc_static(build_project):
|
|
|
|
+diff --git a/build/moz.configure/nspr.configure b/build/moz.configure/nspr.configure
|
|
|
|
+--- a/build/moz.configure/nspr.configure
|
|
|
|
++++ b/build/moz.configure/nspr.configure
|
|
|
|
+@@ -1,25 +1,25 @@
|
|
|
|
+ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
|
|
+ # vim: set filetype=python:
|
|
|
|
+ # 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/.
|
|
|
|
+
|
|
|
|
+ # Top-level configure defaults to building NSPR from source. Standalone JS
|
|
|
|
+ # doesn't.
|
|
|
|
+-js_option('--enable-nspr-build', when=js_standalone,
|
|
|
|
+- help='{Build|Do not build} NSPR from source tree')
|
|
|
|
++option('--enable-nspr-build', when=js_standalone,
|
|
|
|
++ help='{Build|Do not build} NSPR from source tree')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-nspr-build', when=js_standalone)
|
|
|
|
+ def enable_nspr_build(enable):
|
|
|
|
+ if enable:
|
|
|
|
+ return enable
|
|
|
|
+
|
|
|
|
+-js_option('--with-system-nspr', help='Use system NSPR')
|
|
|
|
++option('--with-system-nspr', help='Use system NSPR')
|
|
|
|
+
|
|
|
|
+ @depends(enable_nspr_build, '--with-system-nspr', js_standalone)
|
|
|
|
+ def build_nspr(nspr_build, system_nspr, js_standalone):
|
|
|
|
+ if nspr_build is not None and nspr_build.origin != 'default':
|
|
|
|
+ if nspr_build and system_nspr:
|
|
|
|
+ die('Cannot use both --enable-nspr-build and --with-system-nspr')
|
|
|
|
+ if js_standalone:
|
|
|
|
+ return nspr_build
|
|
|
|
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
|
|
|
|
+--- a/build/moz.configure/rust.configure
|
|
|
|
++++ b/build/moz.configure/rust.configure
|
|
|
|
+@@ -2,18 +2,18 @@
|
|
|
|
+ # vim: set filetype=python:
|
|
|
|
+ # 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/.
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Rust is required by `rust_compiler` below. We allow_missing here
|
|
|
|
+ # to propagate failures to the better error message there.
|
|
|
|
+-js_option(env='RUSTC', nargs=1, help='Path to the rust compiler')
|
|
|
|
+-js_option(env='CARGO', nargs=1, help='Path to the Cargo package manager')
|
|
|
|
++option(env='RUSTC', nargs=1, help='Path to the rust compiler')
|
|
|
|
++option(env='CARGO', nargs=1, help='Path to the Cargo package manager')
|
|
|
|
+
|
|
|
|
+ rustc = check_prog('_RUSTC', ['rustc'], what='rustc',
|
|
|
|
+ paths=toolchain_search_path, input='RUSTC',
|
|
|
|
+ allow_missing=True)
|
|
|
|
+ cargo = check_prog('_CARGO', ['cargo'], what='cargo',
|
|
|
|
+ paths=toolchain_search_path, input='CARGO',
|
|
|
|
+ allow_missing=True)
|
|
|
|
+
|
|
|
|
+@@ -421,17 +421,17 @@ def rust_target_env_name(triple):
|
|
|
|
+ # uppercase function in make, and we don't want to shell out just for
|
|
|
|
+ # converting a string to uppercase.
|
|
|
|
+ set_config('RUST_TARGET_ENV_NAME', rust_target_env_name)
|
|
|
|
+
|
|
|
|
+ # This is used for putting source info into symbol files.
|
|
|
|
+ set_config('RUSTC_COMMIT', depends(rustc_info)(lambda i: i.commit))
|
|
|
|
+
|
|
|
|
+ # Rustdoc is required by Rust tests below.
|
|
|
|
+-js_option(env='RUSTDOC', nargs=1, help='Path to the rustdoc program')
|
|
|
|
++option(env='RUSTDOC', nargs=1, help='Path to the rustdoc program')
|
|
|
|
+
|
|
|
|
+ rustdoc = check_prog('RUSTDOC', ['rustdoc'], paths=toolchain_search_path,
|
|
|
|
+ input='RUSTDOC', allow_missing=True)
|
|
|
|
+
|
|
|
|
+ # This option is separate from --enable-tests because Rust tests are particularly
|
|
|
|
+ # expensive in terms of compile time (especially for code in libxul).
|
|
|
|
+ option('--enable-rust-tests',
|
|
|
|
+ help='Enable building of Rust tests, and build-time execution of them')
|
|
|
|
+@@ -441,18 +441,18 @@ option('--enable-rust-tests',
|
|
|
|
+ def rust_tests(enable_rust_tests, rustdoc):
|
|
|
|
+ if enable_rust_tests and not rustdoc:
|
|
|
|
+ die('--enable-rust-tests requires rustdoc')
|
|
|
|
+ return bool(enable_rust_tests)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_RUST_TESTS', rust_tests)
|
|
|
|
+
|
|
|
|
+-js_option(env='WIN64_LINK', nargs=1, help='Path to link.exe that targets win64')
|
|
|
|
+-js_option(env='WIN64_LIB', nargs=1, help='Paths to libraries for the win64 linker')
|
|
|
|
++option(env='WIN64_LINK', nargs=1, help='Path to link.exe that targets win64')
|
|
|
|
++option(env='WIN64_LIB', nargs=1, help='Paths to libraries for the win64 linker')
|
|
|
|
+
|
|
|
|
+ set_config('WIN64_LINK', depends('WIN64_LINK')(lambda x: x))
|
|
|
|
+ set_config('WIN64_LIB', depends('WIN64_LIB')(lambda x: x))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(target, rustc_info, c_compiler, 'WIN64_LINK', 'WIN64_LIB')
|
|
|
|
+ def win64_cargo_linker(target, rustc_info, compiler_info, link, lib):
|
|
|
|
+ # When we're building a 32-bit Windows build with a 64-bit rustc, we
|
|
|
|
+diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
|
|
|
|
+--- a/build/moz.configure/toolchain.configure
|
|
|
|
++++ b/build/moz.configure/toolchain.configure
|
|
|
|
+@@ -2,43 +2,44 @@
|
|
|
|
+ # vim: set filetype=python:
|
|
|
|
+ # 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/.
|
|
|
|
+
|
|
|
|
+ imply_option('--enable-release', mozilla_official)
|
|
|
|
+ imply_option('--enable-release', depends_if('MOZ_AUTOMATION')(lambda x: True))
|
|
|
|
+
|
|
|
|
+-js_option('--enable-release',
|
|
|
|
+- help='{Build|Do not build} with more conservative, release '
|
|
|
|
+- 'engineering-oriented options.{ This may slow down builds.|}')
|
|
|
|
++option('--enable-release',
|
|
|
|
++ default=milestone.is_release_or_beta,
|
|
|
|
++ help='{Build|Do not build} with more conservative, release '
|
|
|
|
++ 'engineering-oriented options.{ This may slow down builds.|}')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--enable-release')
|
|
|
|
+ def developer_options(value):
|
|
|
|
+ if not value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('DEVELOPER_OPTIONS', developer_options)
|
|
|
|
+ set_config('DEVELOPER_OPTIONS', developer_options)
|
|
|
|
+
|
|
|
|
+ # PGO
|
|
|
|
+ # ==============================================================
|
|
|
|
+-js_option(env='MOZ_PGO', help='Build with profile guided optimizations')
|
|
|
|
++option(env='MOZ_PGO', help='Build with profile guided optimizations')
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_PGO', depends('MOZ_PGO')(lambda x: bool(x)))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Code optimization
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+-js_option('--disable-optimize',
|
|
|
|
+- nargs='?',
|
|
|
|
+- help='Disable optimizations via compiler flags')
|
|
|
|
++option('--disable-optimize',
|
|
|
|
++ nargs='?',
|
|
|
|
++ help='Disable optimizations via compiler flags')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--enable-optimize', '--help')
|
|
|
|
+ def moz_optimize(option, _):
|
|
|
|
+ flags = None
|
|
|
|
+
|
|
|
|
+ if len(option):
|
|
|
|
+ val = '2'
|
|
|
|
+@@ -135,17 +136,17 @@ def host_is_osx(host):
|
|
|
|
+ if host.os == 'OSX':
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ with only_when(host_is_osx | target_is_osx):
|
|
|
|
+ # MacOS SDK
|
|
|
|
+ # =========
|
|
|
|
+
|
|
|
|
+- js_option('--with-macos-sdk', env='MACOS_SDK_DIR', nargs=1,
|
|
|
|
++ option('--with-macos-sdk', env='MACOS_SDK_DIR', nargs=1,
|
|
|
|
+ help='Location of platform SDK to use')
|
|
|
|
+
|
|
|
|
+ @depends('--with-macos-sdk', host)
|
|
|
|
+ @imports(_from='os.path', _import='isdir')
|
|
|
|
+ @imports(_from='biplist', _import='readPlist')
|
|
|
|
+ def macos_sdk(sdk, host):
|
|
|
|
+ sdk_min_version = Version('10.11')
|
|
|
|
+ sdk_max_version = Version('10.13')
|
|
|
|
+@@ -208,25 +209,21 @@ with only_when(target_is_osx):
|
|
|
|
+ return value
|
|
|
|
+ return '/System/Library/PrivateFrameworks'
|
|
|
|
+
|
|
|
|
+ set_config('MACOS_PRIVATE_FRAMEWORKS_DIR', macos_private_frameworks)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Compiler wrappers
|
|
|
|
+ # ==============================================================
|
|
|
|
+-# Normally, we'd use js_option and automatically have those variables
|
|
|
|
+-# propagated to js/src, but things are complicated by possible additional
|
|
|
|
+-# wrappers in CC/CXX, and by other subconfigures that do not handle those
|
|
|
|
+-# options and do need CC/CXX altered.
|
|
|
|
+ option('--with-compiler-wrapper', env='COMPILER_WRAPPER', nargs=1,
|
|
|
|
+ help='Enable compiling with wrappers such as distcc and ccache')
|
|
|
|
+
|
|
|
|
+-js_option('--with-ccache', env='CCACHE', nargs='?',
|
|
|
|
+- help='Enable compiling with ccache')
|
|
|
|
++option('--with-ccache', env='CCACHE', nargs='?',
|
|
|
|
++ help='Enable compiling with ccache')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends_if('--with-ccache')
|
|
|
|
+ def ccache(value):
|
|
|
|
+ if len(value):
|
|
|
|
+ return value
|
|
|
|
+ # If --with-ccache was given without an explicit value, we default to
|
|
|
|
+ # 'ccache'.
|
|
|
|
+@@ -308,18 +305,18 @@ def hazard_analysis(value):
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_HAZARD', hazard_analysis)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Cross-compilation related things.
|
|
|
|
+ # ==============================================================
|
|
|
|
+-js_option('--with-toolchain-prefix', env='TOOLCHAIN_PREFIX', nargs=1,
|
|
|
|
+- help='Prefix for the target toolchain')
|
|
|
|
++option('--with-toolchain-prefix', env='TOOLCHAIN_PREFIX', nargs=1,
|
|
|
|
++ help='Prefix for the target toolchain')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--with-toolchain-prefix', target, cross_compiling)
|
|
|
|
+ def toolchain_prefix(value, target, cross_compiling):
|
|
|
|
+ if value:
|
|
|
|
+ return tuple(value)
|
|
|
|
+ if cross_compiling:
|
|
|
|
+ return ('%s-' % target.toolchain, '%s-' % target.alias)
|
|
|
|
+@@ -584,30 +581,30 @@ def get_vc_paths(topsrcdir):
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(host)
|
|
|
|
+ def host_is_windows(host):
|
|
|
|
+ if host.kernel == 'WINNT':
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--with-visual-studio-version', nargs=1,
|
|
|
|
+- choices=('2017', '2019'), when=host_is_windows,
|
|
|
|
+- help='Select a specific Visual Studio version to use')
|
|
|
|
++option('--with-visual-studio-version', nargs=1,
|
|
|
|
++ choices=('2017', '2019'), when=host_is_windows,
|
|
|
|
++ help='Select a specific Visual Studio version to use')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--with-visual-studio-version', when=host_is_windows)
|
|
|
|
+ def vs_major_version(value):
|
|
|
|
+ if value:
|
|
|
|
+ return {'2017': 15,
|
|
|
|
+ '2019': 16}[value[0]]
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option(env='VC_PATH', nargs=1, when=host_is_windows,
|
|
|
|
+- help='Path to the Microsoft Visual C/C++ compiler')
|
|
|
|
++option(env='VC_PATH', nargs=1, when=host_is_windows,
|
|
|
|
++ help='Path to the Microsoft Visual C/C++ compiler')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(vs_major_version, check_build_environment, 'VC_PATH',
|
|
|
|
+ '--with-visual-studio-version', when=host_is_windows)
|
|
|
|
+ @imports(_from='__builtin__', _import='sorted')
|
|
|
|
+ @imports(_from='operator', _import='itemgetter')
|
|
|
|
+ def vc_compiler_paths_for_version(vs_major_version, env, vc_path, vs_release_name):
|
|
|
|
+ if vc_path and vs_release_name:
|
|
|
|
+@@ -1259,19 +1256,19 @@ def default_debug_flags(compiler_info):
|
|
|
|
+
|
|
|
|
+ option(env='MOZ_DEBUG_FLAGS',
|
|
|
|
+ nargs=1,
|
|
|
|
+ help='Debug compiler flags')
|
|
|
|
+
|
|
|
|
+ imply_option('--enable-debug-symbols',
|
|
|
|
+ depends_if('--enable-debug')(lambda v: v))
|
|
|
|
+
|
|
|
|
+-js_option('--disable-debug-symbols',
|
|
|
|
+- nargs='?',
|
|
|
|
+- help='Disable debug symbols using the given compiler flags')
|
|
|
|
++option('--disable-debug-symbols',
|
|
|
|
++ nargs='?',
|
|
|
|
++ help='Disable debug symbols using the given compiler flags')
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_DEBUG_SYMBOLS',
|
|
|
|
+ depends_if('--enable-debug-symbols')(lambda _: True))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('MOZ_DEBUG_FLAGS', '--enable-debug-symbols', default_debug_flags)
|
|
|
|
+ def debug_flags(env_debug_flags, enable_debug_flags, default_debug_flags):
|
|
|
|
+ # If MOZ_DEBUG_FLAGS is set, and --enable-debug-symbols is set to a value,
|
|
|
|
+@@ -1505,20 +1502,20 @@ def is_windows(target, host):
|
|
|
|
+ return host.kernel == 'WINNT' and target.kernel == 'WINNT'
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ include('windows.configure', when=is_windows)
|
|
|
|
+
|
|
|
|
+ # LTO
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+-js_option('--enable-lto',
|
|
|
|
+- nargs='?',
|
|
|
|
+- choices=('full', 'thin'),
|
|
|
|
+- help='Enable LTO')
|
|
|
|
++option('--enable-lto',
|
|
|
|
++ nargs='?',
|
|
|
|
++ choices=('full', 'thin'),
|
|
|
|
++ help='Enable LTO')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--enable-lto', 'MOZ_PGO', c_compiler)
|
|
|
|
+ @imports('multiprocessing')
|
|
|
|
+ def lto(value, pgo, c_compiler):
|
|
|
|
+ cflags = []
|
|
|
|
+ ldflags = []
|
|
|
|
+ enabled = None
|
|
|
|
+@@ -1565,88 +1562,88 @@ set_define('MOZ_LTO', lto.enabled)
|
|
|
|
+ set_config('MOZ_LTO_CFLAGS', lto.cflags)
|
|
|
|
+ set_config('MOZ_LTO_LDFLAGS', lto.ldflags)
|
|
|
|
+ add_old_configure_assignment('MOZ_LTO_CFLAGS', lto.cflags)
|
|
|
|
+ add_old_configure_assignment('MOZ_LTO_LDFLAGS', lto.ldflags)
|
|
|
|
+
|
|
|
|
+ # ASAN
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+-js_option('--enable-address-sanitizer', help='Enable Address Sanitizer')
|
|
|
|
++option('--enable-address-sanitizer', help='Enable Address Sanitizer')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends_if('--enable-address-sanitizer')
|
|
|
|
+ def asan(value):
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('MOZ_ASAN', asan)
|
|
|
|
+
|
|
|
|
+ # MSAN
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+-js_option('--enable-memory-sanitizer', help='Enable Memory Sanitizer')
|
|
|
|
++option('--enable-memory-sanitizer', help='Enable Memory Sanitizer')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(when='--enable-memory-sanitizer')
|
|
|
|
+ def msan():
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('MOZ_MSAN', msan)
|
|
|
|
+
|
|
|
|
+ # TSAN
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+-js_option('--enable-thread-sanitizer', help='Enable Thread Sanitizer')
|
|
|
|
++option('--enable-thread-sanitizer', help='Enable Thread Sanitizer')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(when='--enable-thread-sanitizer')
|
|
|
|
+ def tsan():
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('MOZ_TSAN', tsan)
|
|
|
|
+
|
|
|
|
+ # UBSAN
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+-js_option('--enable-undefined-sanitizer',
|
|
|
|
+- nargs='*',
|
|
|
|
+- help='Enable UndefinedBehavior Sanitizer')
|
|
|
|
++option('--enable-undefined-sanitizer',
|
|
|
|
++ nargs='*',
|
|
|
|
++ help='Enable UndefinedBehavior Sanitizer')
|
|
|
|
+
|
|
|
|
+ @depends_if('--enable-undefined-sanitizer')
|
|
|
|
+ def ubsan(options):
|
|
|
|
+ default_checks = [
|
|
|
|
+ 'bool',
|
|
|
|
+ 'bounds',
|
|
|
|
+ 'vla-bound',
|
|
|
|
+ ]
|
|
|
|
+
|
|
|
|
+ checks = options if len(options) else default_checks
|
|
|
|
+
|
|
|
|
+ return ','.join(checks)
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('MOZ_UBSAN_CHECKS', ubsan)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-signed-overflow-sanitizer',
|
|
|
|
+- help='Enable UndefinedBehavior Sanitizer (Signed Integer Overflow Parts)')
|
|
|
|
++option('--enable-signed-overflow-sanitizer',
|
|
|
|
++ help='Enable UndefinedBehavior Sanitizer (Signed Integer Overflow Parts)')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(when='--enable-signed-overflow-sanitizer')
|
|
|
|
+ def ub_signed_overflow_san():
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('MOZ_SIGNED_OVERFLOW_SANITIZE', ub_signed_overflow_san)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-unsigned-overflow-sanitizer',
|
|
|
|
+- help='Enable UndefinedBehavior Sanitizer (Unsigned Integer Overflow Parts)')
|
|
|
|
++option('--enable-unsigned-overflow-sanitizer',
|
|
|
|
++ help='Enable UndefinedBehavior Sanitizer (Unsigned Integer Overflow Parts)')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends(when='--enable-unsigned-overflow-sanitizer')
|
|
|
|
+ def ub_unsigned_overflow_san():
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('MOZ_UNSIGNED_OVERFLOW_SANITIZE', ub_unsigned_overflow_san)
|
|
|
|
+@@ -1731,19 +1728,19 @@ option(env='RUSTFLAGS',
|
|
|
|
+ nargs=1,
|
|
|
|
+ help='Rust compiler flags')
|
|
|
|
+ set_config('RUSTFLAGS', depends('RUSTFLAGS')(lambda flags: flags))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Rust compiler flags
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+-js_option(env='RUSTC_OPT_LEVEL',
|
|
|
|
+- nargs=1,
|
|
|
|
+- help='Rust compiler optimization level (-C opt-level=%s)')
|
|
|
|
++option(env='RUSTC_OPT_LEVEL',
|
|
|
|
++ nargs=1,
|
|
|
|
++ help='Rust compiler optimization level (-C opt-level=%s)')
|
|
|
|
+
|
|
|
|
+ # --enable-release kicks in full optimizations.
|
|
|
|
+ imply_option('RUSTC_OPT_LEVEL', '2', when='--enable-release')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('RUSTC_OPT_LEVEL', moz_optimize)
|
|
|
|
+ def rustc_opt_level(opt_level_option, moz_optimize):
|
|
|
|
+ if opt_level_option:
|
|
|
|
+@@ -1853,19 +1850,20 @@ def is_linker_option_enabled(target):
|
|
|
|
+
|
|
|
|
+ option('--enable-gold',
|
|
|
|
+ env='MOZ_FORCE_GOLD',
|
|
|
|
+ help='Enable GNU Gold Linker when it is not already the default',
|
|
|
|
+ when=is_linker_option_enabled)
|
|
|
|
+
|
|
|
|
+ imply_option('--enable-linker', 'gold', when='--enable-gold')
|
|
|
|
+
|
|
|
|
+-js_option('--enable-linker', nargs=1,
|
|
|
|
+- help='Select the linker {bfd, gold, ld64, lld, lld-*}',
|
|
|
|
+- when=is_linker_option_enabled)
|
|
|
|
++option('--enable-linker', nargs=1,
|
|
|
|
++ help='Select the linker {bfd, gold, ld64, lld, lld-*}{|}',
|
|
|
|
++ default="bfd",
|
|
|
|
++ when=is_linker_option_enabled)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # No-op to enable depending on --enable-linker from default_elfhack in
|
|
|
|
+ # toolkit/moz.configure.
|
|
|
|
+ @depends('--enable-linker', when=is_linker_option_enabled)
|
|
|
|
+ def enable_linker(linker):
|
|
|
|
+ return linker
|
|
|
|
+
|
|
|
|
+@@ -2003,17 +2001,17 @@ def gcc_use_gnu_ld(select_linker, target
|
|
|
|
+ # GCC_USE_GNU_LD=1 means the linker is command line compatible with GNU ld.
|
|
|
|
+ set_config('GCC_USE_GNU_LD', gcc_use_gnu_ld)
|
|
|
|
+ add_old_configure_assignment('GCC_USE_GNU_LD', gcc_use_gnu_ld)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Assembler detection
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+-js_option(env='AS', nargs=1, help='Path to the assembler')
|
|
|
|
++option(env='AS', nargs=1, help='Path to the assembler')
|
|
|
|
+
|
|
|
|
+ @depends(target, c_compiler)
|
|
|
|
+ def as_info(target, c_compiler):
|
|
|
|
+ if c_compiler.type in ('msvc', 'clang-cl'):
|
|
|
|
+ ml = {
|
|
|
|
+ 'x86': 'ml.exe',
|
|
|
|
+ 'x86_64': 'ml64.exe',
|
|
|
|
+ 'aarch64': 'armasm64.exe',
|
|
|
|
+@@ -2105,24 +2103,24 @@ def as_outoption(as_info, target):
|
|
|
|
+ return '-o '
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ set_config('ASOUTOPTION', as_outoption)
|
|
|
|
+
|
|
|
|
+ # clang plugin handling
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+-js_option('--enable-clang-plugin', env='ENABLE_CLANG_PLUGIN',
|
|
|
|
+- help="Enable building with the mozilla clang plugin")
|
|
|
|
++option('--enable-clang-plugin', env='ENABLE_CLANG_PLUGIN',
|
|
|
|
++ help="Enable building with the Clang plugin (gecko specific static analyzers)")
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('ENABLE_CLANG_PLUGIN',
|
|
|
|
+ depends_if('--enable-clang-plugin')(lambda _: True))
|
|
|
|
+
|
|
|
|
+-js_option('--enable-mozsearch-plugin', env='ENABLE_MOZSEARCH_PLUGIN',
|
|
|
|
+- help="Enable building with the mozsearch indexer plugin")
|
|
|
|
++option('--enable-mozsearch-plugin', env='ENABLE_MOZSEARCH_PLUGIN',
|
|
|
|
++ help="Enable building with the mozsearch indexer plugin")
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('ENABLE_MOZSEARCH_PLUGIN',
|
|
|
|
+ depends_if('--enable-mozsearch-plugin')(lambda _: True))
|
|
|
|
+
|
|
|
|
+ # nasm detection
|
|
|
|
+ # ==============================================================
|
|
|
|
+ nasm = check_prog('NASM', ['nasm'], allow_missing=True, paths=toolchain_search_path)
|
|
|
|
+
|
|
|
|
+@@ -2190,33 +2188,33 @@ set_config('HAVE_NASM', have_nasm)
|
|
|
|
+ set_config('HAVE_YASM', have_yasm)
|
|
|
|
+ # Until the YASM variable is not necessary in old-configure.
|
|
|
|
+ add_old_configure_assignment('YASM', have_yasm)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Code Coverage
|
|
|
|
+ # ==============================================================
|
|
|
|
+
|
|
|
|
+-js_option('--enable-coverage', env='MOZ_CODE_COVERAGE',
|
|
|
|
+- help='Enable code coverage')
|
|
|
|
++option('--enable-coverage', env='MOZ_CODE_COVERAGE',
|
|
|
|
++ help='Enable code coverage')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-coverage')
|
|
|
|
+ def code_coverage(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_CODE_COVERAGE', code_coverage)
|
|
|
|
+ set_define('MOZ_CODE_COVERAGE', code_coverage)
|
|
|
|
+
|
|
|
|
+ # Libstdc++ compatibility hacks
|
|
|
|
+ # ==============================================================
|
|
|
|
+ #
|
|
|
|
+-js_option('--enable-stdcxx-compat', env='MOZ_STDCXX_COMPAT',
|
|
|
|
+- help='Enable compatibility with older libstdc++')
|
|
|
|
++option('--enable-stdcxx-compat', env='MOZ_STDCXX_COMPAT',
|
|
|
|
++ help='Enable compatibility with older libstdc++')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @template
|
|
|
|
+ def libstdcxx_version(var, compiler, host_or_target):
|
|
|
|
+ @depends(compiler, host_or_target, when='--enable-stdcxx-compat')
|
|
|
|
+ @imports(_from='mozbuild.configure.libstdcxx', _import='find_version')
|
|
|
|
+ def version(compiler, host_or_target):
|
|
|
|
+ if host_or_target.os == 'Android':
|
|
|
|
+@@ -2342,17 +2340,17 @@ def ar_config(link, toolchain_prefix):
|
|
|
|
+
|
|
|
|
+ ar = check_prog('AR', ar_config.names, paths=toolchain_search_path)
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('AR', ar)
|
|
|
|
+
|
|
|
|
+ set_config('AR_FLAGS', ar_config.flags)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-cpp-rtti', help='Enable C++ RTTI')
|
|
|
|
++option('--enable-cpp-rtti', help='Enable C++ RTTI')
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('_MOZ_USE_RTTI', '1', when='--enable-cpp-rtti')
|
|
|
|
+
|
|
|
|
+ # Frame pointers
|
|
|
|
+ # ==============================================================
|
|
|
|
+ @depends(c_compiler, target)
|
|
|
|
+ def frame_pointer_flags(compiler, target):
|
|
|
|
+ if compiler.type in ('msvc', 'clang-cl'):
|
|
|
|
+@@ -2369,18 +2367,18 @@ def frame_pointer_flags(compiler, target
|
|
|
|
+ @depends(moz_optimize.optimize, moz_debug, target,
|
|
|
|
+ '--enable-memory-sanitizer', '--enable-address-sanitizer',
|
|
|
|
+ '--enable-undefined-sanitizer')
|
|
|
|
+ def frame_pointer_default(optimize, debug, target, msan, asan, ubsan):
|
|
|
|
+ return bool(not optimize or debug or msan or asan or ubsan or \
|
|
|
|
+ (target.os == 'WINNT' and target.cpu in ('x86', 'aarch64')))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-frame-pointers', default=frame_pointer_default,
|
|
|
|
+- help='{Enable|Disable} frame pointers')
|
|
|
|
++option('--enable-frame-pointers', default=frame_pointer_default,
|
|
|
|
++ help='{Enable|Disable} frame pointers')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--enable-frame-pointers', frame_pointer_flags)
|
|
|
|
+ def frame_pointer_flags(enable, flags):
|
|
|
|
+ if enable:
|
|
|
|
+ return flags.enable
|
|
|
|
+ return flags.disable
|
|
|
|
+
|
|
|
|
+diff --git a/build/moz.configure/warnings.configure b/build/moz.configure/warnings.configure
|
|
|
|
+--- a/build/moz.configure/warnings.configure
|
|
|
|
++++ b/build/moz.configure/warnings.configure
|
|
|
|
+@@ -1,17 +1,17 @@
|
|
|
|
+ # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
|
|
+ # vim: set filetype=python:
|
|
|
|
+ # 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/.
|
|
|
|
+
|
|
|
|
+-js_option('--enable-warnings-as-errors', env='MOZ_ENABLE_WARNINGS_AS_ERRORS',
|
|
|
|
+- default=depends('MOZ_AUTOMATION')(lambda x: bool(x)),
|
|
|
|
+- help='{Enable|Disable} treating warnings as errors')
|
|
|
|
++option('--enable-warnings-as-errors', env='MOZ_ENABLE_WARNINGS_AS_ERRORS',
|
|
|
|
++ default=depends('MOZ_AUTOMATION')(lambda x: bool(x)),
|
|
|
|
++ help='{Enable|Disable} treating warnings as errors')
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment(
|
|
|
|
+ 'MOZ_ENABLE_WARNINGS_AS_ERRORS',
|
|
|
|
+ depends('--enable-warnings-as-errors')(lambda x: bool(x)))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--enable-warnings-as-errors')
|
|
|
|
+ def rust_warning_flags(warnings_as_errors):
|
|
|
|
+diff --git a/build/moz.configure/windows.configure b/build/moz.configure/windows.configure
|
|
|
|
+--- a/build/moz.configure/windows.configure
|
|
|
|
++++ b/build/moz.configure/windows.configure
|
|
|
|
+@@ -343,17 +343,17 @@ def dia_sdk_subdir(host_or_target, subdi
|
|
|
|
+ # args.
|
|
|
|
+ old_target = (old_target,) if old_target else ()
|
|
|
|
+ return os.path.join(dia_sdk_dir, subdir, *old_target)
|
|
|
|
+
|
|
|
|
+ return dia_sdk_subdir
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # XXX: remove after bug 1523201
|
|
|
|
+-js_option(env='WIN_DIA_SDK_BIN_DIR', nargs=1, help='Path to the DIA DLLs')
|
|
|
|
++option(env='WIN_DIA_SDK_BIN_DIR', nargs=1, help='Path to the DIA DLLs')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('WIN_DIA_SDK_BIN_DIR', dia_sdk_subdir(host, 'bin'))
|
|
|
|
+ @imports('os')
|
|
|
|
+ def dia_sdk_bin_dir(from_env, guessed):
|
|
|
|
+ if from_env:
|
|
|
|
+ if not os.path.isdir(from_env[0]):
|
|
|
|
+ die('Invalid Windows DIA SDK directory: {}'.format(from_env))
|
|
|
|
+@@ -489,22 +489,22 @@ def linker_progs_for(host_or_target):
|
|
|
|
+ def linker_progs(compiler):
|
|
|
|
+ if compiler.type == 'msvc':
|
|
|
|
+ return ('link', 'lld-link')
|
|
|
|
+ if compiler.type == 'clang-cl':
|
|
|
|
+ return ('lld-link', 'link')
|
|
|
|
+ return linker_progs
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option(env='LINKER', nargs=1, help='Path to the linker')
|
|
|
|
++option(env='LINKER', nargs=1, help='Path to the linker')
|
|
|
|
+
|
|
|
|
+ link = check_prog('LINKER', linker_progs_for(target), input='LINKER',
|
|
|
|
+ paths=toolchain_search_path)
|
|
|
|
+
|
|
|
|
+-js_option(env='HOST_LINKER', nargs=1, help='Path to the host linker')
|
|
|
|
++option(env='HOST_LINKER', nargs=1, help='Path to the host linker')
|
|
|
|
+
|
|
|
|
+ host_link = check_prog('HOST_LINKER', linker_progs_for(host),
|
|
|
|
+ input='HOST_LINKER',
|
|
|
|
+ paths=host_toolchain_search_path)
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('LINKER', link)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+diff --git a/js/ffi.configure b/js/ffi.configure
|
|
|
|
+--- a/js/ffi.configure
|
|
|
|
++++ b/js/ffi.configure
|
|
|
|
+@@ -7,18 +7,18 @@
|
|
|
|
+ @depends(target)
|
|
|
|
+ def force_system_ffi(target):
|
|
|
|
+ # Pre-emptively move to system ffi for non-tier one platforms.
|
|
|
|
+ if target.cpu not in ('x86', 'x86_64', 'arm', 'aarch64'):
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ imply_option('--with-system-ffi', force_system_ffi, "target")
|
|
|
|
+
|
|
|
|
+-js_option('--with-system-ffi',
|
|
|
|
+- help='Use system libffi (located with pkgconfig)')
|
|
|
|
++option('--with-system-ffi',
|
|
|
|
++ help='Use system libffi (located with pkgconfig)')
|
|
|
|
+
|
|
|
|
+ use_system_ffi = depends_if('--with-system-ffi')(lambda _: True)
|
|
|
|
+
|
|
|
|
+ system_ffi = pkg_check_modules('MOZ_FFI', 'libffi > 3.0.9',
|
|
|
|
+ when=use_system_ffi)
|
|
|
|
+
|
|
|
|
+ building_ffi = depends(system_ffi)(lambda v: v is None)
|
|
|
|
+
|
|
|
|
+diff --git a/js/moz.configure b/js/moz.configure
|
|
|
|
+--- a/js/moz.configure
|
|
|
|
++++ b/js/moz.configure
|
|
|
|
+@@ -1,27 +1,24 @@
|
|
|
|
+ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
|
|
+ # vim: set filetype=python:
|
|
|
|
+ # 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/.
|
|
|
|
+
|
|
|
|
+-# /!\ Use js_option() instead of option() in this file. /!\
|
|
|
|
+-# =========================================================
|
|
|
|
+-
|
|
|
|
+ @depends(build_project)
|
|
|
|
+ def js_standalone(build_project):
|
|
|
|
+ if build_project == 'js':
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ # Branding
|
|
|
|
+ # ==============================================================
|
|
|
|
+-js_option('--with-app-name', env='MOZ_APP_NAME', nargs=1,
|
|
|
|
+- help='Used for e.g. the binary program file name. If not set, '
|
|
|
|
+- 'defaults to a lowercase form of MOZ_APP_BASENAME.')
|
|
|
|
++option('--with-app-name', env='MOZ_APP_NAME', nargs=1,
|
|
|
|
++ help='Used for e.g. the binary program file name. If not set, '
|
|
|
|
++ 'defaults to a lowercase form of MOZ_APP_BASENAME.')
|
|
|
|
+
|
|
|
|
+ @depends('--with-app-name', js_standalone, moz_app_basename)
|
|
|
|
+ def moz_app_name(value, js_standalone, moz_app_basename):
|
|
|
|
+ if value:
|
|
|
|
+ return value[0]
|
|
|
|
+ if js_standalone:
|
|
|
|
+ return 'js'
|
|
|
|
+ return moz_app_basename.lower()
|
|
|
|
+@@ -33,39 +30,39 @@ include('../build/moz.configure/nspr.con
|
|
|
|
+ include('../build/moz.configure/rust.configure',
|
|
|
|
+ when='--enable-compile-environment')
|
|
|
|
+ include('../build/moz.configure/bindgen.configure',
|
|
|
|
+ when='--enable-compile-environment')
|
|
|
|
+
|
|
|
|
+ set_config('JS_STANDALONE', js_standalone)
|
|
|
|
+ set_define('JS_STANDALONE', js_standalone)
|
|
|
|
+ add_old_configure_assignment('JS_STANDALONE', js_standalone)
|
|
|
|
+-js_option('--enable-js-shell', default=js_standalone,
|
|
|
|
+- help='{Build|Do not build} the JS shell')
|
|
|
|
++option('--enable-js-shell', default=js_standalone,
|
|
|
|
++ help='{Build|Do not build} the JS shell')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-js-shell')
|
|
|
|
+ def js_disable_shell(value):
|
|
|
|
+ if not value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('JS_DISABLE_SHELL', js_disable_shell)
|
|
|
|
+
|
|
|
|
+ set_define('JS_64BIT', depends(target)(lambda t: t.bitness == 64 or None))
|
|
|
|
+
|
|
|
|
+ set_define('JS_PUNBOX64', depends(target)(lambda t: t.bitness == 64 or None))
|
|
|
|
+ set_define('JS_NUNBOX32', depends(target)(lambda t: t.bitness == 32 or None))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # SpiderMonkey as a shared library, and how its symbols are exported
|
|
|
|
+ # ==================================================================
|
|
|
|
+-js_option('--disable-shared-js', when=js_standalone,
|
|
|
|
+- help='{Create|Do not create} a shared library')
|
|
|
|
++option('--disable-shared-js', when=js_standalone,
|
|
|
|
++ help='{Create|Do not create} a shared library')
|
|
|
|
+
|
|
|
|
+-js_option('--disable-export-js', when=js_standalone,
|
|
|
|
+- help='{Mark|Do not mark} JS symbols as DLL exported/visible')
|
|
|
|
++option('--disable-export-js', when=js_standalone,
|
|
|
|
++ help='{Mark|Do not mark} JS symbols as DLL exported/visible')
|
|
|
|
+
|
|
|
|
+ @depends('--disable-shared-js', '--disable-export-js', when=js_standalone)
|
|
|
|
+ def shared_js(shared_js, export_js):
|
|
|
|
+ if shared_js:
|
|
|
|
+ if not export_js:
|
|
|
|
+ die('Must export JS symbols when building a shared library.')
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+@@ -97,32 +94,32 @@ set_define('MOZ_STATIC_JS', static_js)
|
|
|
|
+ # JIT support
|
|
|
|
+ # =======================================================
|
|
|
|
+ @depends(target)
|
|
|
|
+ def jit_default(target):
|
|
|
|
+ if target.cpu in ('x86', 'x86_64', 'arm', 'aarch64', 'mips32', 'mips64'):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+-js_option('--enable-jit',
|
|
|
|
+- default=jit_default,
|
|
|
|
+- help='{Enable|Disable} use of the JITs')
|
|
|
|
++option('--enable-jit',
|
|
|
|
++ default=jit_default,
|
|
|
|
++ help='{Enable|Disable} use of the JITs')
|
|
|
|
+
|
|
|
|
+ @deprecated_option('--enable-ion')
|
|
|
|
+ def report_deprecated(value):
|
|
|
|
+ if value:
|
|
|
|
+ die('--enable-ion is deprecated, use --enable-jit instead')
|
|
|
|
+ else:
|
|
|
|
+ die('--disable-ion is deprecated, use --disable-jit instead')
|
|
|
|
+
|
|
|
|
+ # JIT code simulator for cross compiles
|
|
|
|
+ # =======================================================
|
|
|
|
+-js_option('--enable-simulator', choices=('arm', 'arm64', 'mips32', 'mips64'),
|
|
|
|
+- nargs=1,
|
|
|
|
+- help='Enable a JIT code simulator for the specified architecture')
|
|
|
|
++option('--enable-simulator', choices=('arm', 'arm64', 'mips32', 'mips64'),
|
|
|
|
++ nargs=1,
|
|
|
|
++ help='Enable a JIT code simulator for the specified architecture')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-jit', '--enable-simulator', target)
|
|
|
|
+ def simulator(jit_enabled, simulator_enabled, target):
|
|
|
|
+ if not jit_enabled or not simulator_enabled:
|
|
|
|
+ return
|
|
|
|
+
|
|
|
|
+ sim_cpu = simulator_enabled[0]
|
|
|
|
+
|
|
|
|
+@@ -204,50 +201,50 @@ def jit_disasm_arm64(jit_enabled, simula
|
|
|
|
+ if target.cpu == 'aarch64' and debug:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('JS_DISASM_ARM64', jit_disasm_arm64)
|
|
|
|
+ set_define('JS_DISASM_ARM64', jit_disasm_arm64)
|
|
|
|
+
|
|
|
|
+ # Profiling
|
|
|
|
+ # =======================================================
|
|
|
|
+-js_option('--enable-instruments', env='MOZ_INSTRUMENTS',
|
|
|
|
+- help='Enable instruments remote profiling')
|
|
|
|
++option('--enable-instruments', env='MOZ_INSTRUMENTS',
|
|
|
|
++ help='Enable instruments remote profiling')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-instruments', target)
|
|
|
|
+ def instruments(value, target):
|
|
|
|
+ if value and target.os != 'OSX':
|
|
|
|
+ die('--enable-instruments cannot be used when targeting %s',
|
|
|
|
+ target.os)
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_INSTRUMENTS', instruments)
|
|
|
|
+ set_define('MOZ_INSTRUMENTS', instruments)
|
|
|
|
+ add_old_configure_assignment('MOZ_INSTRUMENTS', instruments)
|
|
|
|
+ imply_option('--enable-profiling', instruments, reason='--enable-instruments')
|
|
|
|
+
|
|
|
|
+-js_option('--enable-callgrind', env='MOZ_CALLGRIND',
|
|
|
|
+- help='Enable callgrind profiling')
|
|
|
|
++option('--enable-callgrind', env='MOZ_CALLGRIND',
|
|
|
|
++ help='Enable callgrind profiling')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-callgrind')
|
|
|
|
+ def callgrind(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_define('MOZ_CALLGRIND', callgrind)
|
|
|
|
+ imply_option('--enable-profiling', callgrind)
|
|
|
|
+
|
|
|
|
+ @depends(milestone)
|
|
|
|
+ def enable_profiling(milestone):
|
|
|
|
+ return milestone.is_nightly
|
|
|
|
+
|
|
|
|
+-js_option('--enable-profiling', env='MOZ_PROFILING', default=enable_profiling,
|
|
|
|
+- help='{Set|Do not set} compile flags necessary for using sampling '
|
|
|
|
+- 'profilers (e.g. shark, perf)')
|
|
|
|
++option('--enable-profiling', env='MOZ_PROFILING', default=enable_profiling,
|
|
|
|
++ help='{Set|Do not set} compile flags necessary for using sampling '
|
|
|
|
++ 'profilers (e.g. shark, perf)')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-profiling')
|
|
|
|
+ def profiling(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment('MOZ_PROFILING', profiling)
|
|
|
|
+
|
|
|
|
+@@ -264,120 +261,120 @@ def imply_vtune(value, target):
|
|
|
|
+ if value and ok_cpu and ok_kernel:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_PROFILING', profiling)
|
|
|
|
+ set_define('MOZ_PROFILING', profiling)
|
|
|
|
+ imply_option('--enable-vtune', imply_vtune, reason='--enable-profiling')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-vtune', env='MOZ_VTUNE', help='Enable VTune profiling')
|
|
|
|
++option('--enable-vtune', env='MOZ_VTUNE', help='Enable VTune profiling')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-vtune')
|
|
|
|
+ def vtune(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_VTUNE', vtune)
|
|
|
|
+ set_define('MOZ_VTUNE', vtune)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-gc-trace', env='JS_GC_TRACE',
|
|
|
|
+- help='Enable tracing of allocation and finalization')
|
|
|
|
++option('--enable-gc-trace', env='JS_GC_TRACE',
|
|
|
|
++ help='Enable tracing of allocation and finalization')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-gc-trace')
|
|
|
|
+ def gc_trace(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_define('JS_GC_TRACE', gc_trace)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-gczeal',
|
|
|
|
+- default=depends(when=moz_debug)(lambda: True),
|
|
|
|
+- help='{Enable|Disable} zealous GCing')
|
|
|
|
++option('--enable-gczeal',
|
|
|
|
++ default=depends(when=moz_debug)(lambda: True),
|
|
|
|
++ help='{Enable|Disable} zealous GCing')
|
|
|
|
+
|
|
|
|
+ set_define('JS_GC_ZEAL',
|
|
|
|
+ depends_if('--enable-gczeal')(lambda _: True))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Use a smaller chunk size for GC chunks
|
|
|
|
+ # ========================================================
|
|
|
|
+ # Use large (1MB) chunks by default. This option can be used to give
|
|
|
|
+ # smaller (currently 256K) chunks.
|
|
|
|
+-js_option('--enable-small-chunk-size',
|
|
|
|
+- help='Allocate memory for JS GC things in smaller chunks')
|
|
|
|
++option('--enable-small-chunk-size',
|
|
|
|
++ help='Allocate memory for JS GC things in smaller chunks')
|
|
|
|
+
|
|
|
|
+ set_define('JS_GC_SMALL_CHUNK_SIZE',
|
|
|
|
+ depends(when='--enable-small-chunk-size')(lambda: True))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Trace logging.
|
|
|
|
+ # =======================================================
|
|
|
|
+-js_option('--enable-trace-logging',
|
|
|
|
+- default=depends(when=moz_debug)(lambda: True),
|
|
|
|
+- help='{Enable|Disable} trace logging')
|
|
|
|
++option('--enable-trace-logging',
|
|
|
|
++ default=depends(when=moz_debug)(lambda: True),
|
|
|
|
++ help='{Enable|Disable} trace logging')
|
|
|
|
+
|
|
|
|
+ set_config('ENABLE_TRACE_LOGGING',
|
|
|
|
+ depends_if('--enable-trace-logging')(lambda x: True))
|
|
|
|
+ set_define('JS_TRACE_LOGGING',
|
|
|
|
+ depends_if('--enable-trace-logging')(lambda x: True))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Enable breakpoint for artificial OOMs
|
|
|
|
+ # =======================================================
|
|
|
|
+-js_option('--enable-oom-breakpoint',
|
|
|
|
+- help='Enable a breakpoint function for artificial OOMs')
|
|
|
|
++option('--enable-oom-breakpoint',
|
|
|
|
++ help='Enable a breakpoint function for artificial OOMs')
|
|
|
|
+
|
|
|
|
+ set_define('JS_OOM_BREAKPOINT',
|
|
|
|
+ depends_if('--enable-oom-breakpoint')(lambda _: True))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-perf', env='JS_ION_PERF',
|
|
|
|
+- help='Enable Linux perf integration')
|
|
|
|
++option('--enable-perf', env='JS_ION_PERF',
|
|
|
|
++ help='Enable Linux perf integration')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-perf')
|
|
|
|
+ def ion_perf(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_define('JS_ION_PERF', ion_perf)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-jitspew',
|
|
|
|
+- default=depends(when=moz_debug)(lambda: True),
|
|
|
|
+- help='{Enable|Disable} the Jit spew and IONFLAGS environment '
|
|
|
|
+- 'variable')
|
|
|
|
++option('--enable-jitspew',
|
|
|
|
++ default=depends(when=moz_debug)(lambda: True),
|
|
|
|
++ help='{Enable|Disable} the Jit spew and IONFLAGS environment '
|
|
|
|
++ 'variable')
|
|
|
|
+
|
|
|
|
+ set_define('JS_JITSPEW',
|
|
|
|
+ depends_if('--enable-jitspew')(lambda _: True))
|
|
|
|
+ set_config('JS_JITSPEW',
|
|
|
|
+ depends_if('--enable-jitspew')(lambda _: True))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-more-deterministic', env='JS_MORE_DETERMINISTIC',
|
|
|
|
+- help='Enable changes that make the shell more deterministic')
|
|
|
|
++option('--enable-more-deterministic', env='JS_MORE_DETERMINISTIC',
|
|
|
|
++ help='Enable changes that make the shell more deterministic')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-more-deterministic')
|
|
|
|
+ def more_deterministic(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_define('JS_MORE_DETERMINISTIC', more_deterministic)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # CTypes
|
|
|
|
+ # =======================================================
|
|
|
|
+ @depends(js_standalone)
|
|
|
|
+ def ctypes_default(js_standalone):
|
|
|
|
+ return not js_standalone
|
|
|
|
+
|
|
|
|
+-js_option('--enable-ctypes',
|
|
|
|
+- default=ctypes_default,
|
|
|
|
+- help='{Enable|Disable} js-ctypes')
|
|
|
|
++option('--enable-ctypes',
|
|
|
|
++ default=ctypes_default,
|
|
|
|
++ help='{Enable|Disable} js-ctypes')
|
|
|
|
+
|
|
|
|
+ build_ctypes = depends_if('--enable-ctypes')(lambda _: True)
|
|
|
|
+
|
|
|
|
+ set_config('BUILD_CTYPES', build_ctypes)
|
|
|
|
+ set_define('BUILD_CTYPES', build_ctypes)
|
|
|
|
+
|
|
|
|
+ set_config('JS_HAS_CTYPES', build_ctypes)
|
|
|
|
+ set_define('JS_HAS_CTYPES', build_ctypes)
|
|
|
|
+@@ -387,17 +384,17 @@ def ctypes_and_compile_environment(ctype
|
|
|
|
+ return ctypes and compile_environment
|
|
|
|
+
|
|
|
|
+ include('ffi.configure', when=ctypes_and_compile_environment)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Support various fuzzing options
|
|
|
|
+ # ==============================================================
|
|
|
|
+ with only_when('--enable-compile-environment'):
|
|
|
|
+- js_option('--enable-fuzzing', help='Enable fuzzing support')
|
|
|
|
++ option('--enable-fuzzing', help='Enable fuzzing support')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-fuzzing')
|
|
|
|
+ def enable_fuzzing(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ @depends(try_compile(body='__AFL_COMPILER;',
|
|
|
|
+ check_msg='for AFL compiler',
|
|
|
|
+@@ -428,51 +425,51 @@ with only_when('--enable-compile-environ
|
|
|
|
+ add_old_configure_assignment('LIBFUZZER', enable_libfuzzer)
|
|
|
|
+
|
|
|
|
+ set_config('FUZZING_INTERFACES', enable_fuzzing_interfaces)
|
|
|
|
+ set_define('FUZZING_INTERFACES', enable_fuzzing_interfaces)
|
|
|
|
+ add_old_configure_assignment('FUZZING_INTERFACES', enable_fuzzing_interfaces)
|
|
|
|
+
|
|
|
|
+ # Enable pipeline operator
|
|
|
|
+ # ===================================================
|
|
|
|
+-js_option('--enable-pipeline-operator', default=False, help='Enable pipeline operator')
|
|
|
|
++option('--enable-pipeline-operator', default=False, help='Enable pipeline operator')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-pipeline-operator')
|
|
|
|
+ def enable_pipeline_operator(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
|
|
|
|
+ set_define('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Initial support for new regexp engine
|
|
|
|
+ # ==================================================
|
|
|
|
+
|
|
|
|
+-js_option('--enable-new-regexp', default=False, help='Enable new regexp engine')
|
|
|
|
++option('--enable-new-regexp', default=False, help='Enable new regexp engine'
|
|
|
|
+
|
|
|
|
+ @depends('--enable-new-regexp')
|
|
|
|
+ def enable_new_regexp(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('ENABLE_NEW_REGEXP', enable_new_regexp)
|
|
|
|
+ set_define('ENABLE_NEW_REGEXP', enable_new_regexp)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # ECMAScript Internationalization API Support (uses ICU)
|
|
|
|
+ # ======================================================
|
|
|
|
+-js_option('--with-system-icu', help='Use system ICU')
|
|
|
|
++option('--with-system-icu', help='Use system ICU')
|
|
|
|
+
|
|
|
|
+ system_icu = pkg_check_modules('MOZ_ICU', 'icu-i18n >= 67.1', when='--with-system-icu')
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_SYSTEM_ICU', True, when=system_icu)
|
|
|
|
+ set_define('MOZ_SYSTEM_ICU', True, when=system_icu)
|
|
|
|
+
|
|
|
|
+-js_option('--without-intl-api', help='Disable ECMAScript Internationalization API')
|
|
|
|
++option('--without-intl-api', help='Disable ECMAScript Internationalization API')
|
|
|
|
+
|
|
|
|
+ @depends('--with-intl-api', js_standalone)
|
|
|
|
+ def check_intl_api(enabled, js_standalone):
|
|
|
|
+ if not enabled and not js_standalone:
|
|
|
|
+ die('--without-intl-api is not supported')
|
|
|
|
+
|
|
|
|
+ set_config('JS_HAS_INTL_API', True, when='--with-intl-api')
|
|
|
|
+ set_define('JS_HAS_INTL_API', True, when='--with-intl-api')
|
|
|
|
+@@ -509,27 +506,27 @@ def can_build_data_file(yasm, gnu_as, ta
|
|
|
|
+ return
|
|
|
|
+ if not yasm and not gnu_as:
|
|
|
|
+ die('Building ICU requires either yasm or a GNU assembler. If you do not have '
|
|
|
|
+ 'either of those available for this platform you must use --without-intl-api')
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Options for generating the shell as a script
|
|
|
|
+ # ============================================
|
|
|
|
+-js_option('--with-qemu-exe', nargs=1, help='Use path as an arm emulator on host platforms')
|
|
|
|
++option('--with-qemu-exe', nargs=1, help='Use path as an arm emulator on host platforms')
|
|
|
|
+ set_config('QEMU_EXE', depends_if('--with-qemu-exe')(lambda x: x))
|
|
|
|
+
|
|
|
|
+-js_option('--with-cross-lib', nargs=1, default=depends(target.alias)(lambda x: '/usr/%s' % x),
|
|
|
|
+- help='Use dir as the location for arm libraries')
|
|
|
|
++option('--with-cross-lib', nargs=1, default=depends(target.alias)(lambda x: '/usr/%s' % x),
|
|
|
|
++ help='Use dir as the location for arm libraries')
|
|
|
|
+ set_config('CROSS_LIB', depends_if('--with-cross-lib')(lambda x: x))
|
|
|
|
+
|
|
|
|
+ # Enable static checking using sixgill
|
|
|
|
+ # ====================================
|
|
|
|
+
|
|
|
|
+-js_option('--with-sixgill', nargs=1, help='Enable static checking of code using sixgill')
|
|
|
|
++option('--with-sixgill', nargs=1, help='Enable static checking of code using sixgill')
|
|
|
|
+
|
|
|
|
+ @depends_if('--with-sixgill')
|
|
|
|
+ @imports('os')
|
|
|
|
+ def sixgill(value):
|
|
|
|
+ for f in ('bin/xdbfind', 'gcc/xgill.so', 'scripts/wrap_gcc/g++'):
|
|
|
|
+ if not os.path.exists(os.path.join(value[0], f)):
|
|
|
|
+ die('The sixgill plugin and binaries are not at the specified path')
|
|
|
|
+ return value[0]
|
|
|
|
+@@ -538,18 +535,18 @@ set_config('SIXGILL_PATH', sixgill)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # Support for readline
|
|
|
|
+ # =====================================================
|
|
|
|
+ @depends('--enable-js-shell', target_is_windows, compile_environment)
|
|
|
|
+ def editline(js_shell, is_windows, compile_environment):
|
|
|
|
+ return js_shell and not is_windows and compile_environment
|
|
|
|
+
|
|
|
|
+-js_option('--enable-readline', help='Link js shell to system readline library',
|
|
|
|
+- when=editline)
|
|
|
|
++option('--enable-readline', help='Link js shell to system readline library',
|
|
|
|
++ when=editline)
|
|
|
|
+
|
|
|
|
+ has_readline = check_symbol('readline', flags=['-lreadline'], when='--enable-readline',
|
|
|
|
+ onerror=lambda: die('No system readline library found'))
|
|
|
|
+
|
|
|
|
+ set_config('EDITLINE_LIBS', ['-lreadline'], when=has_readline)
|
|
|
|
+
|
|
|
|
+ @depends('--enable-readline', editline, when=editline)
|
|
|
|
+ def bundled_editline(readline, editline):
|
|
|
|
+diff --git a/moz.configure b/moz.configure
|
|
|
|
+--- a/moz.configure
|
|
|
|
++++ b/moz.configure
|
|
|
|
+@@ -45,29 +45,29 @@ option('--disable-compile-environment',
|
|
|
|
+ @depends('--disable-compile-environment')
|
|
|
|
+ def compile_environment(compile_env):
|
|
|
|
+ if compile_env:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('COMPILE_ENVIRONMENT', compile_environment)
|
|
|
|
+ add_old_configure_assignment('COMPILE_ENVIRONMENT', compile_environment)
|
|
|
|
+
|
|
|
|
+-js_option('--disable-tests',
|
|
|
|
+- help='Do not build test libraries & programs')
|
|
|
|
++option('--disable-tests',
|
|
|
|
++ help='Do not build test libraries & programs')
|
|
|
|
+
|
|
|
|
+ @depends('--disable-tests')
|
|
|
|
+ def enable_tests(value):
|
|
|
|
+ if value:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('ENABLE_TESTS', enable_tests)
|
|
|
|
+ set_define('ENABLE_TESTS', enable_tests)
|
|
|
|
+
|
|
|
|
+-js_option(env='MOZILLA_OFFICIAL',
|
|
|
|
+- help='Build an official release')
|
|
|
|
++option(env='MOZILLA_OFFICIAL',
|
|
|
|
++ help='Build an official release')
|
|
|
|
+
|
|
|
|
+ @depends('MOZILLA_OFFICIAL')
|
|
|
|
+ def mozilla_official(official):
|
|
|
|
+ if official:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('MOZILLA_OFFICIAL', mozilla_official)
|
|
|
|
+ set_define('MOZILLA_OFFICIAL', mozilla_official)
|
|
|
|
+@@ -89,36 +89,37 @@ def linux_gtest_defines(target, enable_t
|
|
|
|
+
|
|
|
|
+ set_define('GTEST_OS_LINUX_ANDROID',
|
|
|
|
+ linux_gtest_defines.os_linux_android)
|
|
|
|
+ set_define('GTEST_USE_OWN_TR1_TUPLE',
|
|
|
|
+ linux_gtest_defines.use_own_tr1_tuple)
|
|
|
|
+ set_define('GTEST_HAS_CLONE',
|
|
|
|
+ linux_gtest_defines.has_clone)
|
|
|
|
+
|
|
|
|
+-js_option('--enable-debug',
|
|
|
|
+- nargs='?',
|
|
|
|
+- help='Enable building with developer debug info '
|
|
|
|
+- '(using the given compiler flags).')
|
|
|
|
++option('--enable-debug',
|
|
|
|
++ nargs='?',
|
|
|
|
++ help='Enable building with developer debug info '
|
|
|
|
++ '(using the given compiler flags).')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-debug')
|
|
|
|
+ def moz_debug(debug):
|
|
|
|
+ if debug:
|
|
|
|
+ return bool(debug)
|
|
|
|
+
|
|
|
|
+ set_config('MOZ_DEBUG', moz_debug)
|
|
|
|
+ set_define('MOZ_DEBUG', moz_debug)
|
|
|
|
+ # Override any value MOZ_DEBUG may have from the environment when passing it
|
|
|
|
+ # down to old-configure.
|
|
|
|
+ add_old_configure_assignment('MOZ_DEBUG',
|
|
|
|
+ depends('--enable-debug')(lambda x: bool(x)))
|
|
|
|
+
|
|
|
|
+-js_option('--enable-rust-debug',
|
|
|
|
+- help='{Build|Do not build} Rust code with debug assertions turned '
|
|
|
|
+- 'on.')
|
|
|
|
++option('--enable-rust-debug',
|
|
|
|
++ default=depends(when='--enable-debug')(lambda: True),
|
|
|
|
++ help='{Build|Do not build} Rust code with debug assertions turned '
|
|
|
|
++ 'on.')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-rust-debug', '--enable-debug')
|
|
|
|
+ def debug_rust(value, debug):
|
|
|
|
+ if value.origin == 'default':
|
|
|
|
+ return bool(debug) or None
|
|
|
|
+ elif bool(value):
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+@@ -138,18 +139,18 @@ include('build/moz.configure/memory.conf
|
|
|
|
+ include('build/moz.configure/headers.configure',
|
|
|
|
+ when='--enable-compile-environment')
|
|
|
|
+ include('build/moz.configure/warnings.configure',
|
|
|
|
+ when='--enable-compile-environment')
|
|
|
|
+ include('build/moz.configure/flags.configure',
|
|
|
|
+ when='--enable-compile-environment')
|
|
|
|
+ # rust.configure is included by js/moz.configure.
|
|
|
|
+
|
|
|
|
+-js_option('--enable-valgrind',
|
|
|
|
+- help='Enable Valgrind integration hooks')
|
|
|
|
++option('--enable-valgrind',
|
|
|
|
++ help='Enable Valgrind integration hooks')
|
|
|
|
+
|
|
|
|
+ valgrind_h = check_header('valgrind/valgrind.h', when='--enable-valgrind')
|
|
|
|
+
|
|
|
|
+ @depends('--enable-valgrind', valgrind_h)
|
|
|
|
+ def check_valgrind(valgrind, valgrind_h):
|
|
|
|
+ if valgrind:
|
|
|
|
+ if not valgrind_h:
|
|
|
|
+ die('--enable-valgrind specified but Valgrind is not installed')
|
|
|
|
+@@ -585,60 +586,60 @@ def nsis_flags(host):
|
|
|
|
+ return '-nocd'
|
|
|
|
+ return ''
|
|
|
|
+
|
|
|
|
+ set_config('MAKENSISU_FLAGS', nsis_flags)
|
|
|
|
+
|
|
|
|
+ check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-dtrace', help='Build with dtrace support')
|
|
|
|
++option('--enable-dtrace', help='Build with dtrace support')
|
|
|
|
+
|
|
|
|
+ dtrace = check_header('sys/sdt.h', when='--enable-dtrace',
|
|
|
|
+ onerror=lambda: die('dtrace enabled but sys/sdt.h not found'))
|
|
|
|
+
|
|
|
|
+ set_config('HAVE_DTRACE', True, when=dtrace)
|
|
|
|
+ set_define('INCLUDE_MOZILLA_DTRACE', True, when=dtrace)
|
|
|
|
+ add_old_configure_assignment('enable_dtrace', 'yes', when=dtrace)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--disable-icf', help='Disable Identical Code Folding')
|
|
|
|
++option('--disable-icf', help='Disable Identical Code Folding')
|
|
|
|
+
|
|
|
|
+ add_old_configure_assignment(
|
|
|
|
+ 'MOZ_DISABLE_ICF', '1', when=depends('--enable-icf')(lambda x: not x))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-js_option('--enable-strip', when=compile_environment,
|
|
|
|
+- help='Enable stripping of libs & executables')
|
|
|
|
++option('--enable-strip', when=compile_environment,
|
|
|
|
++ help='Enable stripping of libs & executables')
|
|
|
|
+
|
|
|
|
+ # This should be handled as a `when` once bug 1617793 is fixed.
|
|
|
|
+ @depends('--enable-strip', c_compiler, when=compile_environment)
|
|
|
|
+ def enable_strip(strip, c_compiler):
|
|
|
|
+ if strip and c_compiler.type != 'clang-cl':
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('ENABLE_STRIP', enable_strip)
|
|
|
|
+
|
|
|
|
+-js_option('--disable-install-strip', when=compile_environment,
|
|
|
|
+- help='Enable stripping of libs & executables when packaging')
|
|
|
|
++option('--disable-install-strip', when=compile_environment,
|
|
|
|
++ help='Enable stripping of libs & executables when packaging')
|
|
|
|
+
|
|
|
|
+ # This should be handled as a `when` once bug 1617793 is fixed.
|
|
|
|
+ @depends('--enable-install-strip', c_compiler, when=compile_environment)
|
|
|
|
+ def enable_install_strip(strip, c_compiler):
|
|
|
|
+ if strip and c_compiler.type != 'clang-cl':
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ set_config('PKG_STRIP', enable_install_strip)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @depends('--enable-strip', '--enable-install-strip', when=compile_environment)
|
|
|
|
+ def strip(strip, install_strip):
|
|
|
|
+ return strip or install_strip
|
|
|
|
+
|
|
|
|
+-js_option(env='STRIP_FLAGS', nargs=1, when=strip, help='Flags for the strip command')
|
|
|
|
++option(env='STRIP_FLAGS', nargs=1, when=strip, help='Flags for the strip command')
|
|
|
|
+
|
|
|
|
+ @depends('STRIP_FLAGS', profiling, target, when=strip)
|
|
|
|
+ def strip_flags(flags, profiling, target):
|
|
|
|
+ if flags:
|
|
|
|
+ return flags[0].split()
|
|
|
|
+ if profiling:
|
|
|
|
+ # Only strip debug info and symbols when profiling is enabled, keeping
|
|
|
|
+ # local symbols.
|