glibc 2.11: Cross-build for GNU/Hurd.

svn path=/nixpkgs/trunk/; revision=21752
This commit is contained in:
Ludovic Courtès 2010-05-12 15:46:51 +00:00
parent 2d4fa8897e
commit 7e08174782
3 changed files with 39 additions and 8 deletions

View File

@ -5,6 +5,7 @@ cross :
{ name, fetchurl, stdenv, installLocales ? false { name, fetchurl, stdenv, installLocales ? false
, gccCross ? null, kernelHeaders ? null , gccCross ? null, kernelHeaders ? null
, machHeaders ? null, hurdHeaders ? null, mig ? null
, profilingLibraries ? false, meta , profilingLibraries ? false, meta
, preConfigure ? "", ... }@args : , preConfigure ? "", ... }@args :
@ -77,7 +78,8 @@ stdenv.mkDerivation ({
"--without-fp" "--without-fp"
]; ];
buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]; buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
++ stdenv.lib.optional (mig != null) mig;
# Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to # Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to
# prevent a retained dependency on the bootstrap tools in the stdenv-linux # prevent a retained dependency on the bootstrap tools in the stdenv-linux
@ -149,4 +151,15 @@ stdenv.mkDerivation ({
maintainers = [ stdenv.lib.maintainers.ludo ]; maintainers = [ stdenv.lib.maintainers.ludo ];
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.linux;
} // meta; } // meta;
}) }
//
(if (cross != null && cross.config == "i586-pc-gnu")
then {
# Work around the fact that the configure snippet that looks for
# <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
# glibc expects both Mach and Hurd headers to be in the same place.
CPATH = "${hurdHeaders}/include:${machHeaders}/include";
}
else { }))

View File

@ -1,10 +1,14 @@
{ stdenv, fetchurl, kernelHeaders { stdenv, fetchurl, kernelHeaders
, machHeaders ? null, hurdHeaders ? null
, installLocales ? true , installLocales ? true
, profilingLibraries ? false , profilingLibraries ? false
, gccCross ? null , gccCross ? null
, mig ? null
}: }:
assert stdenv.gcc.gcc != null; assert stdenv.gcc.gcc != null;
assert (mig != null) -> (machHeaders != null);
assert (machHeaders != null) -> (hurdHeaders != null);
let let
build = import ./common.nix; build = import ./common.nix;
@ -37,6 +41,12 @@ in
// //
(if hurdHeaders != null
then { inherit machHeaders hurdHeaders mig; }
else { })
//
(if cross != null (if cross != null
then { then {
preConfigure = '' preConfigure = ''

View File

@ -3901,12 +3901,20 @@ let
installLocales = getPkgConfig "glibc" "locales" false; installLocales = getPkgConfig "glibc" "locales" false;
}; };
glibc211Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.11) { glibc211Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.11)
inherit stdenv fetchurl; (let crossGNU = (crossSystem.config == "i586-pc-gnu");
gccCross = gccCrossStageStatic; in ({
kernelHeaders = linuxHeadersCross; inherit stdenv fetchurl;
installLocales = getPkgConfig "glibc" "locales" false; gccCross = gccCrossStageStatic;
}); kernelHeaders = if crossGNU then hurdHeaders else linuxHeadersCross;
installLocales = getPkgConfig "glibc" "locales" false;
}
//
(if crossGNU
then { inherit machHeaders hurdHeaders; mig = migCross; }
else { }))));
glibcCross = glibc211Cross; glibcCross = glibc211Cross;