From d5c9fb3e04c32f9e1bcf1aca5c5822f7e37d06e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 21 Mar 2023 12:03:18 +0200 Subject: [PATCH] build-mingw-w64: Pass --disable-dependency-tracking when configuring mingw-w64-crt on MSYS2 Configuring the mingw-w64-crt build takes a really long time on MSYS2; the generating Makefile phase takes easily 4-5 minutes, when the rest of configure runs in a matter of seconds. By passing --disable-dependency-tracking, the whole configure for mingw-w64-crt takes 11-14 seconds where it previously took many mnutes. This comes with the drawback that these build directories aren't suitable for incremental development (unless manual care is taken to rebuild all necessary files), but these builds are mostly done for non-interactive building. Thanks to Jeremy Drake for realizing this optimization opportunity, and LIU Hao for making me aware of it. --- build-mingw-w64.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build-mingw-w64.sh b/build-mingw-w64.sh index b3e208a..0be04bc 100755 --- a/build-mingw-w64.sh +++ b/build-mingw-w64.sh @@ -74,6 +74,12 @@ if command -v gmake >/dev/null; then MAKE=gmake fi +case $(uname) in +MINGW*|MSYS*) + CRT_CONFIG_FLAGS="--disable-dependency-tracking" + ;; +esac + export PATH="$PREFIX/bin:$PATH" unset CC @@ -126,7 +132,7 @@ for arch in $ARCHS; do ;; esac FLAGS="$FLAGS --with-default-msvcrt=$DEFAULT_MSVCRT" - ../configure --host=$arch-w64-mingw32 --prefix="$PREFIX/$arch-w64-mingw32" $FLAGS $CFGUARD_FLAGS + ../configure --host=$arch-w64-mingw32 --prefix="$PREFIX/$arch-w64-mingw32" $FLAGS $CFGUARD_FLAGS $CRT_CONFIG_FLAGS $MAKE -j$CORES $MAKE install cd ..