1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-24 14:41:17 +00:00

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.
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 [

View file

@ -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 [

View file

@ -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 [

View file

@ -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 [

View file

@ -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 [

View file

@ -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 {