Files
John Crispin 6eae1d6b77 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 <john@phrozen.org>
2026-09-22 20:29:59 +02:00

44 lines
1010 B
Makefile

#
# Copyright (C) 2008-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=flex
PKG_CPE_ID:=cpe:/a:westes:flex
PKG_VERSION:=2.6.4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/westes/flex/releases/download/v$(PKG_VERSION)/
PKG_HASH:=e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995
HOST_FIXUP:=autoreconf
HOST_BUILD_PARALLEL:=1
HOST_CONFIGURE_CACHE:=1
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIGURE_ARGS += --disable-shared
define Host/Compile
$(call Host/Compile/Default,SUBDIRS='src tools')
endef
define Host/Install
$(call Host/Compile/Default,install SUBDIRS='src tools')
$(LN) flex $(STAGING_DIR_HOST)/bin/lex
endef
define Host/Uninstall
-$(call Host/Compile/Default,uninstall SUBDIRS='src tools')
endef
define Host/Clean
rm -f $(STAGING_DIR_HOST)/bin/lex
$(call Host/Clean/Default)
endef
$(eval $(call HostBuild))