From f45211bd6d0f16c3a3c9919f163a060c9f804ca2 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 23 Jun 2018 22:43:05 -0400 Subject: boost: use standardized system information --- pkgs/development/libraries/boost/generic.nix | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'pkgs/development/libraries') diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix index efe1151359d..00c6d279c7a 100644 --- a/pkgs/development/libraries/boost/generic.nix +++ b/pkgs/development/libraries/boost/generic.nix @@ -1,8 +1,7 @@ { stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv , which , buildPackages, buildPlatform, hostPlatform -, toolset ? /**/ if stdenv.cc.isClang then "clang" - else if stdenv.cc.isGNU && hostPlatform != buildPlatform then "gcc-cross" +, toolset ? /**/ if stdenv.cc.isClang then "clang" else null , enableRelease ? true , enableDebug ? false @@ -58,16 +57,26 @@ let "link=${link}" "-sEXPAT_INCLUDE=${expat.dev}/include" "-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 (variant == "release") "debug-symbols=off" ++ optional (toolset != null) "toolset=${toolset}" ++ optional (mpi != null || hostPlatform != buildPlatform) "--user-config=user-config.jam" ++ optionals (hostPlatform.libc == "msvcrt") [ - "target-os=windows" "threadapi=win32" - "binary-format=pe" - "address-model=${toString hostPlatform.parsed.cpu.bits}" - "architecture=x86" ]); in -- cgit 1.4.1