Bug 1520410 - Make --host/--target alter the output from configure --help. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Jan 2019 20:20:22 +0000
changeset 514220 5035c0df097405358d3233832538679c058766e4
parent 514219 037b359d5bf2aba76dc917af828dfe8bc74bc394
child 514221 370daad5d829ca6017a98368eb70f1d6fd5a376b
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1520410, 1322025
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1520410 - Make --host/--target alter the output from configure --help. r=nalexander Before bug 1322025, running configure --help along --host and/or --target would show the options that are specific to the host/target/cross-compilation (e.g. those with when=target_is_windows) which was convenient. Bug 1322025 unfortunately broke that, and this restores the feature. Differential Revision: https://phabricator.services.mozilla.com/D16673
build/moz.configure/init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -360,16 +360,27 @@ def shell(value, mozillabuild):
     shell = 'sh'
     if mozillabuild:
         shell = mozillabuild[0] + '/msys/bin/sh'
     if sys.platform == 'win32':
         shell = shell + '.exe'
     return find_program(shell)
 
 
+# This defines a reasonable shell for when running with --help.
+# If one was passed in the environment, though, fall back to that.
+@depends('--help', 'CONFIG_SHELL')
+def help_shell(help, shell):
+    if help and not shell:
+        return 'sh'
+
+
+shell = help_shell | shell
+
+
 # Python 3
 # ========
 
 option(env='PYTHON3', nargs=1, help='Python 3 interpreter (3.5 or later)')
 
 
 @depends('PYTHON3', 'MOZILLABUILD')
 @checking('for Python 3',
@@ -721,19 +732,21 @@ def split_triplet(triplet, allow_unknown
         raw_os=os,
         # Toolchains, most notably for cross compilation may use cpu-os
         # prefixes.
         toolchain='%s-%s' % (cpu, os),
     )
 
 
 # This defines a fake target/host namespace for when running with --help
-@depends('--help')
-def help_host_target(help):
-    if help:
+# If either --host or --target is passed on the command line, then fall
+# back to the real deal.
+@depends('--help', '--host', '--target')
+def help_host_target(help, host, target):
+    if help and not host and not target:
         return namespace(
             alias='unknown-unknown-unknown',
             cpu='unknown',
             bitness='unknown',
             kernel='unknown',
             os='unknown',
             endianness='unknown',
             raw_cpu='unknown',