···13, extraPackages ? [], extraBuildCommands ? ""
14, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
15, buildPackages ? {}
016}:
1718with stdenvNoCC.lib;
···44 # The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
45 coreutils_bin = if nativeTools then "" else getBin coreutils;
4647- default_cxx_stdlib_compile = optionalString (targetPlatform.isLinux && !(cc.isGNU or false) && !nativeTools && cc ? gcc)
48- "-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)";
0004950 # The "infix salt" is a arbitrary string added in the middle of env vars
51 # defined by cc-wrapper's hooks so that multiple cc-wrappers can be used
···256257 echo "$ccLDFlags" > $out/nix-support/cc-ldflags
258 echo "$ccCFlags" > $out/nix-support/cc-cflags
259- ''
260-261- + optionalString propagateDoc ''
262 ##
263 ## Man page and info support
264 ##
···13, extraPackages ? [], extraBuildCommands ? ""
14, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
15, buildPackages ? {}
16+, libcxx ? null
17}:
1819with stdenvNoCC.lib;
···45 # The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
46 coreutils_bin = if nativeTools then "" else getBin coreutils;
4748+ default_cxx_stdlib_compile = if (targetPlatform.isLinux && !(cc.isGNU or false) && !nativeTools && cc ? gcc) then
49+ "-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)"
50+ else if targetPlatform.isDarwin && (libcxx != null) && (cc.isClang or false) then
51+ "-isystem ${libcxx}/include/c++/v1"
52+ else "";
5354 # The "infix salt" is a arbitrary string added in the middle of env vars
55 # defined by cc-wrapper's hooks so that multiple cc-wrappers can be used
···260261 echo "$ccLDFlags" > $out/nix-support/cc-ldflags
262 echo "$ccCFlags" > $out/nix-support/cc-cflags
263+ '' + optionalString (targetPlatform.isDarwin && (libcxx != null) && (cc.isClang or false)) ''
264+ echo " -L${libcxx}/lib" >> $out/nix-support/cc-ldflags
265+ '' + optionalString propagateDoc ''
266 ##
267 ## Man page and info support
268 ##