GCC 4.5: Patch the spec string for GNU/Hurd to add the right `-I' flags.

svn path=/nixpkgs/trunk/; revision=21934
This commit is contained in:
Ludovic Courtès 2010-05-21 13:46:46 +00:00
parent 77430510ed
commit 000c2c51fd

View File

@ -143,6 +143,27 @@ stdenv.mkDerivation ({
++ optional langVhdl ./ghdl-ortho-cflags.patch
;
postPatch =
if (stdenv.system == "i586-pc-gnu"
|| (cross != null && cross.config == "i586-pc-gnu"
&& libcCross != null))
then
# On GNU/Hurd glibc refers to Hurd & Mach headers so add the right `-I'
# flags to the default spec string.
let
libc = if cross != null then libcCross else stdenv.glibc;
config_h = "gcc/config/i386/gnu.h";
extraCPPSpec =
concatStrings (intersperse " "
(map (x: "-I${x}/include")
libc.propagatedBuildInputs));
in
'' echo "augmenting \`CPP_SPEC' in \`${config_h}' with \`${extraCPPSpec}'..."
sed -i "${config_h}" \
-es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
''
else null;
inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
libcCross crossMingw;