]> wimlib.net Git - wimlib/commitdiff
windows-build.sh: ensure that -static-libgcc is used with MSYS2 gcc
authorEric Biggers <ebiggers3@gmail.com>
Wed, 7 Feb 2024 06:26:50 +0000 (22:26 -0800)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 7 Feb 2024 06:26:50 +0000 (22:26 -0800)
In MSYS2 MINGW32, the gcc version is "i686-w64-mingw32-cc.exe (Rev4,
Built by MSYS2 project) 13.2.0" which does not contain the string
"(GCC)" as expected.  Similarly for MSYS2 MINGW64.  This means that
-static-libgcc does not get used as intended.  As a quick fix, just
invert the check, so gcc is now detected by checking for not clang..

tools/windows-build.sh

index e6ce4a083583efa1e6953dfcc7f96a25aba8fe7e..63bd58b4777102c781fef094f7242d2b679dd717 100755 (executable)
@@ -217,7 +217,7 @@ configure_wimlib()
                fi
                exit 1
        fi
-       if "$cc" --version | grep -q '(GCC)'; then
+       if ! "$cc" --version | grep -q -i 'clang'; then
                configure_args+=("CC=$cc -static-libgcc")
        fi
        configure_args+=("${EXTRA_CONFIGURE_ARGS[@]}")