Bug 1405982 - Rename the method "build_not_win_mac" to "is_linker_option_enabled" match what it is doing r?glandium draft
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 10 Oct 2017 12:01:32 +0200
changeset 678482 b26fb73ffa3909254550531ce2d00d5a434b1dbd
parent 677218 83b70c4e4ef92d28201624342098a24c1eacdca2
child 678487 375f57c8dbdb00cb2b9c22dbb0fe3be12e6e3aec
push id83936
push userbmo:sledru@mozilla.com
push dateWed, 11 Oct 2017 13:49:44 +0000
reviewersglandium
bugs1405982
milestone58.0a1
Bug 1405982 - Rename the method "build_not_win_mac" to "is_linker_option_enabled" match what it is doing r?glandium MozReview-Commit-ID: 3Kv9z79Cct8
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1197,29 +1197,27 @@ def developer_options(value):
 
 add_old_configure_assignment('DEVELOPER_OPTIONS', developer_options)
 set_config('DEVELOPER_OPTIONS', developer_options)
 
 # Linker detection
 # ==============================================================
 
 @depends(target)
-def build_not_win_mac(target):
+def is_linker_option_enabled(target):
     if target.kernel not in ('Darwin', 'WINNT', 'SunOS'):
         return True
 
 
 option('--enable-gold',
        env='MOZ_FORCE_GOLD',
        help='Enable GNU Gold Linker when it is not already the default',
-       when=build_not_win_mac)
+       when=is_linker_option_enabled)
 
-imply_option('--enable-linker',
-             depends_if('--enable-gold', when=build_not_win_mac)(lambda x: 'gold'),
-             when=build_not_win_mac)
+imply_option('--enable-linker', 'gold', when='--enable-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']
     cmd_base = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags
@@ -1285,20 +1283,20 @@ def enable_gnu_linker(enable_gold_option
     # For other platforms without gold or the GNU linker
     return namespace(
         KIND='other'
     )
 
 js_option('--enable-linker', nargs=1,
           choices=('bfd', 'gold', 'lld', 'other'),
           help='Select the linker',
-          when=build_not_win_mac)
+          when=is_linker_option_enabled)
 
 @depends('--enable-linker', c_compiler, developer_options, check_build_environment,
-         extra_toolchain_flags, when=build_not_win_mac)
+         extra_toolchain_flags, when=is_linker_option_enabled)
 @checking('for linker', lambda x: x.KIND)
 def select_linker(linker, c_compiler, developer_options, build_env, toolchain_flags):
     linker = linker[0] if linker else 'other'
     if linker in ('gold', 'bfd', 'other'):
         return enable_gnu_linker(linker == 'gold', c_compiler, developer_options,
                                  build_env, toolchain_flags, linker)
     if linker == 'lld':
         version_check = ['-Wl,--version']