diff options
author | Lluís Batlle i Rossell <viric@viric.name> | 2012-12-24 16:37:54 +0100 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@viric.name> | 2012-12-26 22:01:51 +0000 |
commit | 96b0de4c33fe53916e147ce15b04ee5a316b7b61 (patch) | |
tree | b7f393e35507f7d8be4cb44fe00749fb63bf3e4b /pkgs/development/compilers | |
parent | 5258c8a0c641bf18faf3ae2e3618153f7cf4850a (diff) | |
download | nixlib-96b0de4c33fe53916e147ce15b04ee5a316b7b61.tar nixlib-96b0de4c33fe53916e147ce15b04ee5a316b7b61.tar.gz nixlib-96b0de4c33fe53916e147ce15b04ee5a316b7b61.tar.bz2 nixlib-96b0de4c33fe53916e147ce15b04ee5a316b7b61.tar.lz nixlib-96b0de4c33fe53916e147ce15b04ee5a316b7b61.tar.xz nixlib-96b0de4c33fe53916e147ce15b04ee5a316b7b61.tar.zst nixlib-96b0de4c33fe53916e147ce15b04ee5a316b7b61.zip |
gcc4.7: making the cross-built gcc respect withAbi, withArch, ...
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/gcc/4.7/default.nix | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/pkgs/development/compilers/gcc/4.7/default.nix b/pkgs/development/compilers/gcc/4.7/default.nix index 0d24f19e3c30..9eb8f10115ca 100644 --- a/pkgs/development/compilers/gcc/4.7/default.nix +++ b/pkgs/development/compilers/gcc/4.7/default.nix @@ -308,7 +308,16 @@ stdenv.mkDerivation ({ then "install-strip" else "install"; - crossAttrs = { + crossAttrs = let + xgccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null stdenv.cross; + xgccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null stdenv.cross; + xgccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null stdenv.cross; + xgccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null stdenv.cross; + xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else ""; + xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else ""; + xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else ""; + xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; + in { AR = "${stdenv.cross.config}-ar"; LD = "${stdenv.cross.config}-ld"; CC = "${stdenv.cross.config}-gcc"; @@ -347,9 +356,11 @@ stdenv.mkDerivation ({ ) } ${if langAda then " --enable-libada" else ""} - ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""} - ${if cross != null then crossConfigureFlags else ""} --target=${stdenv.cross.config} + ${xwithArch} + ${xwithCpu} + ${xwithAbi} + ${xwithFpu} ''; }; |