From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Craven Subject: [PATCH 5/5] gnu: linux-libre: Add support for cross-compilation. Date: Fri, 2 Sep 2016 18:09:28 +0200 Message-ID: <20160902160928.9458-6-david@craven.ch> References: <20160902160928.9458-1-david@craven.ch> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfr2X-00068v-HL for guix-devel@gnu.org; Fri, 02 Sep 2016 12:10:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfr2Q-0005b3-TE for guix-devel@gnu.org; Fri, 02 Sep 2016 12:10:00 -0400 Received: from so254-10.mailgun.net ([198.61.254.10]:35357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfr2O-0005Y5-Oj for guix-devel@gnu.org; Fri, 02 Sep 2016 12:09:54 -0400 In-Reply-To: <20160902160928.9458-1-david@craven.ch> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * 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