GNU bug report logs -
#66263
[PATCH 00/23] guix: Add avr as a platform.
Previous Next
Full log
Message #29 received at 66263 <at> debbugs.gnu.org (full text, mbox):
* gnu/build/cross-toolchain.scm (set-cross-path/avr): New procedure.
* gnu/build/cross-toolchain.scm (cross-gcc-build-phases): Add case for
AVR target.
---
gnu/build/cross-toolchain.scm | 41 +++++++++++++++++++++++++++++------
1 file changed, 34 insertions(+), 7 deletions(-)
diff --git a/gnu/build/cross-toolchain.scm b/gnu/build/cross-toolchain.scm
index 9746be3e50..8de62be593 100644
--- a/gnu/build/cross-toolchain.scm
+++ b/gnu/build/cross-toolchain.scm
@@ -97,6 +97,31 @@ (define (cross? x)
;; We're building the sans-libc cross-compiler, so nothing to do.
#t)))
+(define* (set-cross-path/avr #:key inputs #:allow-other-keys)
+ (match (assoc-ref inputs "libc")
+ ((? string? libc)
+ (define (cross? x)
+ ;; Return #t if X is a cross-libc.
+ (string-prefix? libc x))
+
+ (let ((cpath (string-append libc "/avr/include")))
+ (for-each (cut setenv <> cpath)
+ %gcc-cross-include-paths))
+
+ (setenv "CROSS_LIBRARY_PATH"
+ (string-append libc "/avr/lib"))
+
+ (for-each (lambda (var)
+ (and=> (getenv var)
+ (lambda (value)
+ (let* ((path (search-path-as-string->list value))
+ (native-path (list->search-path-as-string
+ (remove cross? path) ":")))
+ (setenv var native-path)))))
+ (cons "LIBRARY_PATH" %gcc-include-paths)))
+ ;; AVR sans-libc cross-compiler.
+ (else #t)))
+
(define* (set-cross-path/mingw #:key inputs target #:allow-other-keys)
"Add the cross MinGW headers to CROSS_C_*_INCLUDE_PATH, and remove them from
C_*INCLUDE_PATH."
@@ -174,13 +199,15 @@ (define* (cross-gcc-build-phases target
a target triplet."
(modify-phases phases
(add-before 'configure 'set-cross-path
- ;; This mingw32 target checking logic should match that of target-mingw?
- ;; in (guix utils), but (guix utils) is too large too copy over to the
- ;; build side entirely and for now we have no way to select variables to
- ;; copy over. See (gnu packages cross-base) for more details.
- (if (string-suffix? "-mingw32" target)
- (cut set-cross-path/mingw #:target target <...>)
- set-cross-path))
+ (cond
+ ;; This mingw32 target checking logic should match that of target-mingw?
+ ;; in (guix utils), but (guix utils) is too large too copy over to the
+ ;; build side entirely and for now we have no way to select variables to
+ ;; copy over. See (gnu packages cross-base) for more details.
+ ((string-suffix? "-mingw32" target)
+ (cut set-cross-path/mingw #:target target <...>))
+ ((string-prefix? "avr" target) set-cross-path/avr)
+ (else set-cross-path)))
(add-after 'install 'make-cross-binutils-visible
(cut make-cross-binutils-visible #:target target <...>))
(replace 'install install-strip)))
--
2.34.1
This bug report was last modified 1 year and 221 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.