git.iko.soy/typeable/nixpkgs
on master help sign in
boost: use standardized system information
commitf45211bd6d0f16c3a3c9919f163a060c9f804ca2 authorMatthew Bauer <mjbauer95@gmail.com> dateSat 23 Jun 2018, 22:43 (8 years ago) parent4f6d61e
1 file changed+15−6
pkgs/development/libraries/boost/generic.nix+15−6
pkgs/development/libraries/boost/generic.nix+15−6
@@ -1,8 +1,7 @@
11{ stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv
22, which
33, buildPackages, buildPlatform, hostPlatform
4−, toolset ? /**/ if stdenv.cc.isClang then "clang"
5− else if stdenv.cc.isGNU && hostPlatform != buildPlatform then "gcc-cross"
4+, toolset ? /**/ if stdenv.cc.isClang then "clang"
65 else null
76, enableRelease ? true
87, enableDebug ? false
@@ -58,16 +57,26 @@ let
5857 "link=${link}"
5958 "-sEXPAT_INCLUDE=${expat.dev}/include"
6059 "-sEXPAT_LIBPATH=${expat.out}/lib"
60+
61+ # TODO: make this unconditional
62+ ] ++ optionals (hostPlatform != buildPlatform) [
63+ "address-model=${toString hostPlatform.parsed.cpu.bits}"
64+ "architecture=${toString hostPlatform.parsed.cpu.family}"
65+ "binary-format=${toString hostPlatform.parsed.kernel.execFormat.name}"
66+ "target-os=${toString hostPlatform.parsed.kernel.name}"
67+
68+ # adapted from table in boost manual
69+ # https://www.boost.org/doc/libs/1_66_0/libs/context/doc/html/context/architectures.html
70+ "abi=${if hostPlatform.parsed.cpu.family == "arm" then "aapcs"
71+ else if hostPlatform.isWindows then "ms"
72+ else if hostPlatform.isMips then "o32"
73+ else "sysv"}"
6174 ] ++ optional (link != "static") "runtime-link=${runtime-link}"
6275 ++ optional (variant == "release") "debug-symbols=off"
6376 ++ optional (toolset != null) "toolset=${toolset}"
6477 ++ optional (mpi != null || hostPlatform != buildPlatform) "--user-config=user-config.jam"
6578 ++ optionals (hostPlatform.libc == "msvcrt") [
66− "target-os=windows"
6779 "threadapi=win32"
68− "binary-format=pe"
69− "address-model=${toString hostPlatform.parsed.cpu.bits}"
70− "architecture=x86"
7180 ]);
7281
7382in