Bug 1363582 - Pass environment-only js_options down to old-configure through the environment. r?chmanchester
old-configure does not support being passed them as command line
arguments, so we have to pass them through the environment.
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -314,25 +314,40 @@ def old_configure(prepare_configure, ext
# so we don't need to pass it every single option we've been passed. Only
# the ones that are not supported by python configure need to.
cmd += [
value.format(name)
for name, value in zip(all_options, options)
if value.origin != 'default'
]
+ env = os.environ
+ extra_env = {}
+
# We also pass it the options from js/moz.configure so that it can pass
# them down to js/src/configure. Note this list is empty when running
# js/src/configure, in which case we don't need to pass those options
# to old-configure since old-configure doesn't handle them anyways.
if extra_old_configure_args:
- cmd += extra_old_configure_args
+ for arg in extra_old_configure_args:
+ if arg.startswith('-'):
+ cmd.append(arg)
+ else:
+ k, v = arg.split('=', 1)
+ extra_env[k] = v
+
+ if extra_env:
+ env = dict(env)
+ env.update(extra_env)
# For debugging purpose, in case it's not what we'd expect.
log.debug('Running %s', quote(*cmd))
+ if extra_env:
+ log.debug('with extra environment: %s',
+ ' '.join('%s=%s' % pair for pair in extra_env.iteritems()))
# Our logging goes to config.log, the same file old.configure uses.
# We can't share the handle on the file, so close it. We assume nothing
# beyond this point is going to be interesting to log to config.log from
# our end, so we don't make the effort to recreate a logging.FileHandler.
logger = logging.getLogger('moz.configure')
for handler in logger.handlers:
if isinstance(handler, logging.FileHandler):