Bug 1300290 - Avoid --enable-dmd and --enable-stylo setting conflicting --enable-jemalloc values; r?glandium
Before, --enable-dmd implied --enable-jemalloc. If --enable-stylo was
also set, it tried to imply --enable-jemalloc=moz. Configure barfed
due to setting the value twice.
The commit refactors the logic for implying the --enable-jemalloc value
to set the proper value depending on the state of dmd and stylo.
MozReview-Commit-ID: 1wKE9Cs1Umt
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -60,17 +60,17 @@ option('--enable-dmd', env='MOZ_DMD',
def dmd(value):
if value:
return True
set_config('MOZ_DMD', dmd)
set_define('MOZ_DMD', dmd)
add_old_configure_assignment('MOZ_DMD', dmd)
imply_option('--enable-profiling', dmd)
-imply_option('--enable-jemalloc', dmd)
+# --enable-jemalloc is implied below.
imply_option('--enable-replace-malloc', dmd)
# JACK cubeb backend
# ==============================================================
option('--enable-jack', env='MOZ_JACK',
help='Enable JACK audio backend.')
@depends('--enable-jack')
@@ -566,17 +566,26 @@ option('--enable-stylo', env='STYLO_ENAB
@depends('--enable-stylo')
def stylo(value):
if value:
return True
set_config('MOZ_STYLO', stylo)
set_define('MOZ_STYLO', stylo)
-imply_option('--enable-jemalloc', depends_if('--enable-stylo')(lambda _: 'moz'))
+
+@depends(stylo, dmd)
+def jemalloc(stylo, dmd):
+ if stylo:
+ return 'moz'
+ elif dmd:
+ return True
+
+imply_option('--enable-jemalloc', jemalloc,
+ reason='--enable-dmd or --enable-stylo')
option('--with-servo', env='SERVO_TARGET_DIR', nargs=1,
help='Absolute path of the target directory where libgeckoservo can '
'be found. This is generally servo_src_dir/target/release.')
@depends_if('--with-servo')
def servo_target_dir(value):
return value[0]