Bug 1258618 - Use True instead of '1' for set_config. r=nalexander

This commit is contained in:
Mike Hommey 2016-03-22 13:34:03 +09:00
Родитель b43aae42ec
Коммит 521861c0e2
5 изменённых файлов: 27 добавлений и 27 удалений

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

@ -519,7 +519,7 @@ def target_variables(target):
set_config('CPU_ARCH', target.cpu)
if target.cpu in ('x86', 'x86_64'):
set_config('INTEL_ARCHITECTURE', '1')
set_config('INTEL_ARCHITECTURE', True)
set_config('TARGET_CPU', target.raw_cpu)
set_config('TARGET_OS', target.raw_os)
@ -624,12 +624,12 @@ def milestone(build_env):
is_nightly = is_release = False
if 'a1' in milestone:
set_config('NIGHTLY_BUILD', '1')
set_config('NIGHTLY_BUILD', True)
set_define('NIGHTLY_BUILD', '1')
add_old_configure_assignment('NIGHTLY_BUILD', '1')
is_nightly = True
elif 'a' not in milestone:
set_config('RELEASE_BUILD', '1')
set_config('RELEASE_BUILD', True)
set_define('RELEASE_BUILD', '1')
add_old_configure_assignment('RELEASE_BUILD', '1')
is_release = True

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

