@ -1,7 +1,7 @@
{ stdenv , fetchurl , noSysDirs
, langC ? true , langCC ? true , langFortran ? false
, langObjC ? stdenv . isDarwin
, langObjCpp ? stdenv . isDarwin
, langObjC ? targetPlatform . isDarwin
, langObjCpp ? targetPlatform . isDarwin
, langJava ? false
, langAda ? false
, langVhdl ? false
@ -48,7 +48,7 @@ assert cloog != null -> isl != null;
assert libelf != null -> zlib != null ;
# Make sure we get GNU sed.
assert stdenv . isDarwin -> gnused != null ;
assert hostPlatform . isDarwin -> gnused != null ;
# The go frontend is written in c++
assert langGo -> langCC ;
@ -71,7 +71,7 @@ let version = "4.8.5";
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch
++ optional stdenv . isDarwin ../gfortran-darwin-NXConstStr.patch ;
++ optional hostPlatform . isDarwin ../gfortran-darwin-NXConstStr.patch ;
javaEcj = fetchurl {
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
@ -197,7 +197,7 @@ let version = "4.8.5";
stageNameAddon = if crossStageStatic then " - s t a g e - s t a t i c " else " - s t a g e - f i n a l " ;
crossNameAddon = if targetPlatform != hostPlatform then " - ${ targetPlatform . config } " + stageNameAddon else " " ;
bootstrap = targetPlatform == hostPlatform && ! stdenv . isArm && ! stdenv . isMips ;
bootstrap = targetPlatform == hostPlatform && ! hostPlatform . isArm && ! hostPlatform . isMips ;
in
@ -225,7 +225,7 @@ stdenv.mkDerivation ({
libc_dev = stdenv . cc . libc_dev ;
postPatch =
if ( stdenv . isHurd
if ( hostPlatform . isHurd
|| ( libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross . crossConfig == " i 5 8 6 - p c - g n u " )
@ -297,11 +297,11 @@ stdenv.mkDerivation ({
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
++ ( optional stdenv . isDarwin gnused )
++ ( optional hostPlatform . isDarwin gnused )
;
preConfigure = stdenv . lib . optionalString ( stdenv . isSunOS && stdenv . is64bit ) ''
preConfigure = stdenv . lib . optionalString ( hostPlatform . isSunOS && hostPlatform . is64bit ) ''
export NIX_LDFLAGS = ` echo $ NIX_LDFLAGS | sed - e s ~ $ prefix/lib ~ $ prefix/lib/amd64 ~ g `
export LDFLAGS_FOR_TARGET = " - W l , - r p a t h , $ p r e f i x / l i b / a m d 6 4 $ L D F L A G S _ F O R _ T A R G E T "
export CXXFLAGS_FOR_TARGET = " - W l , - r p a t h , $ p r e f i x / l i b / a m d 6 4 $ C X X F L A G S _ F O R _ T A R G E T "
@ -311,7 +311,7 @@ stdenv.mkDerivation ({
dontDisableStatic = true ;
configureFlags = "
$ { if stdenv . isSunOS then
$ { if hostPlatform . isSunOS then
" - - e n a b l e - l o n g - l o n g - - e n a b l e - l i b s s p - - e n a b l e - t h r e a d s = p o s i x - - d i s a b l e - n l s - - e n a b l e - _ _ c x a _ a t e x i t " +
# On Illumos/Solaris GNU as is preferred
" - - w i t h - g n u - a s - - w i t h o u t - g n u - l d "
@ -357,7 +357,7 @@ stdenv.mkDerivation ({
)
}
$ { if targetPlatform == hostPlatform
then if stdenv . isDarwin
then if hostPlatform . isDarwin
then " - - w i t h - n a t i v e - s y s t e m - h e a d e r - d i r = ${ darwin . usr-include } "
else " - - w i t h - n a t i v e - s y s t e m - h e a d e r - d i r = ${ getDev stdenv . cc . libc } / i n c l u d e "
else " " }