diff options
Diffstat (limited to 'pkgs/development/compilers/gcc/5/default.nix')
-rw-r--r-- | pkgs/development/compilers/gcc/5/default.nix | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index f5c69d24d63e..3d75c0e76daa 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -35,6 +35,7 @@ , gnused ? null , binutils ? null , cloog # unused; just for compat with gcc4, as we override the parameter on some places +, darwin ? null }: assert langJava -> zip != null && unzip != null @@ -202,7 +203,7 @@ let version = "5.4.0"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else ""; - bootstrap = cross == null && !stdenv.isDarwin; + bootstrap = cross == null; in @@ -337,8 +338,10 @@ stdenv.mkDerivation ({ else ""} ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} - --with-gmp=${gmp.dev} - --with-mpfr=${mpfr.dev} + --with-gmp-include=${gmp.dev}/include + --with-gmp-lib=${gmp.out}/lib + --with-mpfr-include=${mpfr.dev}/include + --with-mpfr-lib=${mpfr.out}/lib --with-mpc=${libmpc} ${if libelf != null then "--with-libelf=${libelf}" else ""} --disable-libstdcxx-pch @@ -360,8 +363,10 @@ stdenv.mkDerivation ({ ) ) } - ${if (stdenv ? glibc && cross == null) - then " --with-native-system-header-dir=${stdenv.glibc.dev}/include" + ${if cross == null + then if stdenv.isDarwin + then " --with-native-system-header-dir=${darwin.usr-include}" + else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include" else ""} ${if langAda then " --enable-libada" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""} @@ -458,27 +463,25 @@ stdenv.mkDerivation ({ # # Likewise, the LTO code doesn't find zlib. - CPATH = concatStrings - (intersperse ":" (map (x: "${x.dev or x}/include") - (optionals (zlib != null) [ zlib ] - ++ optionals langJava [ boehmgc ] - ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread - ++ optional (libpthreadCross != null) libpthreadCross - - # On GNU/Hurd glibc refers to Mach & Hurd - # headers. - ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) - libcCross.propagatedBuildInputs))); - - LIBRARY_PATH = concatStrings - (intersperse ":" (map (x: x + "/lib") - (optionals (zlib != null) [ zlib ] - ++ optionals langJava [ boehmgc ] - ++ optionals javaAwtGtk xlibs - ++ optionals javaAwtGtk [ gmp mpfr ] - ++ optional (libpthread != null) libpthread))); + CPATH = makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ++ optionals langJava [ boehmgc ] + ++ optionals javaAwtGtk xlibs + ++ optionals javaAwtGtk [ gmp mpfr ] + ++ optional (libpthread != null) libpthread + ++ optional (libpthreadCross != null) libpthreadCross + + # On GNU/Hurd glibc refers to Mach & Hurd + # headers. + ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) + libcCross.propagatedBuildInputs); + + LIBRARY_PATH = makeLibraryPath ([] + ++ optional (zlib != null) zlib + ++ optional langJava boehmgc + ++ optionals javaAwtGtk xlibs + ++ optionals javaAwtGtk [ gmp mpfr ] + ++ optional (libpthread != null) libpthread); EXTRA_TARGET_CFLAGS = if cross != null && libcCross != null then [ |