guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/5] gnu: Add avr-gcc.


From: David Thompson
Subject: [PATCH 2/5] gnu: Add avr-gcc.
Date: Thu, 14 Apr 2016 09:17:01 -0400

* gnu/packages/avr.scm (avr-gcc): New variable.
---
 gnu/packages/avr.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index b30c64e..0ec115e 100644
--- a/gnu/packages/avr.scm
+++ b/gnu/packages/avr.scm
@@ -20,6 +20,7 @@
 
 (define-module (gnu packages avr)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix utils)
   #:use-module (guix download)
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
@@ -36,6 +37,36 @@
      '(#:configure-flags '("--target=avr"
                            "--disable-nls")))))
 
+(define-public avr-gcc
+  (let ((xgcc (cross-gcc "avr" avr-binutils)))
+    (package
+      (inherit xgcc)
+      (name "avr-gcc")
+      (arguments
+       (substitute-keyword-arguments (package-arguments xgcc)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             ;; Without a working multilib build, the resulting GCC lacks
+             ;; support for nearly every AVR chip.
+             (add-after 'unpack 'fix-genmultilib
+               (lambda _
+                 (substitute* "gcc/genmultilib"
+                   (("#!/bin/sh") (string-append "#!" (which "sh"))))
+                 #t))))
+         ((#:configure-flags flags)
+          '(list "--target=avr"
+                 "--enable-languages=c,c++"
+                 "--disable-nls"
+                 "--disable-libssp"
+                 "--with-dwarf2"))))
+      (native-search-paths
+       (list (search-path-specification
+              (variable "CROSS_CPATH")
+              (files '("avr/include")))
+             (search-path-specification
+              (variable "CROSS_LIBRARY_PATH")
+              (files '("avr/lib"))))))))
+
 (define-public avr-libc
   (package
     (name "avr-libc")
-- 
2.7.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]