@ -13,6 +13,7 @@
, extraPackages ? [ ] , extraBuildCommands ? " "
, isGNU ? false , isClang ? cc . isClang or false , gnugrep ? null
, buildPackages ? { }
, libcxx ? null
} :
with stdenvNoCC . lib ;
@ -44,8 +45,11 @@ let
# The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
coreutils_bin = if nativeTools then " " else getBin coreutils ;
default_cxx_stdlib_compile = optionalString ( targetPlatform . isLinux && ! ( cc . isGNU or false ) && ! nativeTools && cc ? gcc )
" - i s y s t e m $ ( e c h o - n ${ cc . gcc } / i n c l u d e / c + + / * ) - i s y s t e m $ ( e c h o - n ${ cc . gcc } / i n c l u d e / c + + / * ) / $ ( ${ cc . gcc } / b i n / g c c - d u m p m a c h i n e ) " ;
default_cxx_stdlib_compile = if ( targetPlatform . isLinux && ! ( cc . isGNU or false ) && ! nativeTools && cc ? gcc ) then
" - i s y s t e m $ ( e c h o - n ${ cc . gcc } / i n c l u d e / c + + / * ) - i s y s t e m $ ( e c h o - n ${ cc . gcc } / i n c l u d e / c + + / * ) / $ ( ${ cc . gcc } / b i n / g c c - d u m p m a c h i n e ) "
else if targetPlatform . isDarwin && ( libcxx != null ) && ( cc . isClang or false ) then
" - i s y s t e m ${ libcxx } / i n c l u d e / c + + / v 1 "
else " " ;
# The "infix salt" is a arbitrary string added in the middle of env vars
# defined by cc-wrapper's hooks so that multiple cc-wrappers can be used
@ -256,9 +260,9 @@ stdenv.mkDerivation {
echo " $ c c L D F l a g s " > $ out/nix-support/cc-ldflags
echo " $ c c C F l a g s " > $ out/nix-support/cc-cflags
''
+ optionalString propagateDoc ''
'' + o p t i o n a l S t r i n g ( t a r g e t P l a t f o r m . i s D a r w i n & & ( l i b c x x ! = n u l l ) & & ( c c . i s C l a n g o r f a l s e ) ) ''
echo " - L ${ libcxx } / l i b " > > $ out/nix-support/cc-ldflags
'' + o p t i o n a l S t r i n g p r o p a g a t e D o c ''
##
## Man page and info support
##