Bug 1519603 - Manually inline AC_OUTPUT_SUBDIRS and MOZ_RUN_ALL_SUBCONFIGURES. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 14 Jan 2019 18:37:06 +0000
changeset 453868 129e9f6b6295da4ed2a2e7bfb73f1c75200ad9ef
parent 453867 78ac28070badf85fe5d2f8f13e8f83fb4edbf1f8
child 453869 8688b128061b7d7ffe967ee7d0050795d058e932
push id76048
push usermh@glandium.org
push dateTue, 15 Jan 2019 00:12:13 +0000
treeherderautoland@2809c756574d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1519603
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
aclocal.m4
build/autoconf/acwinpaths.m4
build/autoconf/hooks.m4
build/subconfigure.py
js/src/aclocal.m4
old-configure.in
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,15 +1,14 @@
 dnl
 dnl Local autoconf macros used with mozilla
 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
 builtin(include, build/autoconf/nspr.m4)dnl
 builtin(include, build/autoconf/nspr-build.m4)dnl
 builtin(include, build/autoconf/nss.m4)dnl
 builtin(include, build/autoconf/pkg.m4)dnl
 builtin(include, build/autoconf/codeset.m4)dnl
deleted file mode 100644
--- 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]))
--- a/build/autoconf/hooks.m4
+++ b/build/autoconf/hooks.m4
@@ -5,68 +5,13 @@ dnl file, You can obtain one at http://m
 dnl Wrap AC_INIT_PREPARE to add the above trap.
 define([_MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
 define([AC_INIT_PREPARE],
 [_MOZ_AC_INIT_PREPARE($1)
 
 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
 define([AC_MSG_ERROR],
 [{ echo "configure: error: $1" 1>&2; echo "configure: error: $1" 1>&5; exit 1; }])
--- a/build/subconfigure.py
+++ b/build/subconfigure.py
@@ -305,35 +305,20 @@ def run(objdir):
         ret = execute_and_prefix([data['shell'], '-c', './config.status'],
                                  cwd=objdir, env=data['env'], prefix=relobjdir)
 
     return ret
 
 
 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):
     if args[0] != '--prepare':
         return subconfigure(args)
 
     topsrcdir = os.path.abspath(args[1])
     subdir = args[2]
--- a/js/src/aclocal.m4
+++ b/js/src/aclocal.m4
@@ -1,15 +1,14 @@
 dnl
 dnl Local autoconf macros used with mozilla
 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
 builtin(include, ../../build/autoconf/pkg.m4)dnl
 builtin(include, ../../build/autoconf/nspr.m4)dnl
 builtin(include, ../../build/autoconf/nspr-build.m4)dnl
 builtin(include, ../../build/autoconf/codeset.m4)dnl
 builtin(include, ../../build/autoconf/altoptions.m4)dnl
--- a/old-configure.in
+++ b/old-configure.in
@@ -3737,21 +3737,37 @@ export HOST_CPPFLAGS
 export HOST_CXXFLAGS
 export HOST_LDFLAGS
 
 if ! test -e js; then
     mkdir js
 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