GCC 4.5: Patch the right header file for pthread on GNU.

svn path=/nixpkgs/trunk/; revision=22593
This commit is contained in:
Ludovic Courtès 2010-07-13 23:42:25 +00:00
parent ed1172a0e5
commit 29ee6afbea

View File

@ -154,7 +154,8 @@ stdenv.mkDerivation ({
# in glibc, so add the right `-I' flags to the default spec string. # in glibc, so add the right `-I' flags to the default spec string.
let let
libc = if cross != null then libcCross else stdenv.glibc; libc = if cross != null then libcCross else stdenv.glibc;
config_h = "gcc/config/i386/gnu.h"; gnu_h = "gcc/config/gnu.h";
i386_gnu_h = "gcc/config/i386/gnu.h";
extraCPPDeps = extraCPPDeps =
libc.propagatedBuildInputs libc.propagatedBuildInputs
++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross ++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
@ -165,12 +166,12 @@ stdenv.mkDerivation ({
pthreadLib = pthreadLib =
if libpthreadCross != null then libpthreadCross else libpthread; if libpthreadCross != null then libpthreadCross else libpthread;
in in
'' echo "augmenting \`CPP_SPEC' in \`${config_h}' with \`${extraCPPSpec}'..." '' echo "augmenting \`CPP_SPEC' in \`${i386_gnu_h}' with \`${extraCPPSpec}'..."
sed -i "${config_h}" \ sed -i "${i386_gnu_h}" \
-es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g' -es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
echo "augmenting \`LIB_SPEC' in \`${config_h}' for libpthread at \`${pthreadLib}'..." echo "augmenting \`LIB_SPEC' in \`${gnu_h}' for libpthread at \`${pthreadLib}'..."
sed -i "${config_h}" \ sed -i "${gnu_h}" \
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "-L${pthreadLib}/lib \1|g' -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "-L${pthreadLib}/lib \1|g'
'' ''
else null; else null;