mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
Use mingw-w64 for 32bit Windows builds as well.
Mingw(32) is rather poorly maintaned and has quite a lot of bugs. And because our Windows cross builds were also poorly maintained and most of the cross-tests were broken as well, I'm just taking this step and try to switch to mingw-w64 for everything "cross Windows". Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
ae0b5d6813
commit
e64b342fa8
|
@ -159,10 +159,8 @@ let version = "4.6.3";
|
|||
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
||||
# unless adding "-lsupc++" to any linking command. I don't know why.
|
||||
" --disable-shared" +
|
||||
(if cross.config == "x86_64-w64-mingw32" then
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
" --enable-fully-dynamic-string"
|
||||
else "")
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
" --enable-fully-dynamic-string"
|
||||
else (if cross.libc == "uclibc" then
|
||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||
# and as I don't know how to pass it, I disable libgomp.
|
||||
|
|
|
@ -175,10 +175,8 @@ let version = "4.8.2";
|
|||
# In any case, mingw32 g++ linking is broken by default with shared libs,
|
||||
# unless adding "-lsupc++" to any linking command. I don't know why.
|
||||
" --disable-shared" +
|
||||
(if cross.config == "x86_64-w64-mingw32" then
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
" --enable-fully-dynamic-string"
|
||||
else "")
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
" --enable-fully-dynamic-string"
|
||||
else (if cross.libc == "uclibc" then
|
||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||
# and as I don't know how to pass it, I disable libgomp.
|
||||
|
|
|
@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
|
|||
'';
|
||||
|
||||
crossAttrs = let
|
||||
isMingwW64 = stdenv.cross.config == "x86_64-w64-mingw32";
|
||||
isMingw = stdenv.cross.libc == "msvcrt";
|
||||
in {
|
||||
configurePhase = ''
|
||||
makeFlagsArray=(
|
||||
|
@ -61,9 +61,9 @@ stdenv.mkDerivation rec {
|
|||
RANLIB=${stdenv.cross.config}-ranlib
|
||||
V=${majorVersion}
|
||||
R=${version}
|
||||
${stdenv.lib.optionals isMingwW64 "mingw"}
|
||||
${stdenv.lib.optionals isMingw "mingw"}
|
||||
)
|
||||
'' + stdenv.lib.optionalString isMingwW64 ''
|
||||
'' + stdenv.lib.optionalString isMingw ''
|
||||
installFlagsArray=(
|
||||
TO_BIN="lua.exe luac.exe"
|
||||
TO_LIB="liblua.a lua52.dll"
|
||||
|
|
|
@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
|
|||
|
||||
crossAttrs = {
|
||||
configureFlags = configureFlagsFun {
|
||||
alsaSupport = stdenv.cross.config != "x86_64-w64-mingw32";
|
||||
alsaSupport = stdenv.cross.libc != "msvcrt";
|
||||
alsaLib = alsaLib.crossDrv;
|
||||
} + "--disable-directx";
|
||||
};
|
||||
|
|
|
@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
|
|||
"CC=${stdenv.cross.config}-gcc"
|
||||
"LD=${stdenv.cross.config}-gcc"
|
||||
"STRIP="
|
||||
] ++ optional (stdenv.cross.config == "x86_64-w64-mingw32") "SYSTEM=mingw";
|
||||
] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw";
|
||||
|
||||
meta = {
|
||||
description = "An OpenGL extension loading library for C(++)";
|
||||
|
|
|
@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
|
|||
# XXX: test failure on Cygwin
|
||||
# we are running out of stack on both freeBSDs on Hydra
|
||||
|
||||
crossAttrs = optionalAttrs (stdenv.cross.config == "x86_64-w64-mingw32") {
|
||||
crossAttrs = optionalAttrs (stdenv.cross.libc == "msvcrt") {
|
||||
buildInputs = [ windows.mingw_w64_pthreads.crossDrv ];
|
||||
};
|
||||
|
||||
|
|
|
@ -148,8 +148,7 @@ stdenv.mkDerivation rec {
|
|||
'';
|
||||
|
||||
crossAttrs = let
|
||||
isMingw = stdenv.cross.config == "i686-pc-mingw32" ||
|
||||
stdenv.cross.config == "x86_64-w64-mingw32";
|
||||
isMingw = stdenv.cross.libc == "msvcrt";
|
||||
in {
|
||||
# I've not tried any case other than i686-pc-mingw32.
|
||||
# -nomake tools: it fails linking some asian language symbols
|
||||
|
|
|
@ -19,7 +19,7 @@ stdenv.mkDerivation (rec {
|
|||
preConfigure = ''
|
||||
cd mingw-w64-headers
|
||||
'';
|
||||
configureFlags = "--without-crt --host=x86_64-w64-mingw32";
|
||||
configureFlags = "--without-crt";
|
||||
} else if onlyPthreads then {
|
||||
name = name + "-pthreads";
|
||||
preConfigure = ''
|
||||
|
|
|
@ -2419,9 +2419,7 @@ let
|
|||
|
||||
gccCrossStageStatic = let
|
||||
isMingw = (stdenv.cross.libc == "msvcrt");
|
||||
isMingw64 = isMingw && stdenv.cross.config == "x86_64-w64-mingw32";
|
||||
libcCross1 = if isMingw64 then windows.mingw_w64_headers else
|
||||
if isMingw then windows.mingw_headers1 else null;
|
||||
libcCross1 = if isMingw then windows.mingw_w64_headers else null;
|
||||
in
|
||||
wrapGCCCross {
|
||||
gcc = forceNativeDrv (lib.addMetaAttrs { hydraPlatforms = []; } (
|
||||
|
@ -4235,9 +4233,7 @@ let
|
|||
# We can choose:
|
||||
libcCrossChooser = name : if name == "glibc" then glibcCross
|
||||
else if name == "uclibc" then uclibcCross
|
||||
else if name == "msvcrt" && stdenv.cross.config == "x86_64-w64-mingw32" then
|
||||
windows.mingw_w64
|
||||
else if name == "msvcrt" then windows.mingw_headers3
|
||||
else if name == "msvcrt" then windows.mingw_w64
|
||||
else throw "Unknown libc";
|
||||
|
||||
libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc;
|
||||
|
|
|
@ -140,11 +140,11 @@ in {
|
|||
crossUltraSparcLinux = mapTestOnCross crossSystem basic;
|
||||
}) // (
|
||||
|
||||
/* Test some cross builds on mingw32 */
|
||||
/* Test some cross builds on 32 bit mingw-w64 */
|
||||
let
|
||||
crossSystem = {
|
||||
config = "i686-pc-mingw32";
|
||||
arch = "x86";
|
||||
config = "i686-w64-mingw32";
|
||||
arch = "x86"; # Irrelevant
|
||||
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
|
||||
platform = {};
|
||||
};
|
||||
|
@ -161,11 +161,10 @@ in {
|
|||
};
|
||||
}) // (
|
||||
|
||||
/* Test some cross builds on mingw-w64 */
|
||||
/* Test some cross builds on 64 bit mingw-w64 */
|
||||
let
|
||||
crossSystem = {
|
||||
# That's the triplet they use in the mingw-w64 docs,
|
||||
# and it's relevant for nixpkgs conditions.
|
||||
# That's the triplet they use in the mingw-w64 docs.
|
||||
config = "x86_64-w64-mingw32";
|
||||
arch = "x86_64"; # Irrelevant
|
||||
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
|
||||
|
|
Loading…
Reference in a new issue