[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#66263] [PATCH 07/23] gnu: Add AVR phases to cross-gcc-build-phases.
From: |
Jean-Pierre De Jesus DIAZ |
Subject: |
[bug#66263] [PATCH 07/23] gnu: Add AVR phases to cross-gcc-build-phases. |
Date: |
Fri, 29 Sep 2023 11:16:11 +0200 |
* 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
- [bug#66263] [PATCH 21/23] guix: meson-build-system: Support AVR., (continued)
- [bug#66263] [PATCH 21/23] guix: meson-build-system: Support AVR., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 20/23] gnu: Add avr-toolchain., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 06/23] gnu: microscheme: Move to avr-xyz., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 13/23] gnu: cross-libc: Add AVR Libc case., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 16/23] gnu: cross-gcc-search-paths: Handle AVR target., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 18/23] gnu: Add avr-libc., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 08/23] gnu: avr-libc: Convert to procedure., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 09/23] gnu: Add make-cross-gcc-toolchain., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 10/23] gnu: Add binutils-cross-avr., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 12/23] gnu: Remove various AVR packages., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 07/23] gnu: Add AVR phases to cross-gcc-build-phases.,
Jean-Pierre De Jesus DIAZ <=
- [bug#66263] [PATCH 15/23] guix: meson-configuration: Fix boolean assigment., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 17/23] gnu: cross-gcc: Handle inputs for AVR., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 03/23] gnu: Add avr platform., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 14/23] gnu: cross-gcc-arguments: Handle AVR target., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 22/23] guix: meson-build-system: Disable PIC for AVR., Jean-Pierre De Jesus DIAZ, 2023/09/29
- [bug#66263] [PATCH 00/23] guix: Add avr as a platform., Jean-Pierre De Jesus Diaz, 2023/09/29