aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2021-06-01 17:17:42 +0200
committerAndrea Corallo2021-06-01 18:12:20 +0200
commita32e65b357ff634a976a24ee5d5c340addc025cd (patch)
tree9b33dc16b9bbf1c55358390428b96a29f8631c04
parentc4b02dad9bdf233888164067d5942c0d7642cae2 (diff)
downloademacs-a32e65b357ff634a976a24ee5d5c340addc025cd.tar.gz
emacs-a32e65b357ff634a976a24ee5d5c340addc025cd.zip
* Add `native-compile-target-directory' (bug#48743)
* lisp/emacs-lisp/comp.el (native-compile-target-directory): New variable. (comp-spill-lap-function): Make use of.
-rw-r--r--lisp/emacs-lisp/comp.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index b9c80d15322..638d4b274cc 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -200,6 +200,9 @@ Emacs Lisp file:
200\;; Local Variables:\n;; no-native-compile: t\n;; End:") 200\;; Local Variables:\n;; no-native-compile: t\n;; End:")
201;;;###autoload(put 'no-native-compile 'safe-local-variable 'booleanp) 201;;;###autoload(put 'no-native-compile 'safe-local-variable 'booleanp)
202 202
203(defvar native-compile-target-directory nil
204 "When non-nil force the target directory for the eln files being compiled.")
205
203(defvar comp-log-time-report nil 206(defvar comp-log-time-report nil
204 "If non-nil, log a time report for each pass.") 207 "If non-nil, log a time report for each pass.")
205 208
@@ -1337,8 +1340,9 @@ clashes."
1337 (unless (comp-ctxt-output comp-ctxt) 1340 (unless (comp-ctxt-output comp-ctxt)
1338 (setf (comp-ctxt-output comp-ctxt) (comp-el-to-eln-filename 1341 (setf (comp-ctxt-output comp-ctxt) (comp-el-to-eln-filename
1339 filename 1342 filename
1340 (when byte+native-compile 1343 (or native-compile-target-directory
1341 (car (last native-comp-eln-load-path)))))) 1344 (when byte+native-compile
1345 (car (last native-comp-eln-load-path)))))))
1342 (setf (comp-ctxt-speed comp-ctxt) (alist-get 'native-comp-speed 1346 (setf (comp-ctxt-speed comp-ctxt) (alist-get 'native-comp-speed
1343 byte-native-qualities) 1347 byte-native-qualities)
1344 (comp-ctxt-debug comp-ctxt) (alist-get 'native-comp-debug 1348 (comp-ctxt-debug comp-ctxt) (alist-get 'native-comp-debug
@@ -4183,9 +4187,9 @@ Native compilation equivalent to `batch-byte-compile'."
4183 "Like `batch-native-compile', but used for bootstrap. 4187 "Like `batch-native-compile', but used for bootstrap.
4184Generate .elc files in addition to the .eln files. 4188Generate .elc files in addition to the .eln files.
4185Force the produced .eln to be outputted in the eln system 4189Force the produced .eln to be outputted in the eln system
4186directory (the last entry in `native-comp-eln-load-path'). 4190directory (the last entry in `native-comp-eln-load-path') unless
4187If the environment variable 'NATIVE_DISABLED' is set, only byte 4191`native-compile-target-directory' is non-nil. If the environment
4188compile." 4192variable 'NATIVE_DISABLED' is set, only byte compile."
4189 (comp-ensure-native-compiler) 4193 (comp-ensure-native-compiler)
4190 (if (equal (getenv "NATIVE_DISABLED") "1") 4194 (if (equal (getenv "NATIVE_DISABLED") "1")
4191 (batch-byte-compile) 4195 (batch-byte-compile)