aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2019-04-12 00:43:36 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2019-04-12 00:46:08 +0200
commit0b30a1a072de0dd288519bde6b401a3e906eff84 (patch)
treef13d80505a14a972205741e5a3f6e6cf49f786a1
parent55548cdc6af701bfa3df51139a9cf8fa3a2fcfa5 (diff)
downloadguix-0b30a1a072de0dd288519bde6b401a3e906eff84.tar
guix-0b30a1a072de0dd288519bde6b401a3e906eff84.tar.gz
build-system/linux-module: Configure module like the kernel.
* guix/build/linux-module-build-system.scm (configure): New procedure. (%standard-phases): Add "configure" phase.
-rw-r--r--guix/build/linux-module-build-system.scm19
1 files changed, 18 insertions, 1 deletions
diff --git a/guix/build/linux-module-build-system.scm b/guix/build/linux-module-build-system.scm
index 01cb8cef6c..cd76df2de7 100644
--- a/guix/build/linux-module-build-system.scm
+++ b/guix/build/linux-module-build-system.scm
@@ -32,6 +32,23 @@
;;
;; Code:
+;; Copied from make-linux-libre's "configure" phase.
+(define* (configure #:key inputs target #:allow-other-keys)
+ (setenv "KCONFIG_NOTIMESTAMP" "1")
+ (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
+ ;(let ((arch ,(system->linux-architecture
+ ; (or (%current-target-system)
+ ; (%current-system)))))
+ ; (setenv "ARCH" 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")))
+ ; TODO: (setenv "EXTRA_VERSION" ,extra-version)
+ ; TODO: kernel ".config".
+ #t)
+
(define* (build #:key inputs make-flags #:allow-other-keys)
(apply invoke "make" "-C"
(string-append (assoc-ref inputs "linux-module-builder")
@@ -60,7 +77,7 @@
(define %standard-phases
(modify-phases gnu:%standard-phases
- (delete 'configure)
+ (replace 'configure configure)
(replace 'build build)
(replace 'install install)))