Bug 1266343 - Add CONFIG_SHELL to allow to set a POSIX shell that is not sh. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 20 Apr 2016 10:40:07 +0900
changeset 332290 3af1b75d889a3efa3e99fb48c2f684587b029c38
parent 332289 1c806c5bf368aebbd4af87ab2ee98b992b190e76
child 332291 a605d56f9c32047544b989f66f1d41b0bf659531
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1266343
milestone48.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 1266343 - Add CONFIG_SHELL to allow to set a POSIX shell that is not sh. r=chmanchester This allows unit tests to override the shell check, and is compatible with what autoconf actually does.
build/moz.configure/init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -286,22 +286,26 @@ def mozconfig_options(mozconfig, help):
             add(key, value)
 
 
 # Mozilla-Build
 # ==============================================================
 option(env='MOZILLABUILD', nargs=1,
        help='Path to Mozilla Build (Windows-only)')
 
+option(env='CONFIG_SHELL', nargs=1, help='Path to a POSIX shell')
+
 # It feels dirty replicating this from python/mozbuild/mozbuild/mozconfig.py,
 # but the end goal being that the configure script would go away...
-@depends('MOZILLABUILD')
+@depends('CONFIG_SHELL', 'MOZILLABUILD')
 @checking('for a shell')
 @imports('sys')
-def shell(mozillabuild):
+def shell(value, mozillabuild):
+    if value:
+        return find_program(value[0])
     shell = 'sh'
     if mozillabuild:
         shell = mozillabuild[0] + '/msys/bin/sh'
     if sys.platform == 'win32':
         shell = shell + '.exe'
     return find_program(shell)