guix-commits
[Top][All Lists]
Advanced

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

01/18: utils: Define 'target-riscv?' predicate.


From: guix-commits
Subject: 01/18: utils: Define 'target-riscv?' predicate.
Date: Mon, 9 Aug 2021 13:32:58 -0400 (EDT)

efraim pushed a commit to branch wip-riscv
in repository guix.

commit 0b1392100850df02385febad08e41f71b0160cb7
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sun Aug 1 11:01:41 2021 +0300

    utils: Define 'target-riscv?' predicate.
    
    * guix/utils.scm (target-riscv?): New predicate.
---
 guix/utils.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/guix/utils.scm b/guix/utils.scm
index 0cf299f..de454fb 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2018, 2020 Marius Bakke <marius@gnu.org>
-;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
 ;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
@@ -95,6 +95,7 @@
             target-aarch64?
             target-arm?
             target-powerpc?
+            target-riscv?
             target-64bit?
             cc-for-target
             cxx-for-target
@@ -694,6 +695,11 @@ architecture (x86_64)?"
                                                  (%current-system))))
   (string-prefix? "powerpc" target))
 
+(define* (target-riscv? #:optional (target (or (%current-target-system)
+                                               (%current-system))))
+  "Is the architecture of TARGET a 'riscv' architecture variant?"
+  (string-prefix? "riscv" target))
+
 (define* (target-64bit? #:optional (system (or (%current-target-system)
                                                (%current-system))))
   (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" 
"powerpc64")))



reply via email to

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