From 000c2c51fdfffcd0b0cc91011d53080bf1f6513c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 21 May 2010 13:46:46 +0000 Subject: [PATCH] GCC 4.5: Patch the spec string for GNU/Hurd to add the right `-I' flags. svn path=/nixpkgs/trunk/; revision=21934 --- .../development/compilers/gcc-4.5/default.nix | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkgs/development/compilers/gcc-4.5/default.nix b/pkgs/development/compilers/gcc-4.5/default.nix index 62a4e01803d..6f7854794b7 100644 --- a/pkgs/development/compilers/gcc-4.5/default.nix +++ b/pkgs/development/compilers/gcc-4.5/default.nix @@ -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;