Bug 1260066 - Move add_old_configure_arg to the global scope. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 28 Mar 2016 07:12:42 +0900
changeset 290994 26a63e35fb25be588548f81e6067a24674e5c3a3
parent 290993 09c22809d1dccf9604f585fd57b07a797826fb68
child 290995 7c1b33d35a5b863984f29f6e91963110e38e2cdc
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1260066
milestone48.0a1
Bug 1260066 - Move add_old_configure_arg to the global scope. r=nalexander We've done this for set_config, set_define, imply_option, and add_old_configure_assignment. Do it for add_old_configure_arg as well.
build/moz.configure/init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -143,19 +143,20 @@ def add_old_configure_assignment(var, va
             assignments.append('%s=' % var)
         else:
             if isinstance(value, (list, tuple)):
                 value = ' '.join(quote(v) for v in value)
             assignments.append('%s=%s' % (var, quote(value)))
 
 @template
 def add_old_configure_arg(arg):
-    @depends(extra_old_configure_args)
-    def add_arg(args):
-        args.append(arg)
+    @depends(extra_old_configure_args, arg)
+    def add_arg(args, arg):
+        if arg:
+            args.append(arg)
 
 
 option(env='PYTHON', nargs=1, help='Python interpreter')
 
 # Setup python virtualenv
 # ==============================================================
 @depends('PYTHON', check_build_environment, mozconfig)
 @imports('os')
@@ -465,27 +466,33 @@ def host(value, shell):
 @depends('--target', host, shell)
 @checking('for target system type', lambda t: t.alias)
 def target(value, host, shell):
     if not value:
         return host
     return split_triplet(config_sub(shell, value[0]))
 
 
+# Autoconf needs these set
+@depends(host)
+def host_for_old_configure(host):
+    return '--host=%s' % host.alias
+
+add_old_configure_arg(host_for_old_configure)
+
 @depends(host, target)
-def host_and_target_for_old_configure(host, target):
-    # Autoconf needs these set
-    add_old_configure_arg('--host=%s' % host.alias)
-
+def target_for_old_configure(host, target):
     target_alias = target.alias
     # old-configure does plenty of tests against $target and $target_os
     # and expects darwin for iOS, so make it happy.
     if target.os == 'iOS':
         target_alias = target_alias.replace('-ios', '-darwin')
-    add_old_configure_arg('--target=%s' % target_alias)
+    return '--target=%s' % target_alias
+
+add_old_configure_arg(target_for_old_configure)
 
 
 # These variables are for compatibility with the current moz.builds and
 # old-configure. Eventually, we'll want to canonicalize better.
 @depends(target)
 def target_variables(target):
     if target.kernel == 'kFreeBSD':
         os_target = 'GNU/kFreeBSD'
@@ -686,17 +693,19 @@ add_old_configure_assignment('RELEASE_BU
 # Use instead of option() in js/moz.configure
 @template
 def js_option(*args, **kwargs):
     opt = option(*args, **kwargs)
 
     @depends(opt.option, build_project)
     def js_option(value, build_project):
         if build_project != 'js':
-            add_old_configure_arg(value.format(opt.option))
+            return value.format(opt.option)
+
+    add_old_configure_arg(js_option)
 
 
 # This is overridden in b2g/moz.configure with an option. No other project
 # needs the option directly, but it's used to influence some other things in
 # toolkit/moz.configure (and possibly top-level moz.configure later on), so
 # define a dummy default here.
 @depends('--help')
 def gonkdir(help):