gcc: Use platformFlags in crossConfigureFlags
A nice code deduplication
This commit is contained in:
parent
1fe9798ac2
commit
a3e35fbbe1
|
@ -85,20 +85,9 @@ let version = "4.5.4";
|
||||||
withFloat +
|
withFloat +
|
||||||
withMode;
|
withMode;
|
||||||
|
|
||||||
/* Cross-gcc settings */
|
|
||||||
gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null targetPlatform;
|
|
||||||
gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null targetPlatformt;
|
|
||||||
gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null targetPlatform;
|
|
||||||
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 "";
|
|
||||||
crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt");
|
|
||||||
|
|
||||||
crossConfigureFlags =
|
crossConfigureFlags =
|
||||||
"--target=${targetPlatform.config}" +
|
"--target=${targetPlatform.config}" +
|
||||||
withArch +
|
platformFlags +
|
||||||
withCpu +
|
|
||||||
withAbi +
|
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
||||||
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
||||||
|
|
|
@ -121,27 +121,9 @@ let version = "4.8.5";
|
||||||
/* Cross-gcc settings */
|
/* Cross-gcc settings */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
crossConfigureFlags = let
|
crossConfigureFlags =
|
||||||
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;
|
|
||||||
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 "";
|
|
||||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
|
||||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
|
||||||
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
|
||||||
in
|
|
||||||
"--target=${targetPlatform.config}" +
|
"--target=${targetPlatform.config}" +
|
||||||
withArch +
|
platformFlags +
|
||||||
withCpu +
|
|
||||||
withAbi +
|
|
||||||
withFpu +
|
|
||||||
withFloat +
|
|
||||||
withMode +
|
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
||||||
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
||||||
|
|
|
@ -123,27 +123,9 @@ let version = "4.9.4";
|
||||||
/* Cross-gcc settings */
|
/* Cross-gcc settings */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
crossConfigureFlags = let
|
crossConfigureFlags =
|
||||||
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;
|
|
||||||
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 "";
|
|
||||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
|
||||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
|
||||||
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
|
||||||
in
|
|
||||||
"--target=${targetPlatform.config}" +
|
"--target=${targetPlatform.config}" +
|
||||||
withArch +
|
platformFlags +
|
||||||
withCpu +
|
|
||||||
withAbi +
|
|
||||||
withFpu +
|
|
||||||
withFloat +
|
|
||||||
withMode +
|
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
||||||
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
||||||
|
|
|
@ -127,27 +127,9 @@ let version = "5.4.0";
|
||||||
/* Cross-gcc settings */
|
/* Cross-gcc settings */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
crossConfigureFlags = let
|
crossConfigureFlags =
|
||||||
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;
|
|
||||||
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 "";
|
|
||||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
|
||||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
|
||||||
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
|
||||||
in
|
|
||||||
"--target=${targetPlatform.config}" +
|
"--target=${targetPlatform.config}" +
|
||||||
withArch +
|
platformFlags +
|
||||||
withCpu +
|
|
||||||
withAbi +
|
|
||||||
withFpu +
|
|
||||||
withFloat +
|
|
||||||
withMode +
|
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
||||||
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
||||||
|
|
|
@ -123,27 +123,9 @@ let version = "6.3.0";
|
||||||
/* Cross-gcc settings */
|
/* Cross-gcc settings */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
crossConfigureFlags = let
|
crossConfigureFlags =
|
||||||
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;
|
|
||||||
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 "";
|
|
||||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
|
||||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
|
||||||
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
|
||||||
in
|
|
||||||
"--target=${targetPlatform.config}" +
|
"--target=${targetPlatform.config}" +
|
||||||
withArch +
|
platformFlags +
|
||||||
withCpu +
|
|
||||||
withAbi +
|
|
||||||
withFpu +
|
|
||||||
withFloat +
|
|
||||||
withMode +
|
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
||||||
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
||||||
|
|
|
@ -123,27 +123,9 @@ let version = "7.1.0";
|
||||||
/* Cross-gcc settings */
|
/* Cross-gcc settings */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
crossConfigureFlags = let
|
crossConfigureFlags =
|
||||||
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;
|
|
||||||
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 "";
|
|
||||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
|
||||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
|
||||||
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
|
||||||
in
|
|
||||||
"--target=${targetPlatform.config}" +
|
"--target=${targetPlatform.config}" +
|
||||||
withArch +
|
platformFlags +
|
||||||
withCpu +
|
|
||||||
withAbi +
|
|
||||||
withFpu +
|
|
||||||
withFloat +
|
|
||||||
withMode +
|
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
||||||
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
||||||
|
|
|
@ -123,27 +123,9 @@ let version = "7-20170409";
|
||||||
/* Cross-gcc settings */
|
/* Cross-gcc settings */
|
||||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||||
crossConfigureFlags = let
|
crossConfigureFlags =
|
||||||
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;
|
|
||||||
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 "";
|
|
||||||
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
|
|
||||||
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
|
|
||||||
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
|
|
||||||
in
|
|
||||||
"--target=${targetPlatform.config}" +
|
"--target=${targetPlatform.config}" +
|
||||||
withArch +
|
platformFlags +
|
||||||
withCpu +
|
|
||||||
withAbi +
|
|
||||||
withFpu +
|
|
||||||
withFloat +
|
|
||||||
withMode +
|
|
||||||
# Ensure that -print-prog-name is able to find the correct programs.
|
# Ensure that -print-prog-name is able to find the correct programs.
|
||||||
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
" --with-as=${binutils}/bin/${targetPlatform.config}-as" +
|
||||||
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
" --with-ld=${binutils}/bin/${targetPlatform.config}-ld" +
|
||||||
|
|
Loading…
Reference in New Issue