@ -21,7 +21,7 @@ option(env='JS_STANDALONE', default=building_js,
@depends('JS_STANDALONE')
def js_standalone(value):
if value:
set_config('JS_STANDALONE', '1')
set_config('JS_STANDALONE', True)
add_old_configure_assignment('JS_STANDALONE', '1')
@ -31,7 +31,7 @@ js_option('--disable-js-shell', default=building_js,
@depends('--disable-js-shell')
def js_shell(value):
if not value:
set_config('JS_DISABLE_SHELL', '1')
set_config('JS_DISABLE_SHELL', True)
# Use SpiderMonkey Promise implementation if it's enabled
@ -41,7 +41,7 @@ js_option('--enable-sm-promise', help='Enable SpiderMonkey promises')
@depends('--enable-sm-promise')
def sm_promise(value):
if value:
set_config('SPIDERMONKEY_PROMISE', '1')
set_config('SPIDERMONKEY_PROMISE', True)
set_define('SPIDERMONKEY_PROMISE', '1')
@ -58,7 +58,7 @@ def static_js(shared_js, export_js):
if shared_js:
if not export_js:
error('Must export JS symbols when building a shared library.')
set_config('JS_SHARED_LIBRARY', '1')
set_config('JS_SHARED_LIBRARY', True)
add_old_configure_assignment('JS_SHARED_LIBRARY', '1')
else:
if export_js:
@ -102,7 +102,7 @@ def instruments(value, target):
error('--enable-instruments cannot be used when targeting %s'
% target.os)
if value:
set_config('MOZ_INSTRUMENTS', '1')
set_config('MOZ_INSTRUMENTS', True)
set_define('MOZ_INSTRUMENTS', '1')
add_old_configure_assignment('MOZ_INSTRUMENTS', '1')
imply_option('--enable-profiling', reason='--enable-instruments')
@ -125,7 +125,7 @@ js_option('--enable-profiling', env='MOZ_PROFILING',
@depends('--enable-profiling', target)
def profiling(value, target):
if value:
set_config('MOZ_PROFILING', '1')
set_config('MOZ_PROFILING', True)
set_define('MOZ_PROFILING', '1')
add_old_configure_assignment('MOZ_PROFILING', '1')
@ -139,5 +139,5 @@ js_option('--enable-vtune', env='MOZ_VTUNE', help='Enable vtune profiling')
@depends('--enable-vtune')
def vtune(value):
if value:
set_config('MOZ_VTUNE', '1')
set_config('MOZ_VTUNE', True)
set_define('MOZ_VTUNE', '1')

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

@ -15,7 +15,7 @@ option('--with-gradle', nargs='?',
@depends('--with-gradle', check_build_environment)
def gradle(value, build_env):
if value:
set_config('MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE', '1')
set_config('MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE', True)
gradle = value[0] if len(value) else \
os.path.join(build_env.topsrcdir, 'gradlew')

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

@ -20,7 +20,7 @@ include('build/moz.configure/checks.configure')
@depends(milestone)
def e10s_testing_only(milestone):
if not milestone.is_release:
set_config('E10S_TESTING_ONLY', '1')
set_config('E10S_TESTING_ONLY', True)
set_define('E10S_TESTING_ONLY', '1')
@ -31,7 +31,7 @@ option('--enable-artifact-builds', env='MOZ_ARTIFACT_BUILDS',
def artifact_builds(value):
if value:
imply_option('--disable-compile-environment')
set_config('MOZ_ARTIFACT_BUILDS', '1')
set_config('MOZ_ARTIFACT_BUILDS', True)
return bool(value)
@ -41,7 +41,7 @@ option('--disable-compile-environment',
@depends('--disable-compile-environment')
def compile_environment(value):
if value:
set_config('COMPILE_ENVIRONMENT', '1')
set_config('COMPILE_ENVIRONMENT', True)
add_old_configure_assignment('COMPILE_ENVIRONMENT', '1')
return bool(value)
@ -161,7 +161,7 @@ def yasm_asflags(yasm, target):
if asflags:
asflags += ' -rnasm -pnasm'
set_config('YASM_ASFLAGS', asflags)
set_config('HAVE_YASM', '1')
set_config('HAVE_YASM', True)
# Until the YASM variable is not necessary in old-configure.
add_old_configure_assignment('YASM', '1')
return asflags

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

@ -27,7 +27,7 @@ option('--enable-jprof', env='MOZ_JPROF',
@depends('--enable-jprof')
def jprof(value):
if value:
set_config('MOZ_JPROF', '1')
set_config('MOZ_JPROF', True)
set_define('MOZ_JPROF', '1')
imply_option('--enable-profiling')
@ -43,7 +43,7 @@ def sps_profiler(target):
@depends(sps_profiler)
def sps_profiler_define(value):
if value:
set_config('MOZ_ENABLE_PROFILER_SPS', '1')
set_config('MOZ_ENABLE_PROFILER_SPS', True)
set_define('MOZ_ENABLE_PROFILER_SPS', '1')
@ -54,7 +54,7 @@ option('--enable-dmd', env='MOZ_DMD',
@depends('--enable-dmd')
def dmd(value):
if value:
set_config('MOZ_DMD', '1')
set_config('MOZ_DMD', True)
set_define('MOZ_DMD', '1')
add_old_configure_assignment('MOZ_DMD', '1')
imply_option('--enable-profiling')
@ -157,9 +157,9 @@ def x11(value, toolkit):
% ','.join(x11_toolkits))
if value and toolkit in x11_toolkits:
set_config('MOZ_ENABLE_XREMOTE', '1')
set_config('MOZ_ENABLE_XREMOTE', True)
set_define('MOZ_ENABLE_XREMOTE', '1')
set_config('MOZ_X11', '1')
set_config('MOZ_X11', True)
set_define('MOZ_X11', '1')
add_old_configure_assignment('MOZ_X11', '1')
@ -188,7 +188,7 @@ def gl_provider(value, x11):
@depends(toolkit)
def pdf_printing(toolkit):
if toolkit in ('windows', 'gtk2', 'gtk3', 'qt', 'android', 'gonk'):
set_config('MOZ_PDF_PRINTING', '1')
set_config('MOZ_PDF_PRINTING', True)
set_config('PDF_SURFACE_FEATURE', '#define CAIRO_HAS_PDF_SURFACE 1')
else:
# CONFIGURE_SUBST_FILES need explicit empty values.
@ -204,7 +204,7 @@ option(env='MOZ_INSTRUMENT_EVENT_LOOP',
def instrument_event_loop(value, toolkit):
if value or (toolkit in ('windows', 'gtk2', 'gtk3', 'cocoa', 'android',
'gonk') and value.origin == 'default'):
set_config('MOZ_INSTRUMENT_EVENT_LOOP', '1')
set_config('MOZ_INSTRUMENT_EVENT_LOOP', True)
set_define('MOZ_INSTRUMENT_EVENT_LOOP', '1')
@ -225,7 +225,7 @@ def fc_freetype(value, toolkit):
@depends(toolkit)
def applemedia(toolkit):
if toolkit in ('cocoa', 'uikit'):
set_config('MOZ_APPLEMEDIA', '1')
set_config('MOZ_APPLEMEDIA', True)
set_define('MOZ_APPLEMEDIA', '1')
add_old_configure_assignment('MOZ_APPLEMEDIA', '1')
return True
@ -249,7 +249,7 @@ def wmf(value, target):
error('Cannot enable Windows Media Foundation support on %s'
% target.os)
if enabled:
set_config('MOZ_WMF', '1')
set_config('MOZ_WMF', True)
set_define('MOZ_WMF', '1')
return enabled
@ -266,7 +266,7 @@ def ffmpeg(value, target):
enabled = target.os not in ('Android', 'WINNT')
if enabled:
set_define('MOZ_FFMPEG', '1')
set_config('MOZ_FFMPEG', '1')
set_config('MOZ_FFMPEG', True)
imply_option('--enable-fmp4', '--enable-ffmpeg')
return enabled
@ -283,7 +283,7 @@ def fmp4(value, target, wmf, applemedia):
# target.os == 'Android' includes all B2G versions
enabled = wmf or applemedia or target.os == 'Android'
if enabled:
set_config('MOZ_FMP4', '1')
set_config('MOZ_FMP4', True)
set_define('MOZ_FMP4', '1')
add_old_configure_assignment('MOZ_FMP4', '1')
return enabled
@ -303,7 +303,7 @@ def eme(value, fmp4):
error('Encrypted Media Extension support requires '
'Fragmented MP4 support')
if enabled:
set_config('MOZ_EME', '1')
set_config('MOZ_EME', True)
set_define('MOZ_EME', '1')
# Theoretically, we could pass `value` directly when it is a
# PositiveOptionValue, but somehow, the JSON serialization in configure.py