aboutsummaryrefslogtreecommitdiff
path: root/guix/build/emacs-utils.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/build/emacs-utils.scm')
-rw-r--r--guix/build/emacs-utils.scm15
1 files changed, 12 insertions, 3 deletions
diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index 8e12b5b6d4..aeb364133a 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -136,7 +136,14 @@ If native code is not supported, compile to bytecode instead."
(emacs-batch-eval
`(let ((byte-compile-debug t) ; for proper exit status
(byte+native-compile (native-comp-available-p))
- (files (directory-files-recursively ,dir "\\.el$")))
+ (files (directory-files-recursively ,dir "\\.el$"))
+ (write-bytecode
+ (and (native-comp-available-p)
+ (progn
+ (require 'comp)
+ (if (fboundp 'comp-write-bytecode-file)
+ 'comp-write-bytecode-file
+ 'comp--write-bytecode-file)))))
(mapc
(lambda (file)
(let (byte-to-native-output-buffer-file
@@ -146,11 +153,13 @@ If native code is not supported, compile to bytecode instead."
(cadr native-comp-eln-load-path))))
(if byte+native-compile
(native-compile file
- (comp-el-to-eln-filename file eln-dir))
+ (comp-el-to-eln-filename
+ (file-relative-name file ,dir)
+ eln-dir))
(byte-compile-file file))
;; After native compilation, write the bytecode file.
(unless (null byte-to-native-output-buffer-file)
- (comp-write-bytecode-file nil))))
+ (funcall write-bytecode nil))))
files))
#:dynamic? #t))