gcc: Factor out "platform flags"
This commit is contained in:
parent
a02be2bd85
commit
c9f6a82b61
@ -64,22 +64,6 @@ let version = "4.5.4";
|
|||||||
|
|
||||||
javaAwtGtk = langJava && gtk2 != null;
|
javaAwtGtk = langJava && gtk2 != null;
|
||||||
|
|
||||||
/* Platform flags */
|
|
||||||
platformFlags = let
|
|
||||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
|
||||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
|
||||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
|
||||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
|
||||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
|
||||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
|
||||||
in
|
|
||||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
|
||||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
|
||||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
|
||||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
|
||||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
|
||||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
|
||||||
|
|
||||||
/* Cross-gcc settings */
|
/* Cross-gcc settings */
|
||||||
crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt");
|
crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt");
|
||||||
|
|
||||||
@ -312,7 +296,7 @@ stdenv.mkDerivation ({
|
|||||||
# Ada
|
# Ada
|
||||||
optional langAda "--enable-libada" ++
|
optional langAda "--enable-libada" ++
|
||||||
|
|
||||||
platformFlags ++
|
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||||
|
|
||||||
# Platform-specific flags
|
# Platform-specific flags
|
||||||
|
@ -108,22 +108,6 @@ let version = "4.8.5";
|
|||||||
|
|
||||||
javaAwtGtk = langJava && x11Support;
|
javaAwtGtk = langJava && x11Support;
|
||||||
|
|
||||||
/* Platform flags */
|
|
||||||
platformFlags = let
|
|
||||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
|
||||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
|
||||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
|
||||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
|
||||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
|
||||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
|
||||||
in
|
|
||||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
|
||||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
|
||||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
|
||||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
|
||||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
|
||||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
|
||||||
|
|
||||||
/* Cross-gcc settings (build == host != target) */
|
/* Cross-gcc settings (build == host != target) */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
@ -372,7 +356,7 @@ stdenv.mkDerivation ({
|
|||||||
# Ada
|
# Ada
|
||||||
optional langAda "--enable-libada" ++
|
optional langAda "--enable-libada" ++
|
||||||
|
|
||||||
platformFlags ++
|
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||||
optional (!bootstrap) "--disable-bootstrap" ++
|
optional (!bootstrap) "--disable-bootstrap" ++
|
||||||
|
|
||||||
|
@ -99,22 +99,6 @@ let version = "4.9.4";
|
|||||||
|
|
||||||
javaAwtGtk = langJava && x11Support;
|
javaAwtGtk = langJava && x11Support;
|
||||||
|
|
||||||
/* Platform flags */
|
|
||||||
platformFlags = let
|
|
||||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
|
||||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
|
||||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
|
||||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
|
||||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
|
||||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
|
||||||
in
|
|
||||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
|
||||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
|
||||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
|
||||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
|
||||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
|
||||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
|
||||||
|
|
||||||
/* Cross-gcc settings (build == host != target) */
|
/* Cross-gcc settings (build == host != target) */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
@ -380,7 +364,7 @@ stdenv.mkDerivation ({
|
|||||||
# Ada
|
# Ada
|
||||||
optional langAda "--enable-libada" ++
|
optional langAda "--enable-libada" ++
|
||||||
|
|
||||||
platformFlags ++
|
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||||
optional (!bootstrap) "--disable-bootstrap" ++
|
optional (!bootstrap) "--disable-bootstrap" ++
|
||||||
|
|
||||||
|
@ -103,22 +103,6 @@ let version = "5.5.0";
|
|||||||
|
|
||||||
javaAwtGtk = langJava && x11Support;
|
javaAwtGtk = langJava && x11Support;
|
||||||
|
|
||||||
/* Platform flags */
|
|
||||||
platformFlags = let
|
|
||||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
|
||||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
|
||||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
|
||||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
|
||||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
|
||||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
|
||||||
in
|
|
||||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
|
||||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
|
||||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
|
||||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
|
||||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
|
||||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
|
||||||
|
|
||||||
/* Cross-gcc settings (build == host != target) */
|
/* Cross-gcc settings (build == host != target) */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
@ -396,7 +380,7 @@ stdenv.mkDerivation ({
|
|||||||
# Ada
|
# Ada
|
||||||
optional langAda "--enable-libada" ++
|
optional langAda "--enable-libada" ++
|
||||||
|
|
||||||
platformFlags ++
|
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||||
optional (!bootstrap) "--disable-bootstrap" ++
|
optional (!bootstrap) "--disable-bootstrap" ++
|
||||||
|
|
||||||
|
@ -97,22 +97,6 @@ let version = "6.4.0";
|
|||||||
|
|
||||||
javaAwtGtk = langJava && x11Support;
|
javaAwtGtk = langJava && x11Support;
|
||||||
|
|
||||||
/* Platform flags */
|
|
||||||
platformFlags = let
|
|
||||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
|
||||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
|
||||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
|
||||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
|
||||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
|
||||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
|
||||||
in
|
|
||||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
|
||||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
|
||||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
|
||||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
|
||||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
|
||||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
|
||||||
|
|
||||||
/* Cross-gcc settings (build == host != target) */
|
/* Cross-gcc settings (build == host != target) */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
@ -400,7 +384,7 @@ stdenv.mkDerivation ({
|
|||||||
# Ada
|
# Ada
|
||||||
optional langAda "--enable-libada" ++
|
optional langAda "--enable-libada" ++
|
||||||
|
|
||||||
platformFlags ++
|
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||||
optional (!bootstrap) "--disable-bootstrap" ++
|
optional (!bootstrap) "--disable-bootstrap" ++
|
||||||
|
|
||||||
|
@ -98,22 +98,6 @@ let version = "7.3.0";
|
|||||||
|
|
||||||
javaAwtGtk = langJava && x11Support;
|
javaAwtGtk = langJava && x11Support;
|
||||||
|
|
||||||
/* Platform flags */
|
|
||||||
platformFlags = let
|
|
||||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
|
||||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
|
||||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
|
||||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
|
||||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
|
||||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
|
||||||
in
|
|
||||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
|
||||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
|
||||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
|
||||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
|
||||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
|
||||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
|
||||||
|
|
||||||
/* Cross-gcc settings (build == host != target) */
|
/* Cross-gcc settings (build == host != target) */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
@ -396,7 +380,7 @@ stdenv.mkDerivation ({
|
|||||||
# Ada
|
# Ada
|
||||||
optional langAda "--enable-libada" ++
|
optional langAda "--enable-libada" ++
|
||||||
|
|
||||||
platformFlags ++
|
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||||
optional (!bootstrap) "--disable-bootstrap" ++
|
optional (!bootstrap) "--disable-bootstrap" ++
|
||||||
|
|
||||||
|
12
pkgs/development/compilers/gcc/common/platform-flags.nix
Normal file
12
pkgs/development/compilers/gcc/common/platform-flags.nix
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{ lib, targetPlatform }:
|
||||||
|
|
||||||
|
let
|
||||||
|
p = targetPlatform.platform.gcc or {};
|
||||||
|
in lib.concatLists [
|
||||||
|
(lib.optional (p ? arch) "--with-arch=${p.arch}")
|
||||||
|
(lib.optional (p ? cpu) "--with-cpu=${p.cpu}")
|
||||||
|
(lib.optional (p ? abi) "--with-abi=${p.abi}")
|
||||||
|
(lib.optional (p ? fpu) "--with-fpu=${p.fpu}")
|
||||||
|
(lib.optional (p ? float) "--with-float=${p.float}")
|
||||||
|
(lib.optional (p ? mode) "--with-mode=${p.mode}")
|
||||||
|
]
|
@ -95,22 +95,6 @@ let version = "7-20170409";
|
|||||||
|
|
||||||
javaAwtGtk = langJava && x11Support;
|
javaAwtGtk = langJava && x11Support;
|
||||||
|
|
||||||
/* Platform flags */
|
|
||||||
platformFlags = let
|
|
||||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
|
||||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
|
||||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
|
||||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
|
||||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
|
||||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
|
||||||
in
|
|
||||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
|
||||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
|
||||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
|
||||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
|
||||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
|
||||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
|
||||||
|
|
||||||
/* Cross-gcc settings (build == host != target) */
|
/* Cross-gcc settings (build == host != target) */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
@ -368,7 +352,7 @@ stdenv.mkDerivation ({
|
|||||||
# Ada
|
# Ada
|
||||||
optional langAda "--enable-libada" ++
|
optional langAda "--enable-libada" ++
|
||||||
|
|
||||||
platformFlags ++
|
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||||
optional (!bootstrap) "--disable-bootstrap" ++
|
optional (!bootstrap) "--disable-bootstrap" ++
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user