1 { lib, targetPlatform }:
4 p = targetPlatform.gcc or {}
5 // targetPlatform.parsed.abi;
7 (lib.optional (!targetPlatform.isx86_64 && p ? arch) "--with-arch=${p.arch}") # --with-arch= is unknown flag on x86_64
8 (lib.optional (p ? cpu) "--with-cpu=${p.cpu}")
9 (lib.optional (p ? abi) "--with-abi=${p.abi}")
10 (lib.optional (p ? fpu) "--with-fpu=${p.fpu}")
11 (lib.optional (p ? float) "--with-float=${p.float}")
12 (lib.optional (p ? mode) "--with-mode=${p.mode}")
14 (let tp = targetPlatform; in tp.isPower && tp.libc == "glibc" && tp.is64bit)
15 "--with-long-double-128")