summary refs log tree commit diff
path: root/pkgs/build-support/gcc-wrapper
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-08-10 13:33:58 +0000
committerLudovic Courtès <ludo@gnu.org>2009-08-10 13:33:58 +0000
commit09ab84a4311a17c8b1c14fd67276a6315f4aeaf9 (patch)
treeb26752495f715146ec03f8a1a52a154e785b08ca /pkgs/build-support/gcc-wrapper
parent92f8b3767f9255e0a7f44b3277c291597013226e (diff)
downloadnixpkgs-09ab84a4311a17c8b1c14fd67276a6315f4aeaf9.tar
nixpkgs-09ab84a4311a17c8b1c14fd67276a6315f4aeaf9.tar.gz
nixpkgs-09ab84a4311a17c8b1c14fd67276a6315f4aeaf9.tar.bz2
nixpkgs-09ab84a4311a17c8b1c14fd67276a6315f4aeaf9.tar.lz
nixpkgs-09ab84a4311a17c8b1c14fd67276a6315f4aeaf9.tar.xz
nixpkgs-09ab84a4311a17c8b1c14fd67276a6315f4aeaf9.tar.zst
nixpkgs-09ab84a4311a17c8b1c14fd67276a6315f4aeaf9.zip
GCC wrapper: Don't create dangling symlinks; create a `gcj' symlink.
svn path=/nixpkgs/trunk/; revision=16645
Diffstat (limited to 'pkgs/build-support/gcc-wrapper')
-rw-r--r--pkgs/build-support/gcc-wrapper/builder.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh
index 0fe3f3768f2..d079cc59a9b 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
+
 
 # Create a symlink to as (the assembler).  This is useful when a
 # gcc-wrapper is installed in a user environment, as it ensures that