boost: use standardized system information
This commit is contained in:
parent
4f6d61e5cf
commit
f45211bd6d
@ -1,8 +1,7 @@
|
|||||||
{ stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv
|
{ stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv
|
||||||
, which
|
, which
|
||||||
, buildPackages, buildPlatform, hostPlatform
|
, buildPackages, buildPlatform, hostPlatform
|
||||||
, toolset ? /**/ if stdenv.cc.isClang then "clang"
|
, toolset ? /**/ if stdenv.cc.isClang then "clang"
|
||||||
else if stdenv.cc.isGNU && hostPlatform != buildPlatform then "gcc-cross"
|
|
||||||
else null
|
else null
|
||||||
, enableRelease ? true
|
, enableRelease ? true
|
||||||
, enableDebug ? false
|
, enableDebug ? false
|
||||||
@ -58,16 +57,26 @@ let
|
|||||||
"link=${link}"
|
"link=${link}"
|
||||||
"-sEXPAT_INCLUDE=${expat.dev}/include"
|
"-sEXPAT_INCLUDE=${expat.dev}/include"
|
||||||
"-sEXPAT_LIBPATH=${expat.out}/lib"
|
"-sEXPAT_LIBPATH=${expat.out}/lib"
|
||||||
|
|
||||||
|
# TODO: make this unconditional
|
||||||
|
] ++ optionals (hostPlatform != buildPlatform) [
|
||||||
|
"address-model=${toString hostPlatform.parsed.cpu.bits}"
|
||||||
|
"architecture=${toString hostPlatform.parsed.cpu.family}"
|
||||||
|
"binary-format=${toString hostPlatform.parsed.kernel.execFormat.name}"
|
||||||
|
"target-os=${toString hostPlatform.parsed.kernel.name}"
|
||||||
|
|
||||||
|
# adapted from table in boost manual
|
||||||
|
# https://www.boost.org/doc/libs/1_66_0/libs/context/doc/html/context/architectures.html
|
||||||
|
"abi=${if hostPlatform.parsed.cpu.family == "arm" then "aapcs"
|
||||||
|
else if hostPlatform.isWindows then "ms"
|
||||||
|
else if hostPlatform.isMips then "o32"
|
||||||
|
else "sysv"}"
|
||||||
] ++ optional (link != "static") "runtime-link=${runtime-link}"
|
] ++ optional (link != "static") "runtime-link=${runtime-link}"
|
||||||
++ optional (variant == "release") "debug-symbols=off"
|
++ optional (variant == "release") "debug-symbols=off"
|
||||||
++ optional (toolset != null) "toolset=${toolset}"
|
++ optional (toolset != null) "toolset=${toolset}"
|
||||||
++ optional (mpi != null || hostPlatform != buildPlatform) "--user-config=user-config.jam"
|
++ optional (mpi != null || hostPlatform != buildPlatform) "--user-config=user-config.jam"
|
||||||
++ optionals (hostPlatform.libc == "msvcrt") [
|
++ optionals (hostPlatform.libc == "msvcrt") [
|
||||||
"target-os=windows"
|
|
||||||
"threadapi=win32"
|
"threadapi=win32"
|
||||||
"binary-format=pe"
|
|
||||||
"address-model=${toString hostPlatform.parsed.cpu.bits}"
|
|
||||||
"architecture=x86"
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
in
|
in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user