distro: Add i686 support.

* distro/packages/base.scm (gcc-4.7): Turn `arguments' into a lambda.
  Use `glibc-dynamic-linker' instead of the hard-coded linker name.
master
Nikita Karetnikov 2012-10-16 23:24:58 +00:00 committed by Ludovic Courtès
parent 124b17673b
commit a52e429f76
1 changed files with 77 additions and 75 deletions

View File

@ -1,5 +1,6 @@
;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012 Nikita Karetnikov <nikita@karetnikov.org>
;;;
;;; This file is part of Guix.
;;;
@ -704,9 +705,9 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
(define (glibc-dynamic-linker system)
"Return the name of Glibc's dynamic linker for SYSTEM."
(if (string=? system "x86_64-linux")
"ld-linux-x86-64.so.2"
(error "dynamic linker name not known for this system" system)))
(cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2")
((string=? system "i686-linux") "/lib/ld-linux.so.2")
(else (error "dynamic linker name not known for this system" system))))
(define-public gcc-4.7
(let ((stripped? #t)) ; TODO: make this a parameter
@ -725,6 +726,7 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
("mpfr" ,mpfr)
("mpc" ,mpc))) ; TODO: libelf, ppl, cloog, zlib, etc.
(arguments
(lambda (system)
`(#:out-of-source? #t
#:strip-binaries? ,stripped?
#:configure-flags
@ -743,7 +745,7 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
"-L" libc "/lib "
"-Wl,-dynamic-linker "
"-Wl," libc
"/lib/ld-linux-x86-64.so.2"))
,(glibc-dynamic-linker system)))
'())
,(string-append "BOOT_CFLAGS=-O2 "
,(if stripped? "-g0" "-g"))))
@ -764,7 +766,7 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
(("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix)
(format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%"
suffix
(string-append libc "/lib/ld-linux-x86-64.so.2"))))
(string-append libc ,(glibc-dynamic-linker system)))))
;; Tell where to find libstdc++, libc, and `?crt*.o', except
;; `crt{begin,end}.o', which come with GCC.
@ -801,7 +803,7 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
,(if stripped?
"install-strip"
"install"))))
%standard-phases)))))
%standard-phases))))))
(properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
(description "The GNU Compiler Collection")
@ -1557,7 +1559,7 @@ identifier SYSTEM."
(ice-9 regex)
(srfi srfi-1)
(srfi srfi-26))
,@(substitute-keyword-arguments (package-arguments gcc-4.7)
,@(substitute-keyword-arguments ((package-arguments gcc-4.7) system)
((#:configure-flags flags)
`(append (list ,(string-append "--target="
(boot-triplet system))
@ -1762,7 +1764,7 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/lib/~a \"$@\"~%"
;; doesn't honor $LIBRARY_PATH, which breaks `gnu-build-system'.)
,@(substitute-keyword-arguments ((package-arguments gcc-boot0) system)
((#:configure-flags boot-flags)
(let loop ((args (package-arguments gcc-4.7)))
(let loop ((args ((package-arguments gcc-4.7) system)))
(match args
((#:configure-flags normal-flags _ ...)
normal-flags)