gnu: gcc@4.9, gcc@5: Adjust for CPLUS_INCLUDE_PATH changes.

* gnu/packages/gcc.scm (gcc-4.9): Unless cross-compiling, add ...
[arguments]: with a phase to remove glibc and GCC from CPLUS_INCLUDE_PATH.
(gcc-6)[arguments]: Inherit from GCC-4.8.
This commit is contained in:
Marius Bakke 2020-03-15 16:03:16 +01:00
parent d594963856
commit 56c833ea28
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -422,7 +422,33 @@ (define-public gcc-4.9
#t))))
;; Override inherited texinfo-5 with latest version.
(native-inputs `(("perl" ,perl) ;for manpages
("texinfo" ,texinfo)))))
("texinfo" ,texinfo)))
(arguments
(if (%current-target-system)
(package-arguments gcc-4.8)
;; For native builds of GCC 4.9 and GCC 5, the C++ include path needs
;; to be adjusted so it does not interfere with GCC's own build processes.
(substitute-keyword-arguments (package-arguments gcc-4.8)
((#:modules modules %gnu-build-system-modules)
`((srfi srfi-1)
,@modules))
((#:phases phases)
`(modify-phases ,phases
(add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
(lambda* (#:key inputs #:allow-other-keys)
(let ((libc (assoc-ref inputs "libc"))
(gcc (assoc-ref inputs "gcc")))
(setenv "CPLUS_INCLUDE_PATH"
(string-join (fold delete
(string-split (getenv "CPLUS_INCLUDE_PATH")
#\:)
(list (string-append libc "/include")
(string-append gcc "/include/c++")))
":"))
(format #t
"environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
(getenv "CPLUS_INCLUDE_PATH"))
#t))))))))))
(define-public gcc-5
;; Note: GCC >= 5 ships with .info files but 'make install' fails to install
@ -479,6 +505,10 @@ (define-public gcc-6
"gcc-6-source-date-epoch-1.patch"
"gcc-6-source-date-epoch-2.patch"
"gcc-5.0-libvtv-runpath.patch"))))
;; GCC 4.9 and 5 has a workaround that is not needed for GCC 6 and later.
(arguments (package-arguments gcc-4.8))
(inputs
`(("isl" ,isl)
,@(package-inputs gcc-4.7)))))