* GCC 4.0.4.
svn path=/nixpkgs/trunk/; revision=9062
This commit is contained in:
parent
b2bff981f3
commit
61656532dd
@ -13,69 +13,53 @@ export CXXCPP="gcc -E"
|
|||||||
|
|
||||||
if test "$noSysDirs" = "1"; then
|
if test "$noSysDirs" = "1"; then
|
||||||
|
|
||||||
if test "$noSysDirs" = "1"; then
|
if test -e $NIX_GCC/nix-support/orig-libc; then
|
||||||
|
|
||||||
# Figure out what extra flags to pass to the gcc compilers
|
# Figure out what extra flags to pass to the gcc compilers
|
||||||
# being generated to make sure that they use our glibc.
|
# being generated to make sure that they use our glibc.
|
||||||
if test -e $NIX_GCC/nix-support/orig-glibc; then
|
extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
|
||||||
glibc=$(cat $NIX_GCC/nix-support/orig-glibc)
|
extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
|
||||||
|
|
||||||
# Ugh. Copied from gcc-wrapper/builder.sh. We can't just
|
# Use *real* header files, otherwise a limits.h is generated
|
||||||
# source in $NIX_GCC/nix-support/add-flags, since that
|
# that does not include Glibc's limits.h (notably missing
|
||||||
# would cause *this* GCC to be linked against the
|
# SSIZE_MAX, which breaks the build).
|
||||||
# *previous* GCC. Need some more modularity there.
|
export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
|
||||||
extraCFlags="-B$glibc/lib -isystem $glibc/include"
|
|
||||||
extraLDFlags="-B$glibc/lib -L$glibc/lib -Wl,-s \
|
else
|
||||||
-Wl,-dynamic-linker,$glibc/lib/ld-linux.so.2"
|
# Hack: support impure environments.
|
||||||
|
extraCFlags="-isystem /usr/include"
|
||||||
# Oh, what a hack. I should be shot for this.
|
extraLDFlags="-L/usr/lib64 -L/usr/lib"
|
||||||
# In stage 1, we should link against the previous GCC, but
|
export NIX_FIXINC_DUMMY=/usr/include
|
||||||
# not afterwards. Otherwise we retain a dependency.
|
|
||||||
# However, ld-wrapper, which adds the linker flags for the
|
|
||||||
# previous GCC, is also used in stage 2/3. We can prevent
|
|
||||||
# it from adding them by NIX_GLIBC_FLAGS_SET, but then
|
|
||||||
# gcc-wrapper will also not add them, thereby causing
|
|
||||||
# stage 1 to fail. So we use a trick to only set the
|
|
||||||
# flags in gcc-wrapper.
|
|
||||||
hook=$(pwd)/ld-wrapper-hook
|
|
||||||
echo "NIX_GLIBC_FLAGS_SET=1" > $hook
|
|
||||||
export NIX_LD_WRAPPER_START_HOOK=$hook
|
|
||||||
|
|
||||||
# Use *real* header files, otherwise a limits.h is
|
|
||||||
# generated that does not include Glibc's limits.h
|
|
||||||
# (notably missing SSIZE_MAX, which breaks the build).
|
|
||||||
export NIX_FIXINC_DUMMY=$glibc/include
|
|
||||||
fi
|
|
||||||
|
|
||||||
export NIX_EXTRA_CFLAGS=$extraCFlags
|
|
||||||
export NIX_EXTRA_LDFLAGS=$extraLDFlags
|
|
||||||
export CFLAGS=$extraCFlags
|
|
||||||
export CXXFLAGS=$extraCFlags
|
|
||||||
export LDFLAGS=$extraLDFlags
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
extraCFlags="-g0 $extraCFlags"
|
||||||
patches=""
|
extraLDFlags="--strip-debug $extraLDFlags"
|
||||||
|
|
||||||
|
export NIX_EXTRA_CFLAGS=$extraCFlags
|
||||||
|
for i in $extraLDFlags; do
|
||||||
|
export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
|
||||||
|
done
|
||||||
|
|
||||||
|
export CFLAGS=$extraCFlags
|
||||||
|
export CXXFLAGS=$extraCFlags
|
||||||
|
|
||||||
|
makeFlagsArray=( \
|
||||||
|
NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||||
|
SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||||
|
LIMITS_H_TEST=true \
|
||||||
|
X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||||
|
LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||||
|
LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
preConfigure=preConfigure
|
preConfigure=preConfigure
|
||||||
preConfigure() {
|
preConfigure() {
|
||||||
|
|
||||||
# Determine the frontends to build.
|
|
||||||
langs="c"
|
|
||||||
if test -n "$langCC"; then
|
|
||||||
langs="$langs,c++"
|
|
||||||
fi
|
|
||||||
if test -n "$langF77"; then
|
|
||||||
langs="$langs,f77"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Perform the build in a different directory.
|
# Perform the build in a different directory.
|
||||||
mkdir ../build
|
mkdir ../build
|
||||||
cd ../build
|
cd ../build
|
||||||
|
|
||||||
configureScript=../$sourceRoot/configure
|
configureScript=../$sourceRoot/configure
|
||||||
configureFlags="--enable-languages=$langs"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -88,6 +72,9 @@ postInstall() {
|
|||||||
# Remove `fixincl' to prevent a retained dependency on the
|
# Remove `fixincl' to prevent a retained dependency on the
|
||||||
# previous gcc.
|
# previous gcc.
|
||||||
rm -rf $out/libexec/gcc/*/*/install-tools
|
rm -rf $out/libexec/gcc/*/*/install-tools
|
||||||
|
|
||||||
|
# Get rid of some "fixed" header files
|
||||||
|
rm -rf $out/lib/gcc/*/*/include/root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,17 +5,37 @@
|
|||||||
|
|
||||||
assert langC;
|
assert langC;
|
||||||
|
|
||||||
|
with import ../../../lib;
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "gcc-4.0.3";
|
name = "gcc-4.0.4";
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://nix.cs.uu.nl/dist/tarballs/gcc-4.0.3.tar.bz2;
|
url = ftp://ftp.nluug.nl/mirror/languages/gcc/releases/gcc-4.0.4/gcc-4.0.4.tar.bz2;
|
||||||
md5 = "6ff1af12c53cbb3f79b27f2d6a9a3d50";
|
sha256 = "0izwr8d69ld3a1yr8z94s7y7k861wi613mplys2c0bvdr58y1zgk";
|
||||||
};
|
};
|
||||||
# !!! apply only if noSysDirs is set
|
|
||||||
patches = [./no-sys-dirs.patch];
|
patches =
|
||||||
|
optional noSysDirs [./no-sys-dirs.patch];
|
||||||
|
|
||||||
inherit noSysDirs langC langCC langF77 profiledCompiler;
|
inherit noSysDirs langC langCC langF77 profiledCompiler;
|
||||||
|
|
||||||
|
configureFlags = "
|
||||||
|
--disable-multilib
|
||||||
|
--disable-libstdcxx-pch
|
||||||
|
--disable-libmudflap
|
||||||
|
--with-system-zlib
|
||||||
|
--enable-languages=${
|
||||||
|
concatStrings (intersperse ","
|
||||||
|
( optional langC "c"
|
||||||
|
++ optional langCC "c++"
|
||||||
|
++ optional langF77 "f77"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
${if stdenv.isi686 then "--with-arch=i686" else ""}
|
||||||
|
";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "http://gcc.gnu.org/";
|
homepage = "http://gcc.gnu.org/";
|
||||||
license = "GPL/LGPL";
|
license = "GPL/LGPL";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user