guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/5] gnu: linux-libre: Add support for cross-compilation.


From: David Craven
Subject: [PATCH 5/5] gnu: linux-libre: Add support for cross-compilation.
Date: Fri, 2 Sep 2016 18:09:28 +0200

* gnu/packages/linux.scm (linux-libre): Add support for
  cross-compilation.
---
 gnu/packages/linux.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index bb8eb88..7e3b762 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -288,7 +288,7 @@ for SYSTEM and optionally VARIANT, or #f if there is no 
such configuration."
        (modify-phases %standard-phases
          (delete 'configure)
          (replace 'build
-           (lambda* (#:key inputs #:allow-other-keys #:rest args)
+           (lambda* (#:key inputs target #:allow-other-keys #:rest args)
              ;; Avoid introducing timestamps
              (setenv "KCONFIG_NOTIMESTAMP" "1")
              (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
@@ -297,12 +297,15 @@ for SYSTEM and optionally VARIANT, or #f if there is no 
such configuration."
              (system* "patch" "-p1" "--force"
                       "-i" (assoc-ref inputs "patch/freedo+gnu"))
 
+             ;; 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"))
+               (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")))
-- 
2.9.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]