From 1d25cfbaf4b707f5af9aafe6ac3d8828c5b89f45 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 29 Jun 2020 15:44:07 +0200 Subject: gnu: xxhash: Detect vector instructions at run time. * gnu/packages/digest.scm (xxhash)[arguments]: Set DISPATCH=1 make flag on x86. --- gnu/packages/digest.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit 1.4.1