@@ -1711,19 +1711,43 @@ (define-public libcxxabi-6
(modify-phases (@ (guix build cmake-build-system) %standard-phases)
(add-after 'unpack 'chdir
(lambda _ (chdir "libcxxabi")))
- (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((gcc (assoc-ref inputs "gcc")))
+ (add-after 'unpack 'adjust-CPLUS_INCLUDE_PATH
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ (define (delete* what lst)
+ (if (null? what)
+ lst
+ (delete* (cdr what) (delete (car what) lst))))
+
+ (let ((gcc (or (assoc-ref inputs "gcc") (assoc-ref native-inputs "gcc")))
+ (cross-gcc (assoc-ref native-inputs "cross-gcc")))
;; Hide GCC's C++ headers so that they do not interfere with
;; the ones we are attempting to build.
(setenv "CPLUS_INCLUDE_PATH"
(string-join
(cons (string-append
(assoc-ref inputs "libcxx") "/include/c++/v1")
- (delete (string-append gcc "/include/c++")
- (string-split (getenv "CPLUS_INCLUDE_PATH")
- #\:)))
+ (delete*
+ `(,(string-append gcc "/include/c++")
+ ,@(if cross-gcc
+ `(,(string-append cross-gcc "/include/c++"))
+ '()))
+ (string-split (getenv "CPLUS_INCLUDE_PATH")
+ #\:)))
":"))
+ (when cross-gcc
+ (setenv "CROSS_CPLUS_INCLUDE_PATH"
+ (string-join
+ (cons (string-append
+ (assoc-ref inputs "libcxx") "/include/c++/v1")
+ (delete*
+ (list (string-append cross-gcc "/include/c++")
+ (string-append gcc "/include/c++"))
+ (string-split (getenv "CROSS_CPLUS_INCLUDE_PATH")
+ #\:)))
+ ":"))
+ (format #true
+ "environment variable `CROSS_CPLUS_INCLUDE_PATH' changed to ~a~%"
+ (getenv "CROSS_CPLUS_INCLUDE_PATH")))
(format #true
"environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
(getenv "CPLUS_INCLUDE_PATH")))))
@@ -1733,8 +1757,8 @@ (define-public libcxxabi-6
(assoc-ref outputs "out") "/include")))
(install-file "../libcxxabi/include/__cxxabi_config.h" include-dir)
(install-file "../libcxxabi/include/cxxabi.h" include-dir)))))))
- (native-inputs
- (list clang-6 llvm-6 libcxx-6))
+ (inputs (list llvm-6 libcxx-6))
+ (native-inputs (list (clang-for-target clang-6)))
(home-page "https://libcxxabi.llvm.org")
(synopsis "C++ standard library support")
(description