2020-07-01 17:58:29 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, gcc
|
|
|
|
, nanos6
|
|
|
|
, icc-unwrapped
|
|
|
|
, wrapCCWith
|
|
|
|
, libstdcxxHook
|
2020-07-02 15:32:52 +02:00
|
|
|
, icc-license
|
2020-07-01 10:25:33 +02:00
|
|
|
}:
|
|
|
|
|
2020-07-01 17:58:29 +02:00
|
|
|
let
|
|
|
|
targetConfig = stdenv.targetPlatform.config;
|
|
|
|
inherit gcc;
|
|
|
|
in wrapCCWith rec {
|
|
|
|
cc = icc-unwrapped;
|
|
|
|
extraPackages = [ libstdcxxHook ];
|
|
|
|
extraBuildCommands = ''
|
|
|
|
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
|
|
|
|
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
|
|
|
|
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
|
2020-07-01 10:25:33 +02:00
|
|
|
|
2020-07-02 15:32:52 +02:00
|
|
|
echo "export INTEL_LICENSE_FILE=${icc-license}" \
|
2020-07-01 17:58:29 +02:00
|
|
|
>> $out/nix-support/setup-hook
|
2020-07-01 13:08:05 +02:00
|
|
|
|
2020-07-01 17:58:29 +02:00
|
|
|
# Create the wrappers for icc and icpc
|
|
|
|
wrap icc $wrapper $ccPath/icc
|
|
|
|
wrap icpc $wrapper $ccPath/icpc
|
2020-07-01 13:08:05 +02:00
|
|
|
'';
|
2020-07-01 10:25:33 +02:00
|
|
|
}
|