diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-05-15 22:22:03 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-05-16 00:34:41 +0200 |
commit | 300a54bb984b92a36b68d7a672f2e11aa3dd2af1 (patch) | |
tree | 5ac81aaa46af25e5c3ab88641b75fa50c71c6867 /guix/utils.scm | |
parent | 644cb40cd83eff8a5bcdbd2d63887daa18228f41 (diff) |
utils: 'target-arm32?' & co. take an optional parameter.
* guix/utils.scm (target-arm32?, target-aarch64?)
(target-arm?, target-64bit?): Make 'target' an optional parameter.
Diffstat (limited to 'guix/utils.scm')
-rw-r--r-- | guix/utils.scm | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index 3e8e59b8dc..d7b197fa44 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -490,18 +490,21 @@ a character other than '@'." (and target (string-suffix? "-mingw32" target))) -(define (target-arm32?) - (string-prefix? "arm" (or (%current-target-system) (%current-system)))) +(define* (target-arm32? #:optional (target (or (%current-target-system) + (%current-system)))) + (string-prefix? "arm" target)) -(define (target-aarch64?) - (string-prefix? "aarch64" (or (%current-target-system) (%current-system)))) +(define* (target-aarch64? #:optional (target (or (%current-target-system) + (%current-system)))) + (string-prefix? "aarch64" target)) -(define (target-arm?) - (or (target-arm32?) (target-aarch64?))) +(define* (target-arm? #:optional (target (or (%current-target-system) + (%current-system)))) + (or (target-arm32? target) (target-aarch64? target))) -(define (target-64bit?) - (let ((system (or (%current-target-system) (%current-system)))) - (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64")))) +(define* (target-64bit? #:optional (system (or (%current-target-system) + (%current-system)))) + (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64"))) (define version-compare (let ((strverscmp |