зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1519603 - Hardcode js/src into subconfigure.py. r=nalexander
Because subconfigure.py is only used for js/src and we're not going to add any more subconfigures, we can hardcode js/src into the script, and remove the branches that aren't taken as a consequence. Depends on D16382 Differential Revision: https://phabricator.services.mozilla.com/D16402 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
4a50a75dd9
Коммит
09ed4d67e7
|
@ -120,7 +120,7 @@ def maybe_clear_cache(data):
|
|||
return False
|
||||
|
||||
|
||||
def prepare(srcdir, objdir, shell, args):
|
||||
def prepare(srcdir, objdir, args):
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--target', type=str)
|
||||
parser.add_argument('--host', type=str)
|
||||
|
@ -166,7 +166,6 @@ def prepare(srcdir, objdir, shell, args):
|
|||
'host': args.host,
|
||||
'build': args.build,
|
||||
'args': others,
|
||||
'shell': shell,
|
||||
'srcdir': srcdir,
|
||||
'objdir': objdir,
|
||||
'env': environ,
|
||||
|
@ -212,8 +211,6 @@ def execute_and_prefix(*args, **kwargs):
|
|||
|
||||
|
||||
def run(data):
|
||||
ret = 0
|
||||
|
||||
objdir = data['objdir']
|
||||
relobjdir = data['relobjdir'] = os.path.relpath(objdir, os.getcwd())
|
||||
|
||||
|
@ -248,23 +245,20 @@ def run(data):
|
|||
skip_configure = False
|
||||
|
||||
if not skip_configure:
|
||||
if mozpath.normsep(relobjdir) == 'js/src':
|
||||
# Because configure is a shell script calling a python script
|
||||
# calling a shell script, on Windows, with msys screwing the
|
||||
# environment, we lose the benefits from our own efforts in this
|
||||
# script to get past the msys problems. So manually call the python
|
||||
# script instead, so that we don't do a native->msys transition
|
||||
# here. Then the python configure will still have the right
|
||||
# environment when calling the shell configure.
|
||||
command = [
|
||||
sys.executable,
|
||||
os.path.join(os.path.dirname(__file__), '..', 'configure.py'),
|
||||
'--enable-project=js',
|
||||
]
|
||||
data['env']['OLD_CONFIGURE'] = os.path.join(
|
||||
os.path.dirname(configure), 'old-configure')
|
||||
else:
|
||||
command = [data['shell'], configure]
|
||||
# Because configure is a shell script calling a python script
|
||||
# calling a shell script, on Windows, with msys screwing the
|
||||
# environment, we lose the benefits from our own efforts in this
|
||||
# script to get past the msys problems. So manually call the python
|
||||
# script instead, so that we don't do a native->msys transition
|
||||
# here. Then the python configure will still have the right
|
||||
# environment when calling the shell configure.
|
||||
command = [
|
||||
sys.executable,
|
||||
os.path.join(os.path.dirname(__file__), '..', 'configure.py'),
|
||||
'--enable-project=js',
|
||||
]
|
||||
data['env']['OLD_CONFIGURE'] = os.path.join(
|
||||
os.path.dirname(configure), 'old-configure')
|
||||
for kind in ('target', 'build', 'host'):
|
||||
if data.get(kind) is not None:
|
||||
command += ['--%s=%s' % (kind, data[kind])]
|
||||
|
@ -283,43 +277,15 @@ def run(data):
|
|||
if returncode:
|
||||
return returncode
|
||||
|
||||
# Only run config.status if one of the following is true:
|
||||
# - config.status changed or did not exist
|
||||
# - one of the templates for config files is newer than the corresponding
|
||||
# config file.
|
||||
skip_config_status = True
|
||||
if mozpath.normsep(relobjdir) == 'js/src':
|
||||
# Running config.status in js/src actually does nothing, so we just
|
||||
# skip it.
|
||||
pass
|
||||
elif not config_status or config_status.modified:
|
||||
# If config.status doesn't exist after configure (because it's not
|
||||
# an autoconf configure), skip it.
|
||||
if os.path.exists(config_status_path):
|
||||
skip_config_status = False
|
||||
|
||||
if not skip_config_status:
|
||||
if skip_configure:
|
||||
print(prefix_lines('running config.status', relobjdir))
|
||||
sys.stdout.flush()
|
||||
ret = execute_and_prefix([data['shell'], '-c', './config.status'],
|
||||
cwd=objdir, env=data['env'], prefix=relobjdir)
|
||||
|
||||
return ret
|
||||
return 0
|
||||
|
||||
|
||||
def main(args):
|
||||
topsrcdir = os.path.abspath(args[0])
|
||||
subdir = args[1]
|
||||
# subdir can be of the form srcdir:objdir
|
||||
if ':' in subdir:
|
||||
srcdir, subdir = subdir.split(':', 1)
|
||||
else:
|
||||
srcdir = subdir
|
||||
srcdir = os.path.join(topsrcdir, srcdir)
|
||||
objdir = os.path.abspath(subdir)
|
||||
srcdir = os.path.join(topsrcdir, 'js/src')
|
||||
objdir = os.path.abspath('js/src')
|
||||
|
||||
data = prepare(srcdir, objdir, args[2], args[3:])
|
||||
data = prepare(srcdir, objdir, args[1:])
|
||||
return run(data)
|
||||
|
||||
|
||||
|
|
|
@ -3742,15 +3742,10 @@ if ! test -e js; then
|
|||
fi
|
||||
|
||||
ac_configure_args="$ac_configure_args JS_STANDALONE="
|
||||
_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
|
||||
dumpenv="true | "
|
||||
case "$host" in
|
||||
*-mingw*)
|
||||
_CONFIG_SHELL=$(cd $(dirname $_CONFIG_SHELL); pwd -W)/$(basename $_CONFIG_SHELL)
|
||||
if test ! -e "$_CONFIG_SHELL" -a -e "${_CONFIG_SHELL}.exe"; then
|
||||
_CONFIG_SHELL="${_CONFIG_SHELL}.exe"
|
||||
fi
|
||||
dnl Yes, this is horrible. But since msys doesn't preserve environment
|
||||
dnl variables and command line arguments as they are when transitioning
|
||||
dnl from msys (this script) to python (below), we have to resort to hacks,
|
||||
|
@ -3761,7 +3756,7 @@ case "$host" in
|
|||
esac
|
||||
|
||||
trap '' EXIT
|
||||
eval $dumpenv $PYTHON $_topsrcdir/build/subconfigure.py "$srcdir" js/src "$_CONFIG_SHELL" $ac_configure_args --cache-file="$cache_file"
|
||||
eval $dumpenv $PYTHON $_topsrcdir/build/subconfigure.py "$srcdir" $ac_configure_args --cache-file="$cache_file"
|
||||
if test $? -ne 0; then
|
||||
exit 1
|
||||
fi
|
||||
|
|
Загрузка…
Ссылка в новой задаче