From cd322612ccb66e35878ed7f9d3e562f9f4b4bd09 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 20 Sep 2026 17:20:18 +0200 Subject: [PATCH] tools: cache the configure results of ten autotools tools These ten hold up the wall clock on their own. Their configure stages run while nothing else does, because the tools build in dependency order. Measured over a full build, cold cache against warm: sed 21.68 s -> 1.22 s m4 21.48 s -> 1.22 s findutils 19.47 s -> 1.56 s tar 17.75 s -> 1.47 s cpio 14.28 s -> 1.26 s bison 12.81 s -> 1.29 s patch 12.16 s -> 1.31 s elfutils 26.58 s -> 15.47 s Each of the ten configures the same way with a warm cache as it does without one. The check runs configure three times, without a cache, with a cold cache and with a warm cache, and compares every file that configure generates between the first and the last. ncurses fails that check; these do not. The only difference left is ac_ct_AR and ac_ct_RANLIB, which a cold run fills through the fallback path of AC_CHECK_TOOL and a warm run leaves empty. AR and RANLIB are correct in both, and no generated Makefile reads the ac_ct_ form. tools/cmake keeps its 33 s, the longest configure stage in the build. It bootstraps with its own script rather than autoconf, so this does not reach it. Signed-off-by: John Crispin --- tools/bison/Makefile | 1 + tools/cpio/Makefile | 2 ++ tools/e2fsprogs/Makefile | 1 + tools/elfutils/Makefile | 1 + tools/findutils/Makefile | 1 + tools/gmp/Makefile | 1 + tools/m4/Makefile | 1 + tools/patch/Makefile | 1 + tools/sed/Makefile | 1 + tools/tar/Makefile | 1 + 10 files changed, 11 insertions(+) diff --git a/tools/bison/Makefile b/tools/bison/Makefile index 4cb0faf3365..f704137ba08 100644 --- a/tools/bison/Makefile +++ b/tools/bison/Makefile @@ -15,6 +15,7 @@ PKG_HASH:=06c9e13bdf7eb24d4ceb6b59205a4f67c2c7e7213119644430fe82fbd14a0abb PKG_CPE_ID:=cpe:/a:gnu:bison HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/cpio/Makefile b/tools/cpio/Makefile index 22faa06e261..634387ea855 100644 --- a/tools/cpio/Makefile +++ b/tools/cpio/Makefile @@ -9,6 +9,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@GNU/cpio PKG_HASH:=937610b97c329a1ec9268553fb780037bcfff0dcffe9725ebc4fd9c1aa9075db +HOST_CONFIGURE_CACHE:=1 + HOST_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile index cfcbd0f21fd..8f6c25b7552 100644 --- a/tools/e2fsprogs/Makefile +++ b/tools/e2fsprogs/Makefile @@ -16,6 +16,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/ HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/elfutils/Makefile b/tools/elfutils/Makefile index 294947df100..2fcc13fa5cb 100644 --- a/tools/elfutils/Makefile +++ b/tools/elfutils/Makefile @@ -49,6 +49,7 @@ PKG_GNULIB_MODS = \ tsearch HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/findutils/Makefile b/tools/findutils/Makefile index 6587c759f88..c0716168998 100644 --- a/tools/findutils/Makefile +++ b/tools/findutils/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=1387e0b67ff247d2abde998f90dfbf70c1491391a59ddfecb8ae698789f0a4f5 PKG_PROGRAMS:=find locate updatedb xargs HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/gmp/Makefile b/tools/gmp/Makefile index f1aa5b1a405..a1a1e976991 100644 --- a/tools/gmp/Makefile +++ b/tools/gmp/Makefile @@ -17,6 +17,7 @@ PKG_CPE_ID:=cpe:/a:gmplib:gmp HOST_FIXUP:=autoreconf HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/m4/Makefile b/tools/m4/Makefile index 84898904fec..dbe46250b70 100644 --- a/tools/m4/Makefile +++ b/tools/m4/Makefile @@ -15,6 +15,7 @@ PKG_SOURCE_URL:=@GNU/$(PKG_NAME) PKG_HASH:=38ae59f7a30bf9c108193cc5c25fbb06014f21e230c7ede2eff614f7b7c37ed8 HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/patch/Makefile b/tools/patch/Makefile index 785793685c0..58b091ddea1 100644 --- a/tools/patch/Makefile +++ b/tools/patch/Makefile @@ -16,6 +16,7 @@ PKG_SOURCE_URL:=@GNU/patch PKG_HASH:=308a4983ff324521b9b21310bfc2398ca861798f02307c79eb99bb0e0d2bf980 HOST_BUILD_PARALLEL := 1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/sed/Makefile b/tools/sed/Makefile index db17030fbbf..d7e562346fa 100644 --- a/tools/sed/Makefile +++ b/tools/sed/Makefile @@ -17,6 +17,7 @@ PKG_CPE_ID:=cpe:/a:gnu:sed export SED:= HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 HOSTCC := $(HOSTCC_NOCACHE) HOSTCXX := $(HOSTCXX_NOCACHE) diff --git a/tools/tar/Makefile b/tools/tar/Makefile index 8bedb8eb13e..b58150af1f4 100644 --- a/tools/tar/Makefile +++ b/tools/tar/Makefile @@ -15,6 +15,7 @@ PKG_SOURCE_URL:=@GNU/tar PKG_HASH:=14d55e32063ea9526e057fbf35fcabd53378e769787eff7919c3755b02d2b57e HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk