Subject: [PATCH v3 06/27] gnu: swi-prolog: Make configuration wok when cross-compiling.

From: Maxime Devos <[email-masked]>
Date: Thu, 30 Sep 2021 00:47:38 +0200

* gnu/packages/prolog.scm
  (swi-prolog)[arguments]<#:configure-flags>: Set BSD_SIGNALS and QSORT_R_GNU
  when cross-compiling.
---
 gnu/packages/prolog.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/prolog.scm b/gnu/packages/prolog.scm
index be5a3c5bf8..8d940530d8 100644
--- a/gnu/packages/prolog.scm
+++ b/gnu/packages/prolog.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2013 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2020 Brett Gilio <[email-masked]>
 ;;; Copyright © 2021 Efraim Flashner <[email-masked]>
+;;; Copyright © 2021 Maxime Devos <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,7 +99,13 @@ manner.  It also features an interactive interpreter.")
     (arguments
      `(#:parallel-build? #t
        #:configure-flags
-       (list "-DINSTALL_DOCUMENTATION=ON"
+       (list ,@(if (%current-target-system)
+                   ;; Set this manually, otherwise CMake would need to
+                   ;; run a cross-compiled binary, which it can't do.
+                   ;; These values were found on a Linux system.
+                   '("-DBSD_SIGNALS=1" "-DQSORT_R_GNU=1")
+                   '())
+             "-DINSTALL_DOCUMENTATION=ON"
              "-DSWIPL_INSTALL_IN_LIB=OFF") ; FIXME: Breaks RUNPATH validation.
        #:phases
        (modify-phases %standard-phases
-- 
2.33.0