* stdenv-nix-linux should more-or-less work again now.
svn path=/nixpkgs/trunk/; revision=826
This commit is contained in:
65
pkgs/development/compilers/gcc/builder.sh
Executable file
65
pkgs/development/compilers/gcc/builder.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#! /bin/sh -e
|
||||
|
||||
buildinputs="$binutils"
|
||||
. $stdenv/setup
|
||||
|
||||
tar xvfj $src
|
||||
|
||||
if test "$enforcePurity" = "1"; then
|
||||
# Disable the standard include directories.
|
||||
cd gcc-*
|
||||
cat >> ./gcc/cppdefault.h <<EOF
|
||||
#undef LOCAL_INCLUDE_DIR
|
||||
#undef SYSTEM_INCLUDE_DIR
|
||||
#undef STANDARD_INCLUDE_DIR
|
||||
EOF
|
||||
cd ..
|
||||
fi
|
||||
|
||||
langs="c"
|
||||
if test -n "$langCC"; then
|
||||
langs="$langs,c++"
|
||||
fi
|
||||
if test -n "$langF77"; then
|
||||
langs="$langs,f77"
|
||||
fi
|
||||
|
||||
# Configure.
|
||||
mkdir build
|
||||
cd build
|
||||
../gcc-*/configure --prefix=$out --enable-languages="$langs"
|
||||
|
||||
if test "$enforcePurity" = "1"; then
|
||||
# Patch some of the makefiles to force linking against our own glibc.
|
||||
. $NIX_GCC/nix-support/add-flags # add glibc/gcc flags
|
||||
extraflags="-Wl,-s $NIX_CFLAGS_COMPILE $NIX_CFLAGS_LINK"
|
||||
for i in $NIX_LDFLAGS; do
|
||||
extraflags="$extraflags -Wl,$i"
|
||||
done
|
||||
|
||||
mf=Makefile
|
||||
sed \
|
||||
-e "s^FLAGS_FOR_TARGET =\(.*\)^FLAGS_FOR_TARGET = \1 $extraflags^" \
|
||||
< $mf > $mf.tmp
|
||||
mv $mf.tmp $mf
|
||||
|
||||
mf=gcc/Makefile
|
||||
sed \
|
||||
-e "s^X_CFLAGS =\(.*\)^X_CFLAGS = \1 $extraflags^" \
|
||||
< $mf > $mf.tmp
|
||||
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
|
||||
mv $mf.tmp $mf
|
||||
fi
|
||||
|
||||
# Build and install.
|
||||
make bootstrap
|
||||
make install
|
||||
|
||||
find $out -name "*.a" -exec strip -S {} \;
|
||||
20
pkgs/development/compilers/gcc/default.nix
Normal file
20
pkgs/development/compilers/gcc/default.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ stdenv, fetchurl, enforcePurity ? true
|
||||
, langC ? true, langCC ? true, langF77 ? false
|
||||
}:
|
||||
|
||||
assert langC;
|
||||
|
||||
derivation {
|
||||
name = "gcc-3.3.2";
|
||||
system = stdenv.system;
|
||||
builder = ./builder.sh;
|
||||
src = fetchurl {
|
||||
url = ftp://ftp.nluug.nl/pub/gnu/gcc/gcc-3.3.2/gcc-3.3.2.tar.bz2;
|
||||
md5 = "65999f654102f5438ac8562d13a6eced";
|
||||
};
|
||||
# src = fetchurl {
|
||||
# url = ftp://ftp.nluug.nl/mirror/languages/gcc/releases/gcc-3.3.3/gcc-3.3.3.tar.bz2;
|
||||
# md5 = "3c6cfd9fcd180481063b4058cf6faff2";
|
||||
# };
|
||||
inherit stdenv enforcePurity langC langCC langF77;
|
||||
}
|
||||
Reference in New Issue
Block a user