summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAndreaCorallo <akrl@sdf.org>2020-02-06 20:23:14 +0000
committerAndreaCorallo <akrl@sdf.org>2020-02-06 20:23:14 +0000
commit2dae7e1b697fef389e8e193d60ef799e2b3b09b4 (patch)
treed7eae40835307d582deb59b39bcbfbc2f5969340 /lisp/emacs-lisp
parent0da62d94e2a167d5ccfd8ece03623afdc178154c (diff)
downloademacs-2dae7e1b697fef389e8e193d60ef799e2b3b09b4.tar.gz
emacs-2dae7e1b697fef389e8e193d60ef799e2b3b09b4.tar.bz2
emacs-2dae7e1b697fef389e8e193d60ef799e2b3b09b4.zip
Add system-configuration in the compilation output path
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/comp.el23
1 files changed, 17 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index e14f350c2ee..c3e797b9b17 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2014,9 +2014,12 @@ Update all insn accordingly."
(defun comp-compile-ctxt-to-file (name)
"Compile as native code the current context naming it NAME.
Prepare every function for final compilation and drive the C back-end."
- (comp-finalize-relocs)
- (unless comp-dry-run
- (comp--compile-ctxt-to-file name)))
+ (let ((dir (file-name-directory name)))
+ (comp-finalize-relocs)
+ (unless (file-exists-p dir)
+ (make-directory dir))
+ (unless comp-dry-run
+ (comp--compile-ctxt-to-file name))))
(defun comp-final (_)
"Final pass driving the C back-end for code emission."
@@ -2118,9 +2121,17 @@ Return the compilation unit file name."
(let ((data input)
(comp-native-compiling t)
(comp-ctxt (make-comp-ctxt
- :output (if (symbolp input)
- (make-temp-file (concat (symbol-name input) "-"))
- (file-name-sans-extension (expand-file-name input))))))
+ :output
+ (if (symbolp input)
+ (make-temp-file (concat (symbol-name input) "-"))
+ (let ((exp-file (expand-file-name input)))
+ (concat
+ (file-name-as-directory
+ (concat
+ (file-name-directory exp-file)
+ system-configuration))
+ (file-name-sans-extension
+ (file-name-nondirectory exp-file))))))))
(comp-log "\n \n" 1)
(condition-case err
(mapc (lambda (pass)