From 95bcdbeaaa17cef5eff8a0275a942636dd652d6b Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 14 Jan 2019 18:37:06 +0000 Subject: [PATCH] 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 --- aclocal.m4 | 1 - build/autoconf/acwinpaths.m4 | 10 ------- build/autoconf/hooks.m4 | 55 ------------------------------------ build/subconfigure.py | 21 ++------------ js/src/aclocal.m4 | 1 - old-configure.in | 32 +++++++++++++++------ 6 files changed, 27 insertions(+), 93 deletions(-) delete mode 100644 build/autoconf/acwinpaths.m4 diff --git a/aclocal.m4 b/aclocal.m4 index 694474cc7e36..442dd0a9e1f4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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 diff --git a/build/autoconf/acwinpaths.m4 b/build/autoconf/acwinpaths.m4 deleted file mode 100644 index 6021637bc23c..000000000000 --- a/build/autoconf/acwinpaths.m4 +++ /dev/null @@ -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])) diff --git a/build/autoconf/hooks.m4 b/build/autoconf/hooks.m4 index de2ab925b268..454fd1c69060 100644 --- a/build/autoconf/hooks.m4 +++ b/build/autoconf/hooks.m4 @@ -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 diff --git a/build/subconfigure.py b/build/subconfigure.py index 764e49be743a..f375d9d4c8a6 100644 --- a/build/subconfigure.py +++ b/build/subconfigure.py @@ -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): diff --git a/js/src/aclocal.m4 b/js/src/aclocal.m4 index f9104ef19c68..e88e6d580cc8 100644 --- a/js/src/aclocal.m4 +++ b/js/src/aclocal.m4 @@ -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 diff --git a/old-configure.in b/old-configure.in index 0c00ceb5a7f8..3a4f53fee907 100644 --- a/old-configure.in +++ b/old-configure.in @@ -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