summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-09-19 12:31:03 +0200
committerAndrea Corallo <akrl@sdf.org>2020-09-23 20:47:34 +0200
commit63c65b4fe0e27b70a99463a8f7de4750811fd1e0 (patch)
treed85500ffdb187849c651164e1358965e18717ef9 /lisp/emacs-lisp/comp.el
parent4a50f541447eddefcca3ebc6bedb110ac0041f90 (diff)
downloademacs-63c65b4fe0e27b70a99463a8f7de4750811fd1e0.tar.gz
emacs-63c65b4fe0e27b70a99463a8f7de4750811fd1e0.tar.bz2
emacs-63c65b4fe0e27b70a99463a8f7de4750811fd1e0.zip
* lisp/emacs-lisp/comp.el (native-compile): Add OUTPUT parameter.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el21
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 4795d2fc07e..d4f003f7717 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2709,13 +2709,14 @@ display a message."
;;; Compiler entry points.
;;;###autoload
-(defun native-compile (function-or-file &optional with-late-load)
+(defun native-compile (function-or-file &optional with-late-load output)
"Compile FUNCTION-OR-FILE into native code.
This is the entry-point for the Emacs Lisp native compiler.
FUNCTION-OR-FILE is a function symbol or a path to an Elisp file.
-When WITH-LATE-LOAD non Nil mark the compilation unit for late load
+When WITH-LATE-LOAD non-nil mark the compilation unit for late load
once finished compiling (internal use only).
-Return the compilation unit file name."
+When OUTPUT is non-nil use it as filename for the compiled object.
+Return the compile object filename."
(comp-ensure-native-compiler)
(unless (or (functionp function-or-file)
(stringp function-or-file))
@@ -2727,11 +2728,15 @@ Return the compilation unit file name."
(byte-compile-debug t)
(comp-ctxt
(make-comp-ctxt
- :output (if (symbolp function-or-file)
- (make-temp-file (symbol-name function-or-file) nil ".eln")
- (comp-el-to-eln-filename function-or-file
- (when byte-native-for-bootstrap
- (car (last comp-eln-load-path)))))
+ :output (or (when output
+ (expand-file-name output))
+ (if (symbolp function-or-file)
+ (make-temp-file (symbol-name function-or-file) nil
+ ".eln")
+ (comp-el-to-eln-filename
+ function-or-file
+ (when byte-native-for-bootstrap
+ (car (last comp-eln-load-path))))))
:with-late-load with-late-load)))
(comp-log "\n \n" 1)
(condition-case err