mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
gnu: gcc: Allow cross-compilation of GCC itself.
* gnu/packages/gcc.scm (gcc-4.7): Define `CC_FOR_TARGET', `AR_FOR_TARGET', etc. when cross-compiling.
This commit is contained in:
parent
e7133c7680
commit
de1d41f980
1 changed files with 128 additions and 107 deletions
|
@ -32,7 +32,39 @@ (define %gcc-infrastructure
|
|||
"ftp://gcc.gnu.org/pub/gcc/infrastructure/")
|
||||
|
||||
(define-public gcc-4.7
|
||||
(let ((stripped? #t)) ; TODO: make this a parameter
|
||||
(let* ((stripped? #t) ; TODO: make this a parameter
|
||||
(maybe-target-tools
|
||||
(lambda ()
|
||||
;; Return the `_FOR_TARGET' variables that are needed when
|
||||
;; cross-compiling GCC.
|
||||
(let ((target (%current-target-system)))
|
||||
(if target
|
||||
(map (lambda (var tool)
|
||||
(string-append (string-append var "_FOR_TARGET")
|
||||
"=" target "-" tool))
|
||||
'("CC" "CXX" "LD" "AR" "NM" "RANLIB" "STRIP")
|
||||
'("gcc" "g++" "ld" "ar" "nm" "ranlib" "strip"))
|
||||
'()))))
|
||||
(configure-flags
|
||||
(lambda ()
|
||||
;; This is terrible. Since we have two levels of quasiquotation,
|
||||
;; we have to do this convoluted thing just so we can insert the
|
||||
;; contents of (maybe-target-tools).
|
||||
(list 'quasiquote
|
||||
(append
|
||||
'("--enable-plugin"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-multilib"
|
||||
|
||||
"--with-local-prefix=/no-gcc-local-prefix"
|
||||
|
||||
,(let ((libc (assoc-ref %build-inputs "libc")))
|
||||
(if libc
|
||||
(string-append "--with-native-system-header-dir=" libc
|
||||
"/include")
|
||||
"--without-headers")))
|
||||
|
||||
(maybe-target-tools))))))
|
||||
(package
|
||||
(name "gcc")
|
||||
(version "4.7.3")
|
||||
|
@ -54,18 +86,7 @@ (define-public gcc-4.7
|
|||
(arguments
|
||||
`(#:out-of-source? #t
|
||||
#:strip-binaries? ,stripped?
|
||||
#:configure-flags
|
||||
`("--enable-plugin"
|
||||
"--enable-languages=c,c++"
|
||||
"--disable-multilib"
|
||||
|
||||
"--with-local-prefix=/no-gcc-local-prefix"
|
||||
|
||||
,(let ((libc (assoc-ref %build-inputs "libc")))
|
||||
(if libc
|
||||
(string-append "--with-native-system-header-dir=" libc
|
||||
"/include")
|
||||
"--without-headers")))
|
||||
#:configure-flags ,(configure-flags)
|
||||
#:make-flags
|
||||
(let ((libc (assoc-ref %build-inputs "libc")))
|
||||
`(,@(if libc
|
||||
|
|
Loading…
Reference in a new issue