msvcrt is only one of the libcs in MinGW. We therefore replace explictly testing for msvcrt with the isMinGW predicate. This lays the foundation for ucrt64 support.
···5151 setOutputFlags = false;
5252 outputDoc = "dev"; # single tiny man3 page
53535454- dontConfigure = stdenv.hostPlatform.libc == "msvcrt";
5454+ dontConfigure = stdenv.hostPlatform.isMinGW;
55555656 preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
5757 export CHOST=${stdenv.hostPlatform.config}
···9696 ''
9797 # Non-typical naming confuses libtool which then refuses to use zlib's DLL
9898 # in some cases, e.g. when compiling libpng.
9999- + lib.optionalString (stdenv.hostPlatform.libc == "msvcrt" && shared) ''
9999+ + lib.optionalString (stdenv.hostPlatform.isMinGW && shared) ''
100100 ln -s zlib1.dll $out/bin/libz.dll
101101 '';
102102···109109 dontStrip = stdenv.hostPlatform != stdenv.buildPlatform && static;
110110 configurePlatforms = [];
111111112112- installFlags = lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
112112+ installFlags = lib.optionals stdenv.hostPlatform.isMinGW [
113113 "BINARY_PATH=$(out)/bin"
114114 "INCLUDE_PATH=$(dev)/include"
115115 "LIBRARY_PATH=$(out)/lib"
···120120121121 makeFlags = [
122122 "PREFIX=${stdenv.cc.targetPrefix}"
123123- ] ++ lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
123123+ ] ++ lib.optionals stdenv.hostPlatform.isMinGW [
124124 "-f" "win32/Makefile.gcc"
125125 ] ++ lib.optionals shared [
126126 # Note that as of writing (zlib 1.2.11), this flag only has an effect
+1-1
pkgs/top-level/all-packages.nix
···2174121741 # These are used when buiding compiler-rt / libgcc, prior to building libc.
2174221742 preLibcCrossHeaders = let
2174321743 inherit (stdenv.targetPlatform) libc;
2174421744- in if libc == "msvcrt" then targetPackages.windows.mingw_w64_headers or windows.mingw_w64_headers
2174421744+ in if stdenv.targetPlatform.isMinGW then targetPackages.windows.mingw_w64_headers or windows.mingw_w64_headers
2174521745 else if libc == "nblibc" then targetPackages.netbsdCross.headers or netbsdCross.headers
2174621746 else if libc == "libSystem" && stdenv.targetPlatform.isAarch64 then targetPackages.darwin.LibsystemCross or darwin.LibsystemCross
2174721747 else null;