From 6eae1d6b772eeb012046f64be83ecf9ea5ef7514 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 22 Sep 2026 20:23:21 +0200 Subject: [PATCH] tools: cache the configure results of eleven more autotools tools Configure stage without a cache against a warm cache: mtools 3.34 s -> 0.28 s gengetopt 4.39 s -> 2.13 s fakeroot 10.97 s -> 8.73 s xz 4.32 s -> 2.17 s libressl 3.07 s -> 1.46 s flex 12.32 s -> 10.98 s expat 2.74 s -> 1.52 s bc 1.34 s -> 0.38 s dosfstools 3.13 s -> 2.54 s libtool 2.86 s -> 2.29 s mtd-utils 4.06 s -> 3.56 s flex, fakeroot, dosfstools and mtd-utils run autoreconf in the same stage, and the cache does not reach that part. Each of the eleven configures the same way with a warm cache as it does without one: the check configures three times, without a cache, with a cold cache and with a warm cache, and every generated file of the first and the last run is identical. A static scan of each configure script found no cache check that changes CFLAGS, CPPFLAGS, LDFLAGS or LIBS without restoring it. patchelf, mklibs and automake pass the same check but gain less than half a second, so they stay out. make world after make tools/clean now takes 121 s against 177 s with cold caches. Signed-off-by: John Crispin --- tools/bc/Makefile | 2 ++ tools/dosfstools/Makefile | 1 + tools/expat/Makefile | 1 + tools/fakeroot/Makefile | 2 ++ tools/flex/Makefile | 1 + tools/gengetopt/Makefile | 1 + tools/libressl/Makefile | 1 + tools/libtool/Makefile | 1 + tools/mtd-utils/Makefile | 1 + tools/mtools/Makefile | 1 + tools/xz/Makefile | 1 + 11 files changed, 13 insertions(+) diff --git a/tools/bc/Makefile b/tools/bc/Makefile index 1523ad1f65b..5fb1d813287 100644 --- a/tools/bc/Makefile +++ b/tools/bc/Makefile @@ -17,6 +17,8 @@ PKG_CPE_ID:=cpe:/a:gnu:bc PKG_SUBDIRS:=lib bc dc +HOST_CONFIGURE_CACHE:=1 + include $(INCLUDE_DIR)/host-build.mk define Host/Uninstall diff --git a/tools/dosfstools/Makefile b/tools/dosfstools/Makefile index 485387fa9d9..8701ab0acdd 100644 --- a/tools/dosfstools/Makefile +++ b/tools/dosfstools/Makefile @@ -18,6 +18,7 @@ PKG_HASH:=64926eebf90092dca21b14259a5301b7b98e7b1943e8a201c7d726084809b527 HOST_FIXUP:=autoreconf HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/expat/Makefile b/tools/expat/Makefile index 2c0d49177cc..1bcba8f40fc 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -16,6 +16,7 @@ PKG_HASH:=b8ece2437692dad44d851c4532723390a5a330990007706be9c8d2b90d294f36 PKG_SOURCE_URL:=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(PKG_VERSION)) HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile index e4baf206f3c..f8b0233c12a 100644 --- a/tools/fakeroot/Makefile +++ b/tools/fakeroot/Makefile @@ -15,6 +15,8 @@ PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf +HOST_CONFIGURE_CACHE:=1 + include $(INCLUDE_DIR)/host-build.mk HOST_CONFIGURE_VARS += \ diff --git a/tools/flex/Makefile b/tools/flex/Makefile index 177136b78c7..ef45086acc5 100644 --- a/tools/flex/Makefile +++ b/tools/flex/Makefile @@ -16,6 +16,7 @@ PKG_HASH:=e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995 HOST_FIXUP:=autoreconf HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/gengetopt/Makefile b/tools/gengetopt/Makefile index 5a5b5eb7cbb..19ca7624338 100644 --- a/tools/gengetopt/Makefile +++ b/tools/gengetopt/Makefile @@ -16,6 +16,7 @@ PKG_HASH:=b941aec9011864978dd7fdeb052b1943535824169d2aa2b0e7eae9ab807584ac PKG_SUBDIRS:=$$$$(foreach dir,gl src skels,$$$$(wildcard $$$$(dir)) ) HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile index 91045778a10..69c64a40408 100644 --- a/tools/libressl/Makefile +++ b/tools/libressl/Makefile @@ -19,6 +19,7 @@ PKG_SOURCE_URL:=https://mirror.ox.ac.uk/pub/OpenBSD/LibreSSL \ https://ftp.openbsd.org/pub/OpenBSD/LibreSSL HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/libtool/Makefile b/tools/libtool/Makefile index 4992fa77103..ada23b1fd9d 100644 --- a/tools/libtool/Makefile +++ b/tools/libtool/Makefile @@ -15,6 +15,7 @@ PKG_SOURCE_URL:=@GNU/$(PKG_NAME) PKG_HASH:=da8ebb2ce4dcf46b90098daf962cffa68f4b4f62ea60f798d0ef12929ede6adf HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile index dc877d3b63d..9ae6d1d7451 100644 --- a/tools/mtd-utils/Makefile +++ b/tools/mtd-utils/Makefile @@ -18,6 +18,7 @@ PKG_CPE_ID:=cpe:/a:mtd-utils_project:mtd-utils PKG_FIXUP:=autoreconf HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/mtools/Makefile b/tools/mtools/Makefile index 0d38c0c9e60..2288660f667 100644 --- a/tools/mtools/Makefile +++ b/tools/mtools/Makefile @@ -14,6 +14,7 @@ PKG_SOURCE_URL:=@GNU/$(PKG_NAME) PKG_HASH:=6fe5193583d6e7c59da75e63d7234f76c0b07caf33b103894f46f66a871ffc9f HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/xz/Makefile b/tools/xz/Makefile index 1c2f4993131..3e923a8e25d 100644 --- a/tools/xz/Makefile +++ b/tools/xz/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=3340ae48f88665abc78d71dc43446fb3f7e70b48fd59844ac0e14958cef6e00b PKG_CPE_ID:=cpe:/a:tukaani:xz HOST_BUILD_PARALLEL:=1 +HOST_CONFIGURE_CACHE:=1 include $(INCLUDE_DIR)/host-build.mk