3
0
Fork 0
forked from mirrors/nixpkgs

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.
This commit is contained in:
Matthew Bauer 2016-09-05 15:41:30 -05:00
parent 45cd1ea620
commit f2e753a90c
No known key found for this signature in database
GPG key ID: E04D0AD9469141C3
6 changed files with 99 additions and 102 deletions

View file

@ -332,28 +332,26 @@ stdenv.mkDerivation ({
# #
# Likewise, the LTO code doesn't find zlib. # Likewise, the LTO code doesn't find zlib.
CPATH = concatStrings CPATH = makeSearchPathOutput "dev" "include" ([]
(intersperse ":" (map (x: "${x.dev or x}/include") ++ optional (zlib != null) zlib
(optionals (zlib != null) [ zlib ] ++ optional langJava boehmgc
++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ]
++ optionals javaAwtGtk [ gmp mpfr ] ++ optional (libpthread != null) libpthread
++ optional (libpthread != null) libpthread ++ optional (libpthreadCross != null) libpthreadCross
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd # On GNU/Hurd glibc refers to Mach & Hurd
# headers. # headers.
++ optionals (libcCross != null && ++ optionals (libcCross != null &&
hasAttr "propagatedBuildInputs" libcCross) hasAttr "propagatedBuildInputs" libcCross)
libcCross.propagatedBuildInputs))); libcCross.propagatedBuildInputs);
LIBRARY_PATH = concatStrings LIBRARY_PATH = makeLibraryPath ([]
(intersperse ":" (map (x: x + "/lib") ++ optional (zlib != null) zlib
(optionals (zlib != null) [ zlib ] ++ optional langJava boehmgc
++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ]
++ optionals javaAwtGtk [ gmp mpfr ] ++ optional (libpthread != null) libpthread);
++ optional (libpthread != null) libpthread)));
EXTRA_TARGET_CFLAGS = EXTRA_TARGET_CFLAGS =
if cross != null && libcCross != null then [ if cross != null && libcCross != null then [

View file

@ -332,8 +332,10 @@ stdenv.mkDerivation ({
else ""} else ""}
${if javaAwtGtk then "--enable-java-awt=gtk" else ""} ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
--with-gmp=${gmp.dev} --with-gmp-include=${gmp.dev}/include
--with-mpfr=${mpfr.dev} --with-gmp-lib=${gmp.out}/lib
--with-mpfr-include=${mpfr.dev}/include
--with-mpfr-lib=${mpfr.out}/lib
--with-mpc=${libmpc} --with-mpc=${libmpc}
${if libelf != null then "--with-libelf=${libelf}" else ""} ${if libelf != null then "--with-libelf=${libelf}" else ""}
--disable-libstdcxx-pch --disable-libstdcxx-pch
@ -454,27 +456,25 @@ stdenv.mkDerivation ({
# #
# Likewise, the LTO code doesn't find zlib. # Likewise, the LTO code doesn't find zlib.
CPATH = concatStrings CPATH = makeSearchPathOutput "dev" "include" ([]
(intersperse ":" (map (x: "${x.dev or x}/include") ++ optional (zlib != null) zlib
(optionals (zlib != null) [ zlib ] ++ optional langJava boehmgc
++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ]
++ optionals javaAwtGtk [ gmp mpfr ] ++ optional (libpthread != null) libpthread
++ optional (libpthread != null) libpthread ++ optional (libpthreadCross != null) libpthreadCross
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd # On GNU/Hurd glibc refers to Mach & Hurd
# headers. # headers.
++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" )
libcCross.propagatedBuildInputs))); libcCross.propagatedBuildInputs);
LIBRARY_PATH = concatStrings LIBRARY_PATH = makeLibraryPath ([]
(intersperse ":" (map (x: x + "/lib") ++ optional (zlib != null) zlib
(optionals (zlib != null) [ zlib ] ++ optional langJava boehmgc
++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ]
++ optionals javaAwtGtk [ gmp mpfr ] ++ optional (libpthread != null) libpthread);
++ optional (libpthread != null) libpthread)));
EXTRA_TARGET_CFLAGS = EXTRA_TARGET_CFLAGS =
if cross != null && libcCross != null then [ if cross != null && libcCross != null then [

View file

@ -463,27 +463,25 @@ stdenv.mkDerivation ({
# #
# Likewise, the LTO code doesn't find zlib. # Likewise, the LTO code doesn't find zlib.
CPATH = concatStrings CPATH = makeSearchPathOutput "dev" "include" ([]
(intersperse ":" (map (x: "${x.dev or x}/include") ++ optional (zlib != null) zlib
(optionals (zlib != null) [ zlib ] ++ optional langJava boehmgc
++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ]
++ optionals javaAwtGtk [ gmp mpfr ] ++ optional (libpthread != null) libpthread
++ optional (libpthread != null) libpthread ++ optional (libpthreadCross != null) libpthreadCross
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd # On GNU/Hurd glibc refers to Mach & Hurd
# headers. # headers.
++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" )
libcCross.propagatedBuildInputs))); libcCross.propagatedBuildInputs);
LIBRARY_PATH = concatStrings LIBRARY_PATH = makeLibraryPath ([]
(intersperse ":" (map (x: x + "/lib") ++ optional (zlib != null) zlib
(optionals (zlib != null) [ zlib ] ++ optional langJava boehmgc
++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ]
++ optionals javaAwtGtk [ gmp mpfr ] ++ optional (libpthread != null) libpthread);
++ optional (libpthread != null) libpthread)));
EXTRA_TARGET_CFLAGS = EXTRA_TARGET_CFLAGS =
if cross != null && libcCross != null then [ if cross != null && libcCross != null then [

View file

@ -337,8 +337,10 @@ stdenv.mkDerivation ({
else ""} else ""}
${if javaAwtGtk then "--enable-java-awt=gtk" else ""} ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
--with-gmp=${gmp.dev} --with-gmp-include=${gmp.dev}/include
--with-mpfr=${mpfr.dev} --with-gmp-lib=${gmp.out}/lib
--with-mpfr-include=${mpfr.dev}/include
--with-mpfr-lib=${mpfr.out}/lib
--with-mpc=${libmpc} --with-mpc=${libmpc}
${if libelf != null then "--with-libelf=${libelf}" else ""} ${if libelf != null then "--with-libelf=${libelf}" else ""}
--disable-libstdcxx-pch --disable-libstdcxx-pch
@ -458,27 +460,25 @@ stdenv.mkDerivation ({
# #
# Likewise, the LTO code doesn't find zlib. # Likewise, the LTO code doesn't find zlib.
CPATH = concatStrings CPATH = makeSearchPathOutput "dev" "include" ([]
(intersperse ":" (map (x: "${x.dev or x}/include") ++ optional (zlib != null) zlib
(optionals (zlib != null) [ zlib ] ++ optionals langJava [ boehmgc ]
++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ]
++ optionals javaAwtGtk [ gmp mpfr ] ++ optional (libpthread != null) libpthread
++ optional (libpthread != null) libpthread ++ optional (libpthreadCross != null) libpthreadCross
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd # On GNU/Hurd glibc refers to Mach & Hurd
# headers. # headers.
++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" )
libcCross.propagatedBuildInputs))); libcCross.propagatedBuildInputs);
LIBRARY_PATH = concatStrings LIBRARY_PATH = makeLibraryPath ([]
(intersperse ":" (map (x: x + "/lib") ++ optional (zlib != null) zlib
(optionals (zlib != null) [ zlib ] ++ optional langJava boehmgc
++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ]
++ optionals javaAwtGtk [ gmp mpfr ] ++ optional (libpthread != null) libpthread);
++ optional (libpthread != null) libpthread)));
EXTRA_TARGET_CFLAGS = EXTRA_TARGET_CFLAGS =
if cross != null && libcCross != null then [ if cross != null && libcCross != null then [

View file

@ -335,8 +335,10 @@ stdenv.mkDerivation ({
else ""} else ""}
${if javaAwtGtk then "--enable-java-awt=gtk" else ""} ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""} ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
--with-gmp=${gmp.dev} --with-gmp-include=${gmp.dev}/include
--with-mpfr=${mpfr.dev} --with-gmp-lib=${gmp.out}/lib
--with-mpfr-include=${mpfr.dev}/include
--with-mpfr-lib=${mpfr.out}/lib
--with-mpc=${libmpc} --with-mpc=${libmpc}
${if libelf != null then "--with-libelf=${libelf}" else ""} ${if libelf != null then "--with-libelf=${libelf}" else ""}
--disable-libstdcxx-pch --disable-libstdcxx-pch
@ -456,27 +458,25 @@ stdenv.mkDerivation ({
# #
# Likewise, the LTO code doesn't find zlib. # Likewise, the LTO code doesn't find zlib.
CPATH = concatStrings CPATH = makeSearchPath "dev" "include" ([]
(intersperse ":" (map (x: "${x.dev or x}/include") ++ optional (zlib != null) zlib
(optionals (zlib != null) [ zlib ] ++ optional langJava boehmgc
++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ]
++ optionals javaAwtGtk [ gmp mpfr ] ++ optional (libpthread != null) libpthread
++ optional (libpthread != null) libpthread ++ optional (libpthreadCross != null) libpthreadCross
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd # On GNU/Hurd glibc refers to Mach & Hurd
# headers. # headers.
++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs" ) ++ optionals (libcCross != null && libcCross ? "propagatedBuildInputs")
libcCross.propagatedBuildInputs))); libcCross.propagatedBuildInputs);
LIBRARY_PATH = concatStrings LIBRARY_PATH = makeLibraryPath ([]
(intersperse ":" (map (x: x + "/lib") ++ optional (zlib != null) zlib
(optionals (zlib != null) [ zlib ] ++ optional langJava boehmgc
++ optionals langJava [ boehmgc ] ++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk xlibs ++ optionals javaAwtGtk [ gmp mpfr ]
++ optionals javaAwtGtk [ gmp mpfr ] ++ optional (libpthread != null) libpthread);
++ optional (libpthread != null) libpthread)));
EXTRA_TARGET_CFLAGS = EXTRA_TARGET_CFLAGS =
if cross != null && libcCross != null then [ if cross != null && libcCross != null then [

View file

@ -4573,6 +4573,7 @@ in
libcCross = if crossSystem != null then libcCross else null; libcCross = if crossSystem != null then libcCross else null;
isl = if !stdenv.isDarwin then isl_0_14 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 { gcc49 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.9 {