Merge pull request #1928 from 'cross-win-osx'.

This includes a lot of fixes for cross-building to Windows and Mac OS X
and could possibly fix things even for non-cross-builds, like for
example OpenSSL on Windows.

The main reason for merging this in 14.04 already is that we already
have runInWindowsVM in master and it doesn't work until we actually
cross-build Cygwin's setup binary as the upstream version is a fast
moving target which gets _overwritten_ on every new release.

Conflicts:
	pkgs/top-level/all-packages.nix
This commit is contained in:
aszlig
2014-04-21 10:00:35 +02:00
36 changed files with 523 additions and 124 deletions

View File

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

View File

@@ -117,7 +117,8 @@ let version = "4.8.2";
withMode;
/* Cross-gcc settings */
crossMingw = (cross != null && cross.libc == "msvcrt");
crossMingw = cross != null && cross.libc == "msvcrt";
crossDarwin = cross != null && cross.libc == "libSystem";
crossConfigureFlags = let
gccArch = stdenv.cross.gcc.arch or null;
gccCpu = stdenv.cross.gcc.cpu or null;
@@ -161,7 +162,13 @@ let version = "4.8.2";
" --disable-shared" +
" --disable-decimal-float" # libdecnumber requires libc
else
" --with-headers=${libcCross}/include" +
(if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
else " --with-headers=${libcCross}/include") +
# Ensure that -print-prog-name is able to find the correct programs.
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
" --with-ld=${binutilsCross}/bin/${cross.config}-ld"
)) +
" --enable-__cxa_atexit" +
" --enable-long-long" +
(if crossMingw then
@@ -175,10 +182,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.
@@ -346,6 +351,7 @@ stdenv.mkDerivation ({
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
++ optionals crossDarwin [ "objc" "obj-c++" ]
)
)
}