summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorJohn Darrington <jmd@gnu.org>2013-12-09 22:57:15 +0100
committerLudovic Courtès <ludo@gnu.org>2013-12-10 13:55:35 +0100
commite67253dbe2cad74b58360ea61a770b149bd0f6ca (patch)
treec5219110543e58c61a267e5aa08e852fb0d03411 /gnu
parent4af2447e37f166aee7fb6852c2249a0de7d33a05 (diff)
downloadguix-e67253dbe2cad74b58360ea61a770b149bd0f6ca.tar.gz
gnu: compression: Fix cross-compilation of zlib.
* gnu/packages/compression.scm : Zlib uses a non-standard
  way of configuring for cross-compilation.  Thanks to Ludovic
  for showing me the correct way to fix this.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/compression.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index efffa92692..5275b8a8ef 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -44,12 +44,17 @@
      `(#:phases (alist-replace
                  'configure
                  (lambda* (#:key outputs #:allow-other-keys)
-                   ;; Zlib's home-made `configure' doesn't fails when passed
+                   ;; Zlib's home-made `configure' fails when passed
                    ;; extra flags like `--enable-fast-install', so we need to
                    ;; invoke it with just what it understand.
                    (let ((out (assoc-ref outputs "out")))
-                     (zero? (system* "./configure"
-                                     (string-append "--prefix=" out)))))
+                     ;; 'configure' doesn't understand '--host'.
+                     ,@(if (%current-target-system)
+                           `((setenv "CHOST" ,(%current-target-system)))
+                           '())
+                     (zero?
+                      (system* "./configure"
+                               (string-append "--prefix=" out)))))
                  %standard-phases)))
     (home-page "http://zlib.net/")
     (synopsis "The zlib compression library")