[PATCH] autoregen.py: Use autoreconf for all directories

Simon Marchi simon.marchi@efficios.com
Tue Oct 13 18:44:32 GMT 2026


autoregen.py runs "autoreconf -f" in most directories, except for the
top-level and fixincludes, which use regenerate_manually.

Since gcc commit d817e08d9ee ("fixincludes: add AC_CONFIG_MACRO_DIRS to
configure.ac"), autoreconf is able to regenerate aclocal.m4 in
fixincludes.

For the top-level, "autoreconf -f" runs "aclocal --force", which does
not produce an aclocal.m4 (all the macros are included explicitly with
m4_include), and then "autoconf --force".  It skips autoheader, automake
and libtoolize, since the top-level configure.ac does not use them.
This is equivalent to what regenerate_manually does for the top-level.

Running "autoreconf -f" in gcc's fixincludes, and in the top-level of
both gcc and binutils-gdb, produces no changes.

The gotools hack in regenerate_manually has been dead code for a while,
since that directory already uses autoreconf.

Remove MANUAL_CONF_DIRS and regenerate_manually, and use
regenerate_with_autoreconf for all directories.
---
 builder/containers/autoregen.py | 42 +--------------------------------
 1 file changed, 1 insertion(+), 41 deletions(-)

diff --git a/builder/containers/autoregen.py b/builder/containers/autoregen.py
index dd141c12b01d..a134d2c464a4 100755
--- a/builder/containers/autoregen.py
+++ b/builder/containers/autoregen.py
@@ -52,12 +52,6 @@ SKIP_DIRS = [
     "minizip",
 ]
 
-MANUAL_CONF_DIRS = [
-    ".",
-    # autoreconf does not update aclocal.m4
-    "fixincludes",
-    ]
-
 # Run the shell command CMD.
 #
 # Print the command on stdout prior to running it.
@@ -78,36 +72,6 @@ def regenerate_with_autoreconf():
 def regenerate_with_autogen():
     run_shell(f"{AUTOGEN_BIN} Makefile.def")
 
-def regenerate_manually():
-    configure_lines = open("configure.ac").read().splitlines()
-    if folder.stem == "fixincludes" or any(
-            True for line in configure_lines if line.startswith("AC_CONFIG_MACRO_DIR")
-    ):
-        include_arg = ""
-        include_arg2 = ""
-        if (folder / ".." / "config").is_dir():
-            include_arg = "-I../config"
-
-        if folder.stem == "fixincludes":
-            include_arg = "-I.."
-            include_arg2 = "-I../config"
-
-        # aclocal does not support the -f short option for force
-        run_shell(f"{ACLOCAL_BIN} --force {include_arg} {include_arg2}")
-
-    if (folder / "config.in").is_file() or any(
-        True for line in configure_lines if line.startswith("AC_CONFIG_HEADER")
-    ):
-        run_shell(f"{AUTOHEADER_BIN} -f")
-
-    # apparently automake is somehow unstable -> skip it for gotools
-    if any(
-        True for line in configure_lines if line.startswith("AM_INIT_AUTOMAKE")
-    ) and not str(folder).endswith("gotools"):
-        run_shell(f"{AUTOMAKE_BIN} -f")
-
-    run_shell(f"{AUTOCONF_BIN} -f")
-
 
 run_shell(f"{AUTOCONF_BIN} --version")
 run_shell(f"{AUTOMAKE_BIN} --version")
@@ -118,7 +82,6 @@ print(f"Extra environment: {EXTRA_ENV}", flush=True)
 
 config_folders: list[Path] = []
 autogen_folders: list[Path] = []
-repo_root = Path.cwd()
 
 for root, _, files in os.walk("."):
     for file in files:
@@ -140,7 +103,4 @@ for folder in sorted(config_folders):
     print(f"Entering directory {folder}", flush=True)
     os.chdir(folder)
 
-    if str(folder.relative_to(repo_root)) in MANUAL_CONF_DIRS:
-        regenerate_manually()
-    else:
-        regenerate_with_autoreconf()
+    regenerate_with_autoreconf()

base-commit: 2bd969c8f9b8e7d32a6a7a992b21042196442260
-- 
2.56.0



More information about the Buildbot mailing list