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.
···51 setOutputFlags = false;
52 outputDoc = "dev"; # single tiny man3 page
5354- dontConfigure = stdenv.hostPlatform.libc == "msvcrt";
5556 preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
57 export CHOST=${stdenv.hostPlatform.config}
···96 ''
97 # Non-typical naming confuses libtool which then refuses to use zlib's DLL
98 # in some cases, e.g. when compiling libpng.
99- + lib.optionalString (stdenv.hostPlatform.libc == "msvcrt" && shared) ''
100 ln -s zlib1.dll $out/bin/libz.dll
101 '';
102···109 dontStrip = stdenv.hostPlatform != stdenv.buildPlatform && static;
110 configurePlatforms = [];
111112- installFlags = lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
113 "BINARY_PATH=$(out)/bin"
114 "INCLUDE_PATH=$(dev)/include"
115 "LIBRARY_PATH=$(out)/lib"
···120121 makeFlags = [
122 "PREFIX=${stdenv.cc.targetPrefix}"
123- ] ++ lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
124 "-f" "win32/Makefile.gcc"
125 ] ++ lib.optionals shared [
126 # Note that as of writing (zlib 1.2.11), this flag only has an effect
···51 setOutputFlags = false;
52 outputDoc = "dev"; # single tiny man3 page
5354+ dontConfigure = stdenv.hostPlatform.isMinGW;
5556 preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
57 export CHOST=${stdenv.hostPlatform.config}
···96 ''
97 # Non-typical naming confuses libtool which then refuses to use zlib's DLL
98 # in some cases, e.g. when compiling libpng.
99+ + lib.optionalString (stdenv.hostPlatform.isMinGW && shared) ''
100 ln -s zlib1.dll $out/bin/libz.dll
101 '';
102···109 dontStrip = stdenv.hostPlatform != stdenv.buildPlatform && static;
110 configurePlatforms = [];
111112+ installFlags = lib.optionals stdenv.hostPlatform.isMinGW [
113 "BINARY_PATH=$(out)/bin"
114 "INCLUDE_PATH=$(dev)/include"
115 "LIBRARY_PATH=$(out)/lib"
···120121 makeFlags = [
122 "PREFIX=${stdenv.cc.targetPrefix}"
123+ ] ++ lib.optionals stdenv.hostPlatform.isMinGW [
124 "-f" "win32/Makefile.gcc"
125 ] ++ lib.optionals shared [
126 # Note that as of writing (zlib 1.2.11), this flag only has an effect
+1-1
pkgs/top-level/all-packages.nix
···21741 # These are used when buiding compiler-rt / libgcc, prior to building libc.
21742 preLibcCrossHeaders = let
21743 inherit (stdenv.targetPlatform) libc;
21744- in if libc == "msvcrt" then targetPackages.windows.mingw_w64_headers or windows.mingw_w64_headers
21745 else if libc == "nblibc" then targetPackages.netbsdCross.headers or netbsdCross.headers
21746 else if libc == "libSystem" && stdenv.targetPlatform.isAarch64 then targetPackages.darwin.LibsystemCross or darwin.LibsystemCross
21747 else null;
···21741 # These are used when buiding compiler-rt / libgcc, prior to building libc.
21742 preLibcCrossHeaders = let
21743 inherit (stdenv.targetPlatform) libc;
21744+ in if stdenv.targetPlatform.isMinGW then targetPackages.windows.mingw_w64_headers or windows.mingw_w64_headers
21745 else if libc == "nblibc" then targetPackages.netbsdCross.headers or netbsdCross.headers
21746 else if libc == "libSystem" && stdenv.targetPlatform.isAarch64 then targetPackages.darwin.LibsystemCross or darwin.LibsystemCross
21747 else null;