зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1519603 - Manually inline AC_OUTPUT_SUBDIRS and MOZ_RUN_ALL_SUBCONFIGURES. r=nalexander
Because we only ever run one subconfigure, the machinery to execute several is not useful anymore. Inlining it allows to simplify the code too, because it doesn't need to be generic anymore. This also removes the last remaining bits of acwinpaths.m4. Also remove now unused support for --list in build/subconfigure.py. Depends on D16380 Differential Revision: https://phabricator.services.mozilla.com/D16381 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
236f9da6bb
Коммит
95bcdbeaaa
|
@ -4,7 +4,6 @@ dnl The contents of this file are under the Public Domain.
|
|||
dnl
|
||||
|
||||
builtin(include, build/autoconf/hotfixes.m4)dnl
|
||||
builtin(include, build/autoconf/acwinpaths.m4)dnl
|
||||
builtin(include, build/autoconf/hooks.m4)dnl
|
||||
builtin(include, build/autoconf/config.status.m4)dnl
|
||||
builtin(include, build/autoconf/toolchain.m4)dnl
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
dnl This Source Code Form is subject to the terms of the Mozilla Public
|
||||
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
define(GENERATE_SUBDIRS_ABS, [
|
||||
define([AC_OUTPUT_SUBDIRS], [
|
||||
patsubst($@, [/\*)], [/* | ?:/*)])
|
||||
])
|
||||
])
|
||||
GENERATE_SUBDIRS_ABS(defn([AC_OUTPUT_SUBDIRS]))
|
|
@ -10,61 +10,6 @@ define([AC_INIT_PREPARE],
|
|||
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
||||
# Let make expand exec_prefix.
|
||||
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
||||
|
||||
> subconfigures
|
||||
])
|
||||
|
||||
define([AC_OUTPUT_SUBDIRS],
|
||||
[for moz_config_dir in $1; do
|
||||
_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
case "$moz_config_dir" in
|
||||
*:*)
|
||||
objdir=$(echo $moz_config_dir | awk -F: '{print [$]2}')
|
||||
;;
|
||||
*)
|
||||
objdir=$moz_config_dir
|
||||
;;
|
||||
esac
|
||||
dnl Because config.status, storing AC_SUBSTs, is written before any
|
||||
dnl subconfigure runs, we need to use a file. Moreover, some subconfigures
|
||||
dnl are started from a subshell, and variable modifications from a subshell
|
||||
dnl wouldn't be preserved.
|
||||
echo $objdir >> subconfigures
|
||||
|
||||
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,
|
||||
dnl storing the environment and command line arguments from a msys process
|
||||
dnl (perl), and reading it from python.
|
||||
dumpenv="$PERL $_topsrcdir/build/win32/dumpenv4python.pl $ac_configure_args | "
|
||||
;;
|
||||
esac
|
||||
|
||||
eval $dumpenv $PYTHON $_topsrcdir/build/subconfigure.py --prepare "$srcdir" "$moz_config_dir" "$_CONFIG_SHELL" $ac_configure_args ifelse($2,,,--cache-file="$2")
|
||||
|
||||
dnl Actual subconfigure execution happens in MOZ_RUN_CONFIG_STATUS
|
||||
done
|
||||
])
|
||||
|
||||
define([MOZ_RUN_SUBCONFIGURES],
|
||||
[dnl Execute subconfigure, unless --no-recursion was passed to configure.
|
||||
if test "$no_recursion" != yes; then
|
||||
trap '' EXIT
|
||||
if ! $PYTHON $_topsrcdir/build/subconfigure.py $1; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
define([MOZ_RUN_ALL_SUBCONFIGURES],[
|
||||
MOZ_RUN_SUBCONFIGURES([--list subconfigures])
|
||||
])
|
||||
|
||||
dnl Print error messages in config.log as well as stderr
|
||||
|
|
|
@ -310,25 +310,10 @@ def run(objdir):
|
|||
|
||||
def subconfigure(args):
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--list', type=str,
|
||||
help='File containing a list of subconfigures to run')
|
||||
parser.add_argument('subconfigures', type=str, nargs='*',
|
||||
help='Subconfigures to run if no list file is given')
|
||||
parser.add_argument('subconfigure', type=str,
|
||||
help='Subconfigure to run')
|
||||
args, others = parser.parse_known_args(args)
|
||||
subconfigures = args.subconfigures
|
||||
if args.list:
|
||||
subconfigures.extend(open(args.list, 'rb').read().splitlines())
|
||||
|
||||
if not subconfigures:
|
||||
return 0
|
||||
|
||||
ret = 0
|
||||
for subconfigure in subconfigures:
|
||||
returncode = run(subconfigure)
|
||||
ret = max(returncode, ret)
|
||||
if ret:
|
||||
break
|
||||
return ret
|
||||
return run(args.subconfigure)
|
||||
|
||||
|
||||
def main(args):
|
||||
|
|
|
@ -4,7 +4,6 @@ dnl The contents of this file are under the Public Domain.
|
|||
dnl
|
||||
|
||||
builtin(include, ../../build/autoconf/hotfixes.m4)dnl
|
||||
builtin(include, ../../build/autoconf/acwinpaths.m4)dnl
|
||||
builtin(include, ../../build/autoconf/hooks.m4)dnl
|
||||
builtin(include, ../../build/autoconf/config.status.m4)dnl
|
||||
builtin(include, ../../build/autoconf/toolchain.m4)dnl
|
||||
|
|
|
@ -3742,16 +3742,32 @@ if ! test -e js; then
|
|||
fi
|
||||
|
||||
ac_configure_args="$ac_configure_args JS_STANDALONE="
|
||||
AC_OUTPUT_SUBDIRS(js/src,$cache_file)
|
||||
_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,
|
||||
dnl storing the environment and command line arguments from a msys process
|
||||
dnl (perl), and reading it from python.
|
||||
dumpenv="$PERL $_topsrcdir/build/win32/dumpenv4python.pl $ac_configure_args | "
|
||||
;;
|
||||
esac
|
||||
|
||||
eval $dumpenv $PYTHON $_topsrcdir/build/subconfigure.py --prepare "$srcdir" js/src "$_CONFIG_SHELL" $ac_configure_args --cache-file="$cache_file"
|
||||
|
||||
trap '' EXIT
|
||||
if ! $PYTHON $_topsrcdir/build/subconfigure.py js/src; then
|
||||
exit 1
|
||||
fi
|
||||
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
|
||||
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
dnl we need to run config.status after js/src subconfigure because we're
|
||||
dnl traversing its moz.build and we need its config.status for that.
|
||||
dnl However, writing our own config.status needs to happen before
|
||||
dnl subconfigures because the setup surrounding subconfigures alters
|
||||
dnl many AC_SUBSTed variables.
|
||||
MOZ_RUN_ALL_SUBCONFIGURES()
|
||||
|
||||
rm -fr confdefs* $ac_clean_files
|
||||
|
|
Загрузка…
Ссылка в новой задаче