mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
* Patched gcc so that it doesn't search the standard include directories
(/usr/include, /usr/local/include, etc.). * Immediate pay-off: we see that the glibc header files depend on the Linux kernel header files. So I've added a package that extracts the appropriate headers from Linux 2.4.22. svn path=/nixpkgs/trunk/; revision=361
This commit is contained in:
parent
3638af3cab
commit
e83fe5ee78
@ -4,11 +4,23 @@
|
||||
export PATH=$binutils/bin:$PATH
|
||||
|
||||
tar xvfj $src || exit 1
|
||||
|
||||
# Disable the standard include directories.
|
||||
cd gcc-* || exit 1
|
||||
cat >> ./gcc/cppdefault.h <<EOF
|
||||
#undef LOCAL_INCLUDE_DIR
|
||||
#undef SYSTEM_INCLUDE_DIR
|
||||
#undef STANDARD_INCLUDE_DIR
|
||||
EOF
|
||||
cd .. || exit 1
|
||||
|
||||
# Configure.
|
||||
mkdir build || exit 1
|
||||
cd build || exit 1
|
||||
../gcc-*/configure --prefix=$out --enable-languages=c,c++ || exit 1
|
||||
|
||||
extraflags="$NIX_CFLAGS $NIX_LDFLAGS -Wl,-s"
|
||||
# Patch some of the makefiles to force linking against our own glibc.
|
||||
extraflags="$NIX_CFLAGS $NIX_LDFLAGS -Wl,-s -isystem $linux/include"
|
||||
|
||||
mf=Makefile
|
||||
sed \
|
||||
@ -22,5 +34,14 @@ sed \
|
||||
< $mf > $mf.tmp || exit 1
|
||||
mv $mf.tmp $mf
|
||||
|
||||
# Patch gcc/Makefile to prevent fixinc.sh from "fixing" system header files
|
||||
# from /usr/include.
|
||||
mf=gcc/Makefile
|
||||
sed \
|
||||
-e "s^NATIVE_SYSTEM_HEADER_DIR =\(.*\)^NATIVE_SYSTEM_HEADER_DIR = /fixinc-disabled^" \
|
||||
< $mf > $mf.tmp || exit 1
|
||||
mv $mf.tmp $mf
|
||||
|
||||
# Build and install.
|
||||
make bootstrap || exit 1
|
||||
make install || exit 1
|
||||
|
@ -10,5 +10,6 @@ Package(
|
||||
|
||||
, ("stdenv", IncludeFix("stdenv-linux/stdenv-nativetools.fix"))
|
||||
, ("binutils", IncludeFix("binutils/binutils.fix"))
|
||||
, ("linux", IncludeFix("linux-headers/linux-headers.fix"))
|
||||
]
|
||||
)
|
||||
|
11
pkgs/linux-headers/linux-headers-build.sh
Executable file
11
pkgs/linux-headers/linux-headers-build.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#! /bin/sh
|
||||
|
||||
. $stdenv/setup || exit 1
|
||||
|
||||
mkdir $out || exit 1
|
||||
cd $out || exit 1
|
||||
tar xvfj $src 'linux-*/include/linux' 'linux-*/include/asm-i386' || exit 1
|
||||
mv linux-*/include . || exit 1
|
||||
rmdir linux-* || exit 1
|
||||
cd include || exit 1
|
||||
ln -s asm-i386 asm || exit 1
|
13
pkgs/linux-headers/linux-headers.fix
Normal file
13
pkgs/linux-headers/linux-headers.fix
Normal file
@ -0,0 +1,13 @@
|
||||
Package(
|
||||
[ ("name", "linux-headers-2.4.22-i386")
|
||||
|
||||
, ("build", Relative("linux-headers/linux-headers-build.sh"))
|
||||
|
||||
, ("src", Call(IncludeFix("fetchurl/fetchurl.fix"),
|
||||
[ ("url", "ftp://ftp.nl.kernel.org/pub/linux/kernel/v2.4/linux-2.4.22.tar.bz2")
|
||||
, ("md5", "75dc85149b06ac9432106b8941eb9f7b")
|
||||
]))
|
||||
|
||||
, ("stdenv", IncludeFix("stdenv-linux/stdenv-nativetools.fix"))
|
||||
]
|
||||
)
|
@ -3,7 +3,7 @@ export SHELL=@SHELL@
|
||||
|
||||
. @BASEENV@/setup
|
||||
|
||||
export NIX_CFLAGS="-isystem @GLIBC@/include $NIX_CFLAGS"
|
||||
export NIX_CFLAGS="-isystem @GLIBC@/include -isystem @LINUX@/include $NIX_CFLAGS"
|
||||
export NIX_LDFLAGS="-L@GLIBC@/lib -Wl,-dynamic-linker,@GLIBC@/lib/ld-linux.so.2,-rpath,@GLIBC@/lib $NIX_LDFLAGS -L@GCC@/lib -Wl,-rpath,@GCC@/lib"
|
||||
export NIX_CC=@CC@
|
||||
export NIX_CXX=@CXX@
|
||||
|
@ -23,6 +23,7 @@ echo "########## $p"
|
||||
|
||||
sed \
|
||||
-e s^@GLIBC\@^$glibc^g \
|
||||
-e s^@LINUX\@^$linux^g \
|
||||
-e s^@GCC\@^$gcc^g \
|
||||
-e s^@CC\@^$cc^g \
|
||||
-e s^@CXX\@^$cxx^g \
|
||||
|
@ -5,6 +5,7 @@ Package(
|
||||
, ("setup", Relative("stdenv-linux/setup.sh"))
|
||||
, ("baseenv", IncludeFix("baseenv/baseenv.fix"))
|
||||
, ("glibc", IncludeFix("glibc/glibc.fix"))
|
||||
, ("linux", IncludeFix("linux-headers/linux-headers.fix"))
|
||||
|
||||
, ("tools",
|
||||
[ IncludeFix("coreutils/coreutils.fix")
|
||||
@ -21,7 +22,7 @@ Package(
|
||||
, IncludeFix("bash/bash.fix")
|
||||
])
|
||||
|
||||
, ("gcc", IncludeFix("gcc/gcc.fix"))
|
||||
, ("shell", IncludeFix("bash/bash.fix"))
|
||||
, ("gcc", IncludeFix("gcc/gcc.fix"))
|
||||
, ("shell", IncludeFix("bash/bash.fix"))
|
||||
]
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user