From f2e753a90c3f7a9e715216501b9b0f95e766701f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 5 Sep 2016 15:41:30 -0500 Subject: [PATCH] gcc: fix gmp, mpfr includes This should get gcc48, gcc5, and gcc6 working again. Also: use makeLibraryPath, and makeSearchPathOutput for LIBRARY_PATH and CPATH. This is a refactor but it also fixes an issue with zlib. --- .../development/compilers/gcc/4.5/default.nix | 38 ++++++++--------- .../development/compilers/gcc/4.8/default.nix | 42 +++++++++---------- .../development/compilers/gcc/4.9/default.nix | 36 ++++++++-------- pkgs/development/compilers/gcc/5/default.nix | 42 +++++++++---------- pkgs/development/compilers/gcc/6/default.nix | 42 +++++++++---------- pkgs/top-level/all-packages.nix | 1 + 6 files changed, 99 insertions(+), 102 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 5d05410a7fda..12e7e23e90b6 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -332,28 +332,26 @@ 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 + CPATH = makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ++ optional 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 && - hasAttr "propagatedBuildInputs" libcCross) - libcCross.propagatedBuildInputs))); + # On GNU/Hurd glibc refers to Mach & Hurd + # headers. + ++ optionals (libcCross != null && + hasAttr "propagatedBuildInputs" libcCross) + 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))); + 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 [ diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 41b29400dd86..cf06fe9567e6 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -332,8 +332,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 @@ -454,27 +456,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 + CPATH = makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ++ optional 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))); + # 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))); + 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 [ diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index f758a1e172ef..a746b7e12b33 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -463,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 + CPATH = makeSearchPathOutput "dev" "include" ([] + ++ optional (zlib != null) zlib + ++ optional 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))); + # 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))); + 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 [ diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 0f8a0bbf794a..6f8a32a7bfc0 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -337,8 +337,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 @@ -458,27 +460,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 + 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))); + # 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))); + 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 [ diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 6a1616154cb1..57172a2d9db9 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -335,8 +335,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 @@ -456,27 +458,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 + CPATH = makeSearchPath "dev" "include" ([] + ++ optional (zlib != null) zlib + ++ optional 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))); + # 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))); + 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 [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 35bd07a59d2e..ad5f72d7d604 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4573,6 +4573,7 @@ in libcCross = if crossSystem != null then libcCross else null; isl = if !stdenv.isDarwin then isl_0_14 else null; + cloog = if !stdenv.isDarwin then cloog else null; })); gcc49 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.9 {