Bug 1411462 - Make ./configure --help work again; r?glandium draft
authorGregory Szorc <gps@mozilla.com>
Tue, 24 Oct 2017 12:56:10 -0700
changeset 686253 9be5032406443f67abb2abf68cc68772f6a01fa9
parent 686074 dfb54d604158f5605fb07f41751e36bfef641a2f
child 686254 248a307d72a432a14cc056dc703955fb4e572e22
push id86145
push usergszorc@mozilla.com
push dateWed, 25 Oct 2017 16:56:02 +0000
reviewersglandium
bugs1411462, 1405982
milestone58.0a1
Bug 1411462 - 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']