Bug 1300290 - Avoid --enable-dmd and --enable-stylo setting conflicting --enable-jemalloc values; r=glandium
authorGregory Szorc <gps@mozilla.com>
Wed, 30 Nov 2016 22:17:59 -0800
changeset 325105 e907fb6bfcfe40e6c4b28c406f8784c4b919ba2c
parent 325104 1e40fb1d78e33faa55545a4c51429458eeb9678e
child 325106 2a82f16d575ed10d4d4e10cd64ccff3661a93e5b
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
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.')
@@ -566,17 +566,26 @@ option('--enable-stylo', env='STYLO_ENAB
 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.')
 def servo_target_dir(value):
     return value[0]