summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/gcc-wrapper/builder.sh24
-rw-r--r--pkgs/build-support/gcc-wrapper/default.nix7
-rw-r--r--pkgs/build-support/gcc-wrapper/setup-hook.sh4
-rw-r--r--pkgs/build-support/kernel/make-initrd.nix9
-rw-r--r--pkgs/build-support/kernel/make-initrd.sh5
-rw-r--r--pkgs/build-support/kernel/modules-closure.sh2
6 files changed, 37 insertions, 14 deletions
diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh
index 0fe3f3768f2a..cf4d6dfed963 100644
--- a/pkgs/build-support/gcc-wrapper/builder.sh
+++ b/pkgs/build-support/gcc-wrapper/builder.sh
@@ -83,7 +83,7 @@ mkGccWrapper() {
 
     if ! test -f "$src"; then
         echo "$src does not exist (skipping)"
-        return
+        return 1
     fi
 
     gccProg="$src"
@@ -91,18 +91,24 @@ mkGccWrapper() {
     chmod +x "$dst"
 }
 
-mkGccWrapper $out/bin/gcc $gccPath/gcc
-ln -s gcc $out/bin/cc
+if mkGccWrapper $out/bin/gcc $gccPath/gcc
+then
+    ln -sv gcc $out/bin/cc
+fi
 
-mkGccWrapper $out/bin/g++ $gccPath/g++
-ln -s g++ $out/bin/c++
+if mkGccWrapper $out/bin/g++ $gccPath/g++
+then
+    ln -sv g++ $out/bin/c++
+fi
 
-if test -e $gccPath/gfortran; then
-    mkGccWrapper $out/bin/gfortran $gccPath/gfortran
-    ln -s gfortran $out/bin/g77
-    ln -s gfortran $out/bin/f77
+if mkGccWrapper $out/bin/gfortran $gccPath/gfortran
+then
+    ln -sv gfortran $out/bin/g77
+    ln -sv gfortran $out/bin/f77
 fi
 
+mkGccWrapper $out/bin/gcj $gccPath/gcj || true
+
 
 # Create a symlink to as (the assembler).  This is useful when a
 # gcc-wrapper is installed in a user environment, as it ensures that
diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix
index d517a472d747..339aba74288e 100644
--- a/pkgs/build-support/gcc-wrapper/default.nix
+++ b/pkgs/build-support/gcc-wrapper/default.nix
@@ -6,11 +6,11 @@
 # variables so that the compiler and the linker just "work".
 
 { name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
-, gcc ? null, libc ? null, binutils ? null, shell ? ""
+, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
 }:
 
 assert nativeTools -> nativePrefix != "";
-assert !nativeTools -> gcc != null && binutils != null;
+assert !nativeTools -> gcc != null && binutils != null && coreutils != null;
 assert !nativeLibc -> libc != null;
 
 let
@@ -35,6 +35,8 @@ stdenv.mkDerivation {
   inherit nativeTools nativeLibc nativePrefix gcc;
   libc = if nativeLibc then null else libc;
   binutils = if nativeTools then null else binutils;
+  # The wrapper scripts use 'cat', so we may need coreutils
+  coreutils = if nativeTools then null else coreutils;
   
   langC = if nativeTools then true else gcc.langC;
   langCC = if nativeTools then true else gcc.langCC;
@@ -54,6 +56,7 @@ stdenv.mkDerivation {
     if !nativeLibc then
       (if stdenv.system == "i686-linux" then "ld-linux.so.2" else
        if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
+       if stdenv.system == "armv5tel-linux" then "ld-linux.so.3" else
        if stdenv.system == "powerpc-linux" then "ld.so.1" else
        abort "don't know the name of the dynamic linker for this platform")
     else "";
diff --git a/pkgs/build-support/gcc-wrapper/setup-hook.sh b/pkgs/build-support/gcc-wrapper/setup-hook.sh
index 76167df3c31c..513ab8053a7e 100644
--- a/pkgs/build-support/gcc-wrapper/setup-hook.sh
+++ b/pkgs/build-support/gcc-wrapper/setup-hook.sh
@@ -27,3 +27,7 @@ fi
 if test -n "@libc@"; then
     addToSearchPath PATH @libc@/bin
 fi
+
+if test -n "@coreutils@"; then
+    addToSearchPath PATH @coreutils@/bin
+fi
diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix
index b62ed9840456..92142b5ef43e 100644
--- a/pkgs/build-support/kernel/make-initrd.nix
+++ b/pkgs/build-support/kernel/make-initrd.nix
@@ -12,12 +12,17 @@
 # `contents = {object = ...; symlink = /init;}' is a typical
 # argument.
 
-{stdenv, perl, cpio, contents}:
+{stdenv, perl, cpio, contents, uboot ? null}:
+
+assert stdenv.system == "armv5tel-linux" -> uboot != null;
 
 stdenv.mkDerivation {
   name = "initrd";
   builder = ./make-initrd.sh;
-  buildInputs = [perl cpio];
+  buildInputs = [perl cpio]
+    ++ stdenv.lib.optional (stdenv.system == "armv5tel-linux") [ uboot ];
+
+  makeUInitrd = if (stdenv.system == "armv5tel-linux") then true else false;
 
   # !!! should use XML.
   objects = map (x: x.object) contents;
diff --git a/pkgs/build-support/kernel/make-initrd.sh b/pkgs/build-support/kernel/make-initrd.sh
index d930e51a03f9..69931bad113c 100644
--- a/pkgs/build-support/kernel/make-initrd.sh
+++ b/pkgs/build-support/kernel/make-initrd.sh
@@ -37,3 +37,8 @@ storePaths=$(perl $pathsFromGraph closure-*)
 # Put the closure in a gzipped cpio archive.
 ensureDir $out
 (cd root && find * -print0 | cpio -ov -H newc --null | gzip -9 > $out/initrd)
+
+if [ -n "$makeUInitrd" ]; then
+    mv $out/initrd $out/initrd.gz
+    mkimage -A arm -O linux -T ramdisk -C gzip -d $out/initrd.gz $out/initrd
+fi
diff --git a/pkgs/build-support/kernel/modules-closure.sh b/pkgs/build-support/kernel/modules-closure.sh
index e75ef927baae..af1faa7708ce 100644
--- a/pkgs/build-support/kernel/modules-closure.sh
+++ b/pkgs/build-support/kernel/modules-closure.sh
@@ -22,7 +22,7 @@ for module in $rootModules; do
 done
 
 echo "closure:"
-ensureDir $out
+ensureDir $out/lib/modules/"$version"
 for module in $closure; do
     target=$(echo $module | sed "s^/nix/store/.*/lib/modules/^$out/lib/modules/^")
     if test -e "$target"; then continue; fi