Bug 1255305 - Move the function finding a shell from old.configure to init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -228,19 +228,35 @@ def mozconfig_options(mozconfig):
# but at the moment, moz.configure has no knowledge of the options
# that may appear there. We'll opt-in when we move things from
# old-configure.in, which will be tedious but necessary until we
# can discriminate what old-configure.in supports.
del command_line_helper
+# Mozilla-Build
+# ==============================================================
option(env='MOZILLABUILD', nargs=1,
help='Path to Mozilla Build (Windows-only)')
+# 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')
+@advanced
+def shell(mozillabuild):
+ import sys
+
+ shell = 'sh'
+ if mozillabuild:
+ shell = mozillabuild[0] + '/msys/bin/sh'
+ if sys.platform == 'win32':
+ shell = shell + '.exe'
+ return shell
+
option('--enable-application', nargs=1, env='MOZ_BUILD_APP',
help='Application to build. Same as --enable-project.')
@depends('--enable-application', '--help')
def application(app, help):
if app:
imply_option(app.format('--enable-project'))
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -1,29 +1,14 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-# 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')
-@advanced
-def shell(mozillabuild):
- import sys
-
- shell = 'sh'
- if mozillabuild:
- shell = mozillabuild[0] + '/msys/bin/sh'
- if sys.platform == 'win32':
- shell = shell + '.exe'
- return shell
-
-
@template
@advanced
def encoded_open(path, mode):
import codecs
import sys
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
return codecs.open(path, mode, encoding)