Bug 1411081 - Make ./configure --help work again; r?glandium draft
authorGregory Szorc <gps@mozilla.com>
Tue, 24 Oct 2017 12:56:10 -0700
changeset 685626 22ecbf738ed189397408f3a192e214ccb5d36e5e
parent 685447 967c95cee709756596860ed2a3e6ac06ea3a053f
child 685627 e31ae80a01b120c7106bd3e2dc517010cb553bca
push id86007
push usergszorc@mozilla.com
push dateTue, 24 Oct 2017 23:50:58 +0000
reviewersglandium
bugs1411081, 1405982
milestone58.0a1
Bug 1411081 - Make ./configure --help work again; r?glandium It stopped working due to 370a4a2a7898 (bug 1405982). MozReview-Commit-ID: 2gCmAAsE0qW
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1279,17 +1279,23 @@ def is_linker_option_enabled(target):
         return True
 
 
 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')
+# This simple wrapper is needed so --enable-gold is registered with help.
+@depends('--enable-gold', when=is_linker_option_enabled)
+def gold(flag):
+    if flag:
+        return flag
+
+imply_option('--enable-linker', 'gold', when=gold)
 
 
 @imports('os')
 @imports('shutil')
 def enable_gnu_linker(enable_gold_option, c_compiler, developer_options, build_env,
                       toolchain_flags, linker_name):
     # Used to check the kind of linker
     version_check = ['-Wl,--version']