From 2f3dfaa5b9458942d7148a205e406f8f84228eeb Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Sat, 31 Dec 2005 14:09:44 +0000 Subject: [PATCH] make our cross compiler a lot more generic. svn path=/nixpkgs/trunk/; revision=4464 --- .../compilers/gcc-4.0-arm/default.nix | 25 ---------------- .../{gcc-4.0-arm => gcc-4.0-cross}/builder.sh | 14 ++++----- .../compilers/gcc-4.0-cross/default.nix | 29 +++++++++++++++++++ .../gcc-inhibit.patch | 0 .../no-sys-dirs.patch | 0 5 files changed, 36 insertions(+), 32 deletions(-) delete mode 100644 pkgs/development/compilers/gcc-4.0-arm/default.nix rename pkgs/development/compilers/{gcc-4.0-arm => gcc-4.0-cross}/builder.sh (88%) create mode 100644 pkgs/development/compilers/gcc-4.0-cross/default.nix rename pkgs/development/compilers/{gcc-4.0-arm => gcc-4.0-cross}/gcc-inhibit.patch (100%) rename pkgs/development/compilers/{gcc-4.0-arm => gcc-4.0-cross}/no-sys-dirs.patch (100%) diff --git a/pkgs/development/compilers/gcc-4.0-arm/default.nix b/pkgs/development/compilers/gcc-4.0-arm/default.nix deleted file mode 100644 index e6a6ec53d594..000000000000 --- a/pkgs/development/compilers/gcc-4.0-arm/default.nix +++ /dev/null @@ -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"; -} diff --git a/pkgs/development/compilers/gcc-4.0-arm/builder.sh b/pkgs/development/compilers/gcc-4.0-cross/builder.sh similarity index 88% rename from pkgs/development/compilers/gcc-4.0-arm/builder.sh rename to pkgs/development/compilers/gcc-4.0-cross/builder.sh index 922a29a59a0c..6fab6ab8c068 100644 --- a/pkgs/development/compilers/gcc-4.0-arm/builder.sh +++ b/pkgs/development/compilers/gcc-4.0-cross/builder.sh @@ -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" } diff --git a/pkgs/development/compilers/gcc-4.0-cross/default.nix b/pkgs/development/compilers/gcc-4.0-cross/default.nix new file mode 100644 index 000000000000..70931820e52f --- /dev/null +++ b/pkgs/development/compilers/gcc-4.0-cross/default.nix @@ -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; +} diff --git a/pkgs/development/compilers/gcc-4.0-arm/gcc-inhibit.patch b/pkgs/development/compilers/gcc-4.0-cross/gcc-inhibit.patch similarity index 100% rename from pkgs/development/compilers/gcc-4.0-arm/gcc-inhibit.patch rename to pkgs/development/compilers/gcc-4.0-cross/gcc-inhibit.patch diff --git a/pkgs/development/compilers/gcc-4.0-arm/no-sys-dirs.patch b/pkgs/development/compilers/gcc-4.0-cross/no-sys-dirs.patch similarity index 100% rename from pkgs/development/compilers/gcc-4.0-arm/no-sys-dirs.patch rename to pkgs/development/compilers/gcc-4.0-cross/no-sys-dirs.patch