summary refs log tree commit diff
diff options
context:
space:
mode:
authorCarl Dong <accounts@carldong.me>2019-05-06 22:21:43 +0000
committerLudovic Courtès <ludo@gnu.org>2019-05-13 09:46:58 +0200
commit102d307520dee27a40feb1ca5a699763a2f3aefe (patch)
treea2dc2f01ceb08a373bec486507c8595f5f493f36
parentd815728525f97373942072db48fcf497b02919fd (diff)
downloadguix-102d307520dee27a40feb1ca5a699763a2f3aefe.tar.gz
gnu: cross-base: Allow using non-default glibc.
* gnu/packages/cross-base.scm (cross-libc, native-libc, cross-newlib?):
  Add 'libc' optional argument to specify using a non-default glibc
  package.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--gnu/packages/cross-base.scm23
1 files changed, 14 insertions, 9 deletions
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 25caacb723..b3b90a6490 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -422,14 +422,15 @@ target that libc."
 
 (define* (cross-libc target
                      #:optional
+                     (libc glibc)
                      (xgcc (cross-gcc target))
                      (xbinutils (cross-binutils target))
                      (xheaders (cross-kernel-headers target)))
-  "Return a libc cross-built for TARGET, a GNU triplet.  Use XGCC and
-XBINUTILS and the cross tool chain."
-  (if (cross-newlib? target)
-      (native-libc target)
-      (let ((libc glibc))
+  "Return LIBC cross-built for TARGET, a GNU triplet. Use XGCC and XBINUTILS
+and the cross tool chain."
+  (if (cross-newlib? target libc)
+      (native-libc target libc)
+      (let ((libc libc))
         (package (inherit libc)
           (name (string-append "glibc-cross-" target))
           (arguments
@@ -502,13 +503,17 @@ XBINUTILS and the cross tool chain."
                            ,@(package-inputs libc)     ;FIXME: static-bash
                            ,@(package-native-inputs libc)))))))
 
-(define (native-libc target)
+(define* (native-libc target
+                     #:optional
+                     (libc glibc))
   (if (target-mingw? target)
       mingw-w64
-      glibc))
+      libc))
 
-(define (cross-newlib? target)
-  (not (eq? (native-libc target) glibc)))
+(define* (cross-newlib? target
+                       #:optional
+                       (libc glibc))
+  (not (eq? (native-libc target libc) libc)))
 
 
 ;;; Concrete cross tool chains are instantiated like this: