forked from mirrors/nixpkgs
make our cross compiler a lot more generic.
svn path=/nixpkgs/trunk/; revision=4464
This commit is contained in:
parent
51e246c532
commit
2f3dfaa5b9
|
@ -1,25 +0,0 @@
|
|||
{ stdenv, fetchurl, noSysDirs
|
||||
, langC ? true, langCC ? true, langF77 ? false
|
||||
, profiledCompiler ? false
|
||||
, binutilsArm
|
||||
, kernelHeadersArm
|
||||
}:
|
||||
|
||||
assert langC;
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "gcc-4.0.2-arm";
|
||||
builder = ./builder.sh;
|
||||
src = fetchurl {
|
||||
url = ftp://ftp.nluug.nl/pub/gnu/gcc/gcc-4.0.2/gcc-core-4.0.2.tar.bz2;
|
||||
md5 = "f7781398ada62ba255486673e6274b26";
|
||||
#url = ftp://ftp.nluug.nl/pub/gnu/gcc/gcc-4.0.2/gcc-4.0.2.tar.bz2;
|
||||
#md5 = "a659b8388cac9db2b13e056e574ceeb0";
|
||||
};
|
||||
# !!! apply only if noSysDirs is set
|
||||
patches = [./no-sys-dirs.patch ./gcc-inhibit.patch];
|
||||
inherit noSysDirs langC langCC langF77 profiledCompiler;
|
||||
buildInputs = [binutilsArm];
|
||||
inherit kernelHeadersArm binutilsArm;
|
||||
platform = "arm-linux";
|
||||
}
|
|
@ -60,19 +60,19 @@ preConfigure() {
|
|||
|
||||
# Cross compiler evilness
|
||||
ensureDir $out
|
||||
ensureDir $out/arm-linux
|
||||
ensureDir $out/arm-linux/bin
|
||||
ln -s $binutilsArm/arm-linux/bin/as $out/arm-linux/bin/as
|
||||
ln -s $binutilsArm/arm-linux/bin/ld $out/arm-linux/bin/ld
|
||||
ln -s $binutilsArm/arm-linux/bin/ar $out/arm-linux/bin/ar
|
||||
ln -s $binutilsArm/arm-linux/bin/ranlib $out/arm-linux/bin/ranlib
|
||||
ensureDir $out/$platform
|
||||
ensureDir $out/$platform/bin
|
||||
ln -s $binutilsCross/$platform/bin/as $out/$platform/bin/as
|
||||
ln -s $binutilsCross/$platform/bin/ld $out/$platform/bin/ld
|
||||
ln -s $binutilsCross/$platform/ar $out/$platform/bin/ar
|
||||
ln -s $binutilsCross/$platform/bin/ranlib $out/$platform/bin/ranlib
|
||||
|
||||
# Perform the build in a different directory.
|
||||
mkdir ../build
|
||||
cd ../build
|
||||
|
||||
configureScript=../$sourceRoot/configure
|
||||
configureFlags="--enable-languages=$langs --target=$platform --disable-threads --disable-libmudflap --disable-shared --with-headers=$kernelHeadersArm/include --disable-multilib"
|
||||
configureFlags="--enable-languages=$langs --target=$platform --disable-threads --disable-libmudflap --disable-shared --with-headers=$kernelHeadersCross/include --disable-multilib"
|
||||
}
|
||||
|
||||
|
29
pkgs/development/compilers/gcc-4.0-cross/default.nix
Normal file
29
pkgs/development/compilers/gcc-4.0-cross/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ stdenv, fetchurl, noSysDirs
|
||||
, langC ? true, langCC ? true, langF77 ? false
|
||||
, profiledCompiler ? false
|
||||
, binutilsCross
|
||||
, kernelHeadersCross
|
||||
, cross
|
||||
}:
|
||||
|
||||
assert langC;
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "gcc-4.0.2";
|
||||
builder = ./builder.sh;
|
||||
src = fetchurl {
|
||||
#url = ftp://ftp.nluug.nl/pub/gnu/gcc/gcc-4.0.2/gcc-core-4.0.2.tar.bz2;
|
||||
url = ftp://ftp.gnu.org/gnu/gcc/gcc-4.0.2/gcc-core-4.0.2.tar.bz2;
|
||||
md5 = "f7781398ada62ba255486673e6274b26";
|
||||
#url = ftp://ftp.nluug.nl/pub/gnu/gcc/gcc-4.0.2/gcc-4.0.2.tar.bz2;
|
||||
#md5 = "a659b8388cac9db2b13e056e574ceeb0";
|
||||
};
|
||||
# !!! apply only if noSysDirs is set
|
||||
patches = [./no-sys-dirs.patch] ++ (if cross == "arm-linux" then [./gcc-inhibit.patch] else []);
|
||||
#patches = [./no-sys-dirs.patch ./gcc-inhibit.patch];
|
||||
#patches = [./no-sys-dirs.patch];
|
||||
inherit noSysDirs langC langCC langF77 profiledCompiler;
|
||||
buildInputs = [binutilsCross];
|
||||
inherit kernelHeadersCross binutilsCross;
|
||||
platform = cross;
|
||||
}
|
Loading…
Reference in a new issue