[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/17] gnu: linux-libre: Add support for cross-compilation.
From: |
David Craven |
Subject: |
[PATCH 06/17] gnu: linux-libre: Add support for cross-compilation. |
Date: |
Fri, 9 Sep 2016 14:34:15 +0200 |
* gnu/packages/linux.scm (linux-libre): Add support for
cross-compilation.
---
gnu/packages/linux.scm | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 436f3d3..ce714c6 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -291,17 +291,21 @@ for SYSTEM and optionally VARIANT, or #f if there is no
such configuration."
#:phases
(modify-phases %standard-phases
(replace 'configure
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key inputs native-inputs target #:allow-other-keys)
;; Avoid introducing timestamps
(setenv "KCONFIG_NOTIMESTAMP" "1")
(setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
+ ;; Set ARCH and CROSS_COMPILE
(let ((arch ,(system->linux-architecture
(or (%current-target-system)
(%current-system)))))
- (setenv "ARCH" arch))
+ (setenv "ARCH" arch)
+ (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
- (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
+ (when target
+ (setenv "CROSS_COMPILE" (string-append target "-"))
+ (format #t "`CROSS_COMPILE' set to `~a'~%" (getenv
"CROSS_COMPILE"))))
(let ((build (assoc-ref %standard-phases 'build))
(config (assoc-ref inputs "kconfig")))
@@ -334,10 +338,10 @@ for SYSTEM and optionally VARIANT, or #f if there is no
such configuration."
(zero? (system* "make" "oldconfig")))))
(replace 'install
- (lambda* (#:key inputs outputs #:allow-other-keys)
+ (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(moddir (string-append out "/lib/modules"))
- (mit (assoc-ref inputs "module-init-tools")))
+ (mit (assoc-ref (or native-inputs inputs)
"module-init-tools")))
(mkdir-p moddir)
(for-each (lambda (file)
(copy-file file
--
2.9.0
- Linux kernel, David Craven, 2016/09/08
- [PATCH 07/17] gnu: linux-libre: Use make-linux-libre., David Craven, 2016/09/09
- Re: [PATCH 07/17] gnu: linux-libre: Use make-linux-libre., Ludovic Courtès, 2016/09/11
- [PATCH 08/17] gnu: make-linux-libre: Add additional-configuration parameter., David Craven, 2016/09/09
- Re: [PATCH 08/17] gnu: make-linux-libre: Add additional-configuration parameter., Ludovic Courtès, 2016/09/11
- [PATCH 09/17] gnu: dtc: Remove patch-paths phase., David Craven, 2016/09/09
- Re: [PATCH 09/17] gnu: dtc: Remove patch-paths phase., Ludovic Courtès, 2016/09/11
- [PATCH 10/17] gnu: Add u-boot-beagle-bone-black., David Craven, 2016/09/09
- Re: [PATCH 10/17] gnu: Add u-boot-beagle-bone-black., Ludovic Courtès, 2016/09/11
- [PATCH 11/17] gnu: Add make-linux-libre-source., David Craven, 2016/09/09