2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2016-03-04 11:31:10 +03:00
|
|
|
# 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/.
|
|
|
|
|
2016-03-27 05:40:13 +03:00
|
|
|
@imports('codecs')
|
|
|
|
@imports('sys')
|
2016-03-11 10:33:15 +03:00
|
|
|
def encoded_open(path, mode):
|
|
|
|
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
|
|
|
|
return codecs.open(path, mode, encoding)
|
|
|
|
|
|
|
|
|
2016-03-04 11:31:10 +03:00
|
|
|
option(env='AUTOCONF', nargs=1, help='Path to autoconf 2.13')
|
|
|
|
|
|
|
|
@depends(mozconfig, 'AUTOCONF')
|
2016-04-07 11:11:44 +03:00
|
|
|
@checking('for autoconf')
|
2016-11-04 00:50:43 +03:00
|
|
|
@imports(_from='os.path', _import='exists')
|
2016-03-27 05:40:13 +03:00
|
|
|
@imports('re')
|
2016-03-04 11:31:10 +03:00
|
|
|
def autoconf(mozconfig, autoconf):
|
|
|
|
mozconfig_autoconf = None
|
|
|
|
if mozconfig['path']:
|
|
|
|
make_extra = mozconfig['make_extra']
|
|
|
|
if make_extra:
|
|
|
|
for assignment in make_extra:
|
|
|
|
m = re.match('(?:export\s+)?AUTOCONF\s*:?=\s*(.+)$',
|
|
|
|
assignment)
|
|
|
|
if m:
|
|
|
|
mozconfig_autoconf = m.group(1)
|
|
|
|
|
|
|
|
autoconf = autoconf[0] if autoconf else None
|
|
|
|
|
|
|
|
for ac in (mozconfig_autoconf, autoconf, 'autoconf-2.13', 'autoconf2.13',
|
|
|
|
'autoconf213'):
|
|
|
|
if ac:
|
|
|
|
autoconf = find_program(ac)
|
|
|
|
if autoconf:
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
fink = find_program('fink')
|
2016-03-14 18:06:53 +03:00
|
|
|
if fink:
|
2016-03-04 11:31:10 +03:00
|
|
|
autoconf = os.path.normpath(os.path.join(
|
|
|
|
fink, '..', '..', 'lib', 'autoconf2.13', 'bin', 'autoconf'))
|
2016-03-14 18:06:53 +03:00
|
|
|
else:
|
|
|
|
brew = find_program('brew')
|
|
|
|
if brew:
|
|
|
|
autoconf = os.path.normpath(os.path.join(
|
|
|
|
brew, '..', '..', 'Cellar', 'autoconf213', '2.13', 'bin',
|
|
|
|
'autoconf213'))
|
2016-03-04 11:31:10 +03:00
|
|
|
|
|
|
|
if not autoconf:
|
2016-03-25 09:48:21 +03:00
|
|
|
die('Could not find autoconf 2.13')
|
2016-03-04 11:31:10 +03:00
|
|
|
|
2016-11-04 00:50:43 +03:00
|
|
|
if not exists(autoconf):
|
2016-03-25 09:48:21 +03:00
|
|
|
die('Could not find autoconf 2.13 at %s', autoconf)
|
2016-03-14 18:06:53 +03:00
|
|
|
|
2016-03-04 11:31:10 +03:00
|
|
|
return autoconf
|
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('AUTOCONF', autoconf)
|
|
|
|
|
2016-03-04 11:31:10 +03:00
|
|
|
|
2016-03-04 08:31:08 +03:00
|
|
|
@depends('OLD_CONFIGURE', mozconfig, autoconf, check_build_environment, shell,
|
2016-03-16 00:49:37 +03:00
|
|
|
old_configure_assignments, build_project)
|
2016-03-27 05:40:13 +03:00
|
|
|
@imports(_from='__builtin__', _import='open')
|
|
|
|
@imports(_from='__builtin__', _import='print')
|
|
|
|
@imports('glob')
|
|
|
|
@imports('itertools')
|
|
|
|
@imports('subprocess')
|
|
|
|
# Import getmtime without overwriting the sandbox os.path.
|
|
|
|
@imports(_from='os.path', _import='getmtime')
|
2016-11-04 00:50:43 +03:00
|
|
|
@imports(_from='os.path', _import='exists')
|
2016-03-27 05:40:13 +03:00
|
|
|
@imports(_from='mozbuild.shellutil', _import='quote')
|
2016-03-04 08:31:08 +03:00
|
|
|
def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
|
2016-03-16 00:49:37 +03:00
|
|
|
old_configure_assignments, build_project):
|
2016-03-04 11:31:10 +03:00
|
|
|
# os.path.abspath in the sandbox will ensure forward slashes on Windows,
|
|
|
|
# which is actually necessary because this path actually ends up literally
|
|
|
|
# as $0, and backslashes there breaks autoconf's detection of the source
|
|
|
|
# directory.
|
|
|
|
old_configure = os.path.abspath(old_configure[0])
|
2016-03-16 00:49:37 +03:00
|
|
|
if build_project == 'js':
|
|
|
|
old_configure_dir = os.path.dirname(old_configure)
|
2016-11-04 00:50:43 +03:00
|
|
|
if not old_configure_dir.endswith('/js/src'):
|
2016-03-16 00:49:37 +03:00
|
|
|
old_configure = os.path.join(old_configure_dir, 'js', 'src',
|
|
|
|
os.path.basename(old_configure))
|
2016-03-04 11:31:10 +03:00
|
|
|
|
|
|
|
refresh = True
|
2016-11-04 00:50:43 +03:00
|
|
|
if exists(old_configure):
|
2016-03-04 11:31:10 +03:00
|
|
|
mtime = getmtime(old_configure)
|
2016-03-22 09:46:16 +03:00
|
|
|
aclocal = os.path.join(build_env.topsrcdir, 'build', 'autoconf',
|
2016-03-04 11:31:10 +03:00
|
|
|
'*.m4')
|
|
|
|
for input in itertools.chain(
|
|
|
|
(old_configure + '.in',
|
|
|
|
os.path.join(os.path.dirname(old_configure), 'aclocal.m4')),
|
|
|
|
glob.iglob(aclocal),
|
|
|
|
):
|
|
|
|
if getmtime(input) > mtime:
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
refresh = False
|
|
|
|
|
|
|
|
if refresh:
|
2016-03-25 10:30:42 +03:00
|
|
|
log.info('Refreshing %s with %s', old_configure, autoconf)
|
2016-03-25 10:44:53 +03:00
|
|
|
script = subprocess.check_output([
|
|
|
|
shell, autoconf,
|
|
|
|
'--localdir=%s' % os.path.dirname(old_configure),
|
|
|
|
old_configure + '.in'])
|
2017-05-11 01:00:11 +03:00
|
|
|
if not script:
|
|
|
|
die('Generated old-configure is empty! Check that your autoconf 2.13 program works!')
|
2016-03-25 10:44:53 +03:00
|
|
|
|
|
|
|
# Make old-configure append to config.log, where we put our own log.
|
|
|
|
# This could be done with a m4 macro, but it's way easier this way
|
|
|
|
script = script.replace('>./config.log', '>>./config.log')
|
|
|
|
|
2016-03-04 11:31:10 +03:00
|
|
|
with open(old_configure, 'wb') as fh:
|
2016-03-25 10:44:53 +03:00
|
|
|
fh.write(script)
|
2016-03-04 11:31:10 +03:00
|
|
|
|
2016-03-10 09:48:38 +03:00
|
|
|
cmd = [shell, old_configure]
|
2016-03-11 10:33:15 +03:00
|
|
|
with encoded_open('old-configure.vars', 'w') as out:
|
2016-03-30 08:30:07 +03:00
|
|
|
log.debug('Injecting the following to old-configure:')
|
|
|
|
def inject(command):
|
|
|
|
print(command, file=out)
|
|
|
|
log.debug('| %s', command)
|
|
|
|
|
2016-03-04 11:31:10 +03:00
|
|
|
if mozconfig['path']:
|
|
|
|
for key, value in mozconfig['vars']['added'].items():
|
2016-03-30 08:30:07 +03:00
|
|
|
inject("%s=%s" % (key, quote(value)))
|
2016-03-04 11:31:10 +03:00
|
|
|
for key, (old, value) in mozconfig['vars']['modified'].items():
|
2016-03-30 08:30:07 +03:00
|
|
|
inject("%s=%s" % (key, quote(value)))
|
2016-03-04 11:31:10 +03:00
|
|
|
for t in ('env', 'vars'):
|
|
|
|
for key in mozconfig[t]['removed'].keys():
|
2016-03-30 08:30:07 +03:00
|
|
|
inject("unset %s" % key)
|
2016-03-04 11:31:10 +03:00
|
|
|
|
2016-03-15 06:03:00 +03:00
|
|
|
# Autoconf is special, because it might be passed from
|
|
|
|
# mozconfig['make_extra'], which we don't pass automatically above.
|
2016-03-30 08:30:07 +03:00
|
|
|
inject('export AUTOCONF=%s' % quote(autoconf))
|
2016-03-15 06:03:00 +03:00
|
|
|
|
2016-03-10 02:23:10 +03:00
|
|
|
for assignment in old_configure_assignments:
|
2016-03-30 08:30:07 +03:00
|
|
|
inject(assignment)
|
2016-03-09 09:59:39 +03:00
|
|
|
|
2016-03-04 11:31:10 +03:00
|
|
|
return cmd
|
|
|
|
|
|
|
|
|
|
|
|
@template
|
|
|
|
def old_configure_options(*options):
|
|
|
|
for opt in options:
|
|
|
|
option(opt, nargs='*', help='Help missing for old configure options')
|
|
|
|
|
2016-08-09 09:55:10 +03:00
|
|
|
@dependable
|
|
|
|
def all_options():
|
2016-03-10 09:48:38 +03:00
|
|
|
return list(options)
|
2016-03-04 11:31:10 +03:00
|
|
|
|
2016-03-10 09:48:38 +03:00
|
|
|
return depends(prepare_configure, extra_old_configure_args, all_options,
|
|
|
|
*options)
|
2016-03-04 11:31:10 +03:00
|
|
|
|
|
|
|
|
|
|
|
@old_configure_options(
|
|
|
|
'--cache-file',
|
2016-08-16 16:42:00 +03:00
|
|
|
'--datadir',
|
2016-03-04 11:31:10 +03:00
|
|
|
'--enable-accessibility',
|
|
|
|
'--enable-address-sanitizer',
|
|
|
|
'--enable-alsa',
|
|
|
|
'--enable-bundled-fonts',
|
|
|
|
'--enable-clang-plugin',
|
|
|
|
'--enable-content-sandbox',
|
|
|
|
'--enable-cookies',
|
|
|
|
'--enable-cpp-rtti',
|
|
|
|
'--enable-crashreporter',
|
|
|
|
'--enable-dbus',
|
|
|
|
'--enable-debug-js-modules',
|
|
|
|
'--enable-directshow',
|
|
|
|
'--enable-dtrace',
|
|
|
|
'--enable-dump-painting',
|
|
|
|
'--enable-elf-hack',
|
|
|
|
'--enable-extensions',
|
|
|
|
'--enable-faststripe',
|
|
|
|
'--enable-feeds',
|
|
|
|
'--enable-gamepad',
|
|
|
|
'--enable-gconf',
|
|
|
|
'--enable-gczeal',
|
|
|
|
'--enable-hardware-aec-ns',
|
|
|
|
'--enable-icf',
|
2016-06-07 12:46:51 +03:00
|
|
|
'--enable-install-strip',
|
2016-03-04 11:31:10 +03:00
|
|
|
'--enable-ion',
|
|
|
|
'--enable-ios-target',
|
|
|
|
'--enable-jitspew',
|
|
|
|
'--enable-libjpeg-turbo',
|
|
|
|
'--enable-libproxy',
|
|
|
|
'--enable-llvm-hacks',
|
|
|
|
'--enable-logrefcnt',
|
|
|
|
'--enable-maintenance-service',
|
|
|
|
'--enable-memory-sanitizer',
|
|
|
|
'--enable-mobile-optimize',
|
|
|
|
'--enable-necko-wifi',
|
|
|
|
'--enable-negotiateauth',
|
|
|
|
'--enable-nfc',
|
|
|
|
'--enable-nspr-build',
|
|
|
|
'--enable-official-branding',
|
|
|
|
'--enable-oom-breakpoint',
|
|
|
|
'--enable-optimize',
|
|
|
|
'--enable-parental-controls',
|
|
|
|
'--enable-pie',
|
|
|
|
'--enable-posix-nspr-emulation',
|
|
|
|
'--enable-pref-extensions',
|
|
|
|
'--enable-pulseaudio',
|
|
|
|
'--enable-raw',
|
|
|
|
'--enable-readline',
|
|
|
|
'--enable-reflow-perf',
|
|
|
|
'--enable-sandbox',
|
|
|
|
'--enable-signmar',
|
|
|
|
'--enable-simulator',
|
|
|
|
'--enable-small-chunk-size',
|
|
|
|
'--enable-startup-notification',
|
|
|
|
'--enable-startupcache',
|
|
|
|
'--enable-stdcxx-compat',
|
2016-06-07 12:46:51 +03:00
|
|
|
'--enable-strip',
|
2016-03-04 11:31:10 +03:00
|
|
|
'--enable-synth-pico',
|
|
|
|
'--enable-system-cairo',
|
|
|
|
'--enable-system-extension-dirs',
|
|
|
|
'--enable-system-pixman',
|
|
|
|
'--enable-system-sqlite',
|
|
|
|
'--enable-tasktracer',
|
|
|
|
'--enable-thread-sanitizer',
|
|
|
|
'--enable-trace-logging',
|
2017-04-09 13:59:26 +03:00
|
|
|
'--enable-ubsan-int-overflow',
|
2016-03-04 11:31:10 +03:00
|
|
|
'--enable-ui-locale',
|
|
|
|
'--enable-universalchardet',
|
|
|
|
'--enable-updater',
|
|
|
|
'--enable-valgrind',
|
|
|
|
'--enable-verify-mar',
|
|
|
|
'--enable-xul',
|
|
|
|
'--enable-zipwriter',
|
2016-08-16 16:42:00 +03:00
|
|
|
'--includedir',
|
|
|
|
'--libdir',
|
2016-03-04 11:31:10 +03:00
|
|
|
'--no-create',
|
|
|
|
'--prefix',
|
|
|
|
'--with-android-distribution-directory',
|
|
|
|
'--with-android-max-sdk',
|
|
|
|
'--with-android-min-sdk',
|
|
|
|
'--with-android-sdk',
|
|
|
|
'--with-app-basename',
|
|
|
|
'--with-app-name',
|
|
|
|
'--with-arch',
|
|
|
|
'--with-branding',
|
|
|
|
'--with-cross-lib',
|
|
|
|
'--with-debug-label',
|
|
|
|
'--with-distribution-id',
|
|
|
|
'--with-doc-include-dirs',
|
|
|
|
'--with-doc-input-dirs',
|
|
|
|
'--with-doc-output-dir',
|
|
|
|
'--with-float-abi',
|
|
|
|
'--with-fpu',
|
|
|
|
'--with-intl-api',
|
|
|
|
'--with-ios-sdk',
|
|
|
|
'--with-jitreport-granularity',
|
|
|
|
'--with-macbundlename-prefix',
|
|
|
|
'--with-macos-private-frameworks',
|
|
|
|
'--with-macos-sdk',
|
|
|
|
'--with-nspr-cflags',
|
2016-03-29 16:57:03 +03:00
|
|
|
'--with-nspr-exec-prefix',
|
2016-03-04 11:31:10 +03:00
|
|
|
'--with-nspr-libs',
|
2016-03-29 16:57:03 +03:00
|
|
|
'--with-nspr-prefix',
|
|
|
|
'--with-nss-exec-prefix',
|
|
|
|
'--with-nss-prefix',
|
2016-03-04 11:31:10 +03:00
|
|
|
'--with-pthreads',
|
|
|
|
'--with-qemu-exe',
|
|
|
|
'--with-sixgill',
|
|
|
|
'--with-soft-float',
|
|
|
|
'--with-system-bz2',
|
|
|
|
'--with-system-icu',
|
|
|
|
'--with-system-jpeg',
|
|
|
|
'--with-system-libevent',
|
|
|
|
'--with-system-libvpx',
|
|
|
|
'--with-system-nspr',
|
|
|
|
'--with-system-nss',
|
|
|
|
'--with-system-png',
|
|
|
|
'--with-system-zlib',
|
|
|
|
'--with-thumb',
|
|
|
|
'--with-thumb-interwork',
|
|
|
|
'--with-unify-dist',
|
|
|
|
'--with-user-appdir',
|
|
|
|
'--x-includes',
|
|
|
|
'--x-libraries',
|
2016-03-08 20:38:00 +03:00
|
|
|
|
|
|
|
# Below are the configure flags used by comm-central.
|
|
|
|
'--enable-ldap',
|
|
|
|
'--enable-mapi',
|
|
|
|
'--enable-calendar',
|
|
|
|
'--enable-incomplete-external-linkage',
|
2016-03-04 11:31:10 +03:00
|
|
|
)
|
2016-03-27 05:40:13 +03:00
|
|
|
@imports(_from='__builtin__', _import='compile')
|
|
|
|
@imports(_from='__builtin__', _import='open')
|
|
|
|
@imports('logging')
|
|
|
|
@imports('os')
|
|
|
|
@imports('subprocess')
|
|
|
|
@imports('sys')
|
|
|
|
@imports(_from='mozbuild.shellutil', _import='quote')
|
2016-03-10 09:48:38 +03:00
|
|
|
def old_configure(prepare_configure, extra_old_configure_args, all_options,
|
|
|
|
*options):
|
|
|
|
cmd = prepare_configure
|
|
|
|
|
|
|
|
# old-configure only supports the options listed in @old_configure_options
|
|
|
|
# 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'
|
|
|
|
]
|
|
|
|
|
2017-05-10 05:04:00 +03:00
|
|
|
env = os.environ
|
|
|
|
extra_env = {}
|
|
|
|
|
2016-03-10 09:48:38 +03:00
|
|
|
# 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:
|
2017-05-10 05:04:00 +03:00
|
|
|
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)
|
2016-03-04 11:31:10 +03:00
|
|
|
|
2016-03-10 09:48:38 +03:00
|
|
|
# For debugging purpose, in case it's not what we'd expect.
|
2016-04-05 02:59:46 +03:00
|
|
|
log.debug('Running %s', quote(*cmd))
|
2017-05-10 05:04:00 +03:00
|
|
|
if extra_env:
|
|
|
|
log.debug('with extra environment: %s',
|
|
|
|
' '.join('%s=%s' % pair for pair in extra_env.iteritems()))
|
2016-03-25 10:44:53 +03:00
|
|
|
|
|
|
|
# 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):
|
|
|
|
handler.close()
|
2016-04-01 09:24:54 +03:00
|
|
|
logger.removeHandler(handler)
|
2016-03-25 10:44:53 +03:00
|
|
|
|
2016-03-25 14:11:59 +03:00
|
|
|
log_size = os.path.getsize('config.log')
|
|
|
|
|
2016-03-10 09:48:38 +03:00
|
|
|
ret = subprocess.call(cmd)
|
2016-03-04 11:31:10 +03:00
|
|
|
if ret:
|
2016-03-25 14:11:59 +03:00
|
|
|
with log.queue_debug():
|
2016-04-01 03:06:45 +03:00
|
|
|
with encoded_open('config.log', 'r') as fh:
|
2016-03-25 14:11:59 +03:00
|
|
|
fh.seek(log_size)
|
|
|
|
for line in fh:
|
|
|
|
log.debug(line.rstrip())
|
|
|
|
log.error('old-configure failed')
|
2016-03-04 11:31:10 +03:00
|
|
|
sys.exit(ret)
|
|
|
|
|
|
|
|
raw_config = {}
|
2016-03-11 10:33:15 +03:00
|
|
|
with encoded_open('config.data', 'r') as fh:
|
2016-03-09 05:39:18 +03:00
|
|
|
code = compile(fh.read(), 'config.data', 'exec')
|
|
|
|
# Every variation of the exec() function I tried led to:
|
|
|
|
# SyntaxError: unqualified exec is not allowed in function 'main' it
|
|
|
|
# contains a nested function with free variables
|
|
|
|
exec code in raw_config
|
2016-03-04 11:31:10 +03:00
|
|
|
|
|
|
|
# Ensure all the flags known to old-configure appear in the
|
|
|
|
# @old_configure_options above.
|
2016-03-10 09:48:38 +03:00
|
|
|
all_options = set(all_options)
|
2016-03-04 11:31:10 +03:00
|
|
|
for flag in raw_config['flags']:
|
|
|
|
if flag not in all_options:
|
2016-03-25 09:48:21 +03:00
|
|
|
die('Missing option in `@old_configure_options` in %s: %s',
|
|
|
|
__file__, flag)
|
2016-03-04 11:31:10 +03:00
|
|
|
|
|
|
|
# If the code execution above fails, we want to keep the file around for
|
|
|
|
# debugging.
|
|
|
|
os.remove('config.data')
|
2016-03-22 08:21:32 +03:00
|
|
|
return raw_config
|
|
|
|
|
|
|
|
|
|
|
|
# set_config is only available in the global namespace, not directly in
|
|
|
|
# @depends functions, but we do need to enumerate the result of
|
|
|
|
# old_configure, so we cheat.
|
2016-03-28 01:29:08 +03:00
|
|
|
@imports('__sandbox__')
|
2016-03-22 08:21:32 +03:00
|
|
|
def set_old_configure_config(name, value):
|
2016-03-28 01:29:08 +03:00
|
|
|
__sandbox__.set_config_impl(name, value)
|
2016-03-22 08:21:32 +03:00
|
|
|
|
2016-03-23 04:22:08 +03:00
|
|
|
# Same as set_old_configure_config, but for set_define.
|
2016-03-28 01:29:08 +03:00
|
|
|
@imports('__sandbox__')
|
2016-03-23 04:22:08 +03:00
|
|
|
def set_old_configure_define(name, value):
|
2016-03-28 01:29:08 +03:00
|
|
|
__sandbox__.set_define_impl(name, value)
|
2016-03-23 04:22:08 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
|
|
|
|
@depends(old_configure)
|
2016-03-27 05:40:13 +03:00
|
|
|
@imports('types')
|
2016-03-22 08:21:32 +03:00
|
|
|
def post_old_configure(raw_config):
|
2016-03-04 11:31:10 +03:00
|
|
|
for k, v in raw_config['substs']:
|
2016-03-22 08:21:32 +03:00
|
|
|
set_old_configure_config(
|
|
|
|
k[1:-1], v[1:-1] if isinstance(v, types.StringTypes) else v)
|
2016-03-04 11:31:10 +03:00
|
|
|
|
|
|
|
for k, v in dict(raw_config['defines']).iteritems():
|
2016-03-23 04:22:08 +03:00
|
|
|
set_old_configure_define(k[1:-1], v[1:-1])
|
2016-03-04 11:31:10 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_old_configure_config('non_global_defines',
|
|
|
|
raw_config['non_global_defines'])
|
2016-04-14 02:51:09 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Assuming no other option is declared after this function, handle the
|
|
|
|
# env options that were injected by mozconfig_options by creating dummy
|
|
|
|
# Option instances and having the sandbox's CommandLineHelper handle
|
|
|
|
# them. We only do so for options that haven't been declared so far,
|
|
|
|
# which should be a proxy for the options that old-configure handles
|
|
|
|
# and that we don't know anything about.
|
2016-10-27 09:00:51 +03:00
|
|
|
@depends('--help')
|
2016-04-14 02:51:09 +03:00
|
|
|
@imports('__sandbox__')
|
|
|
|
@imports(_from='mozbuild.configure.options', _import='Option')
|
2016-10-27 09:00:51 +03:00
|
|
|
def remaining_mozconfig_options(_):
|
2016-04-14 02:51:09 +03:00
|
|
|
helper = __sandbox__._helper
|
|
|
|
for arg in helper:
|
|
|
|
if helper._origins[arg] != 'mozconfig':
|
|
|
|
continue
|
|
|
|
name = arg.split('=', 1)[0]
|
|
|
|
if name.isupper() and name not in __sandbox__._options:
|
|
|
|
option = Option(env=name, nargs='*', help=name)
|
|
|
|
helper.handle(option)
|
|
|
|
|
|
|
|
# Please do not add anything after remaining_mozconfig_options()
|