From 8f8f74da2ee0f7da8d00b75d16f0089c8a73d72b Mon Sep 17 00:00:00 2001 From: Manolis Ragkousis
Date: Sat, 22 Mar 2014 18:01:29 +0000 Subject: [PATCH] gnu: base: Added macro for choosing glibc for target system * gnu/packages/base.scm (glibc/linux): Renamed glibc to glibc/linux * gnu/packages/base.scm (glibc-for-target): Choose which glibc to use * gnu/packages/base.scm (glibc): Added macro to choose glibc --- gnu/packages/base.scm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 906d0a3..c90d1fc 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -39,7 +39,8 @@ #:use-module (guix utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) - #:use-module (ice-9 match)) + #:use-module (ice-9 match) + #:export (glibc)) ;;; Commentary: ;;; @@ -353,7 +354,7 @@ library for working with executable and object formats is also included.") (license gpl3+) (home-page "http://www.gnu.org/software/binutils/"))) -(define-public glibc +(define-public glibc/linux (package (name "glibc") (version "2.18") @@ -1091,4 +1092,14 @@ store.") ("gcc" ,gcc-final) ("libc" ,glibc-final)))) +(define (glibc-for-target target) + "Return the glibc for TARGET, glibc/linux for a linux host or +glibc/hurd for a hurd host" + (match target + ("i686-pc-gnu" glibc/hurd) + (_ glibc/linux))) + +(define-syntax glibc + (identifier-syntax (glibc-for-target (or (%current-target-system) (%current-system))))) + ;;; base.scm ends here -- 1.9.0