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").
This commit is contained in:
Avi Halachmi (:avih) 2024-12-03 01:13:03 +02:00
parent 729918ef35
commit cea857bf73

5
configure vendored
View file

@ -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"