summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Pierre De Jesus DIAZ <jean@foundationdevices.com>2023-11-28 12:34:55 +0100
committerEfraim Flashner <efraim@flashner.co.il>2023-12-11 13:36:51 +0200
commitd149073eaf27f7dc3ac6201b2fcf4a454c5dd549 (patch)
tree4842c4f9fef6799ba541211c7d855b31b114c022
parentc7d2faf1788a1f40defc9d4b875d19b912b6ef01 (diff)
gnu: cross-gcc: Find AVR Libc files.
* gnu/packages/cross-base.scm (cross-gcc-arguments) <configure-flags>: Add --with-native-system-header-dir for AVR. <make-flags>: Add target prefix to /lib to find AVR library. Change-Id: Ie9cae338da241fe987f53463aa3774a890e2af9a Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
-rw-r--r--gnu/packages/cross-base.scm18
1 files changed, 16 insertions, 2 deletions
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 7f67aaed89..e89208b8b6 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -202,21 +202,35 @@ base compiler and using LIBC (which may be either a libc package or #f.)"
#$@(if (target-avr? target)
#~("--enable-multilib")
+ #~())
+
+
+ #$@(if (and libc (target-avr? target))
+ #~((string-append "--with-native-system-header-dir="
+ #$libc "/" #$target "/include"))
#~()))
(remove
(lambda (flag)
(or (and #$libc
(string-prefix? "--enable-languages" flag))
+ (and #$libc
+ #$(target-avr? target)
+ (string-prefix? "--with-native-system-header-dir"
+ flag))
(and #$(target-avr? target)
(string=? flag "--disable-multilib"))))
#$flags)))
((#:make-flags flags)
(if libc
- #~(let ((libc (assoc-ref %build-inputs "libc")))
+ #~(let ((libc (assoc-ref %build-inputs "libc"))
+ (lib-prefix (if #$(target-avr? target)
+ (string-append "/" #$target)
+ "")))
;; FLAGS_FOR_TARGET are needed for the target libraries to receive
;; the -Bxxx for the startfiles.
- (cons (string-append "FLAGS_FOR_TARGET=-B" libc "/lib")
+ (cons (string-append "FLAGS_FOR_TARGET=-B"
+ libc lib-prefix "/lib")
#$flags))
flags))
((#:phases phases)