about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-03-14 14:05:08 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-03-14 14:05:08 +0000
commit9b1d5353a951a29e33a3a137cb3d5246c1eff6a7 (patch)
treedb576e6ad257f79f40ba319f8920f11e6f41d838 /pkgs/development
parent71bf44450421940f8eff188bfca3c0fffc576f66 (diff)
downloadnixlib-9b1d5353a951a29e33a3a137cb3d5246c1eff6a7.tar
nixlib-9b1d5353a951a29e33a3a137cb3d5246c1eff6a7.tar.gz
nixlib-9b1d5353a951a29e33a3a137cb3d5246c1eff6a7.tar.bz2
nixlib-9b1d5353a951a29e33a3a137cb3d5246c1eff6a7.tar.lz
nixlib-9b1d5353a951a29e33a3a137cb3d5246c1eff6a7.tar.xz
nixlib-9b1d5353a951a29e33a3a137cb3d5246c1eff6a7.tar.zst
nixlib-9b1d5353a951a29e33a3a137cb3d5246c1eff6a7.zip
Making the gcc cross-compiler a bit more flexible.
svn path=/nixpkgs/trunk/; revision=20614
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/gcc-4.4/default.nix18
1 files changed, 14 insertions, 4 deletions
diff --git a/pkgs/development/compilers/gcc-4.4/default.nix b/pkgs/development/compilers/gcc-4.4/default.nix
index 358e52124072..85a3aee4c894 100644
--- a/pkgs/development/compilers/gcc-4.4/default.nix
+++ b/pkgs/development/compilers/gcc-4.4/default.nix
@@ -57,24 +57,34 @@ let version = "4.4.3";
 
     javaAwtGtk = langJava && gtk != null;
 
-    withCPU = if cross ? cpu then " --with-cpu=${cross.cpu}" else "";
+    /* Cross-gcc settings */
+    gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
+    gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
+    gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
+    withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+    withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+    withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
 
     crossConfigureFlags =
       "--target=${cross.config}" +
-      withCPU +
+      withArch +
+      withCpu +
+      withAbi +
       (if crossStageStatic then
         " --disable-libssp --disable-nls" +
         " --without-headers" +
         " --disable-threads " +
         " --disable-libmudflap " +
         " --disable-libgomp " +
-        " --disable-shared"
+        " --disable-shared" +
+        " --disable-decimal-float" # libdecnumber requires libc
         else
         " --with-headers=${libcCross}/include" +
         " --enable-__cxa_atexit" +
         " --enable-long-long" +
         " --enable-threads=posix" +
-        " --enable-nls"
+        " --enable-nls" +
+        " --disable-decimal-float" # No final libdecnumber (it may work only in 386)
         );
     stageNameAddon = if (crossStageStatic) then "-stage-static" else
       "-stage-final";