From cea857bf73c94a7206e621825f479875472def79 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Tue, 3 Dec 2024 01:13:03 +0200 Subject: [PATCH] configure: win32: don't fail when building using tcc Commit 729918e ("make: make shorter command lines", 2024-11-21) added "-static" when $cc_name is gcc to statically link with the mingw gcc runtime, so that tcc.exe won't depend on additional non-system dlls. However, $cc_name is still the default value at this time - gcc, so "-static" was unconditional, and it failed if $cc is tcc (msvcrt). This commit instead checks the already known $cc, and restores the ability to build tcc using tcc (if "$cc" doesn't contain "gcc"). --- configure | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 1f466914..88d8bf89 100755 --- a/configure +++ b/configure @@ -379,8 +379,9 @@ case $targetos in default libdir "${tccdir}/libtcc" # set tccdir at runtime from executable path test "$tccdir" = "$bindir" && tccdir_auto="yes" - # avoid mingw dependencies such as 'libgcc_s_dw2-1.dll' - test "$cc_name" = "gcc" && default LDFLAGS "-static" + # chech $cc to avoid mingw gcc dependencies such as 'libgcc_s_dw2-1.dll' + # (no confirmed $cc_name yet, and also will never have if cross compiling) + test "${cc%gcc*}" = "$cc" || default LDFLAGS "-static" LIBSUF=".lib" EXESUF=".exe" DLLSUF=".dll"