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

@ -5,6 +5,7 @@ cross :
{ name, fetchurl, stdenv, installLocales ? false
, gccCross ? null, kernelHeaders ? null
, machHeaders ? null, hurdHeaders ? null, mig ? null
, profilingLibraries ? false, meta
, preConfigure ? "", ... }@args :
@ -77,7 +78,8 @@ stdenv.mkDerivation ({
"--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
# prevent a retained dependency on the bootstrap tools in the stdenv-linux
@ -149,4 +151,15 @@ stdenv.mkDerivation ({
maintainers = [ stdenv.lib.maintainers.ludo ];
platforms = stdenv.lib.platforms.linux;
} // 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 { }))

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

@ -3901,12 +3901,20 @@ let
installLocales = getPkgConfig "glibc" "locales" false;
};
glibc211Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.11) {
inherit stdenv fetchurl;
gccCross = gccCrossStageStatic;
kernelHeaders = linuxHeadersCross;
installLocales = getPkgConfig "glibc" "locales" false;
});
glibc211Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.11)
(let crossGNU = (crossSystem.config == "i586-pc-gnu");
in ({
inherit stdenv fetchurl;
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;