summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 7f67aaed89b..e89208b8b6b 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.)"
202 202
203 #$@(if (target-avr? target) 203 #$@(if (target-avr? target)
204 #~("--enable-multilib") 204 #~("--enable-multilib")
205 #~())
206
207
208 #$@(if (and libc (target-avr? target))
209 #~((string-append "--with-native-system-header-dir="
210 #$libc "/" #$target "/include"))
205 #~())) 211 #~()))
206 212
207 (remove 213 (remove
208 (lambda (flag) 214 (lambda (flag)
209 (or (and #$libc 215 (or (and #$libc
210 (string-prefix? "--enable-languages" flag)) 216 (string-prefix? "--enable-languages" flag))
217 (and #$libc
218 #$(target-avr? target)
219 (string-prefix? "--with-native-system-header-dir"
220 flag))
211 (and #$(target-avr? target) 221 (and #$(target-avr? target)
212 (string=? flag "--disable-multilib")))) 222 (string=? flag "--disable-multilib"))))
213 #$flags))) 223 #$flags)))
214 ((#:make-flags flags) 224 ((#:make-flags flags)
215 (if libc 225 (if libc
216 #~(let ((libc (assoc-ref %build-inputs "libc"))) 226 #~(let ((libc (assoc-ref %build-inputs "libc"))
227 (lib-prefix (if #$(target-avr? target)
228 (string-append "/" #$target)
229 "")))
217 ;; FLAGS_FOR_TARGET are needed for the target libraries to receive 230 ;; FLAGS_FOR_TARGET are needed for the target libraries to receive
218 ;; the -Bxxx for the startfiles. 231 ;; the -Bxxx for the startfiles.
219 (cons (string-append "FLAGS_FOR_TARGET=-B" libc "/lib") 232 (cons (string-append "FLAGS_FOR_TARGET=-B"
233 libc lib-prefix "/lib")
220 #$flags)) 234 #$flags))
221 flags)) 235 flags))
222 ((#:phases phases) 236 ((#:phases phases)