Bug 1257648 - Always filter target/host triplets with config.sub. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 18 Mar 2016 06:52:50 +0900
changeset 289333 2a0affe3d0c69fe57d8e0a56fb00c98d06b7bbfd
parent 289332 ea94d9e53c7a6ee7e3987890d933b21ee4404171
child 289334 aa4f6b5add702e71303ff168fb65c475a549fd97
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
bugs1257648
milestone48.0a1
Bug 1257648 - Always filter target/host triplets with config.sub. r=nalexander Until we stop relying on the raw_cpu and raw_os values from target and host, we need to keep normalizing them like old-configure.in did, which involves filtering them through config.sub.
build/moz.configure/init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -414,35 +414,44 @@ def split_triplet(triplet):
         cpu=canonical_cpu,
         kernel=canonical_kernel,
         os=canonical_os,
         raw_cpu=cpu,
         raw_os=os,
     )
 
 
+@template
+@advanced
+def config_sub(shell, triplet):
+    import subprocess
+    config_sub = os.path.join(os.path.dirname(__file__), '..',
+                              'autoconf', 'config.sub')
+    return subprocess.check_output([shell, config_sub, triplet]).strip()
+
+
 @depends('--host', shell)
 @advanced
 def host(value, shell):
     if not value:
         import subprocess
         config_guess = os.path.join(os.path.dirname(__file__), '..',
                                     'autoconf', 'config.guess')
         host = subprocess.check_output([shell, config_guess]).strip()
     else:
         host = value[0]
 
-    return split_triplet(host)
+    return split_triplet(config_sub(shell, host))
 
 
-@depends('--target', host)
-def target(value, host):
+@depends('--target', host, shell)
+def target(value, host, shell):
     if not value:
         return host
-    return split_triplet(value[0])
+    return split_triplet(config_sub(shell, value[0]))
 
 
 @depends(host, target)
 def host_and_target_for_old_configure(host, target):
     # Autoconf needs these set
     add_old_configure_arg('--host=%s' % host.alias)
 
     target_alias = target.alias