summary refs log tree commit diff
path: root/gnu/packages/digest.scm
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2020-06-29 15:44:07 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2020-06-29 15:47:11 +0200
commit1d25cfbaf4b707f5af9aafe6ac3d8828c5b89f45 (patch)
tree4c8902a5384ba7abcaca530eb4cec987733fa264 /gnu/packages/digest.scm
parent8db9300454d067dfa023430e51d7f394f203d849 (diff)
downloadguix-1d25cfbaf4b707f5af9aafe6ac3d8828c5b89f45.tar.gz
gnu: xxhash: Detect vector instructions at run time.
* gnu/packages/digest.scm (xxhash)[arguments]: Set DISPATCH=1 make flag
on x86.
Diffstat (limited to 'gnu/packages/digest.scm')
-rw-r--r--gnu/packages/digest.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/gnu/packages/digest.scm b/gnu/packages/digest.scm
index 7adc12e8db..78eeb7e286 100644
--- a/gnu/packages/digest.scm
+++ b/gnu/packages/digest.scm
@@ -21,7 +21,8 @@
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
-  #:use-module (guix utils))
+  #:use-module (guix utils)
+  #:use-module (ice-9 match))
 
 (define-public xxhash
   (package
@@ -40,6 +41,11 @@
     (arguments
      `(#:make-flags
        (list ,(string-append "CC=" (cc-for-target))
+             ,(match (or (%current-target-system)
+                         (%current-system))
+                ;; Detect vector instruction set at run time.
+                ((or "i686-linux" "x86_64-linux") "DISPATCH=1")
+                (_ "DISPATCH=0"))
              "XXH_FORCE_MEMORY_ACCESS=1" ; improved performance with GCC
              (string-append "prefix=" (assoc-ref %outputs "out")))
        #:phases