mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-13 09:32:47 +00:00
Rename comp-eln-load-path → native-comp-eln-load-path
* src/comp.c (Fcomp_el_to_eln_filename): Rename comp-eln-load-path → native-comp-eln-load-path. * src/lread.c (maybe_swap_for_eln): Likewise. * lisp/startup.el (native-comp-eln-load-path) (normal-top-level): Likewise. * lisp/emacs-lisp/comp.el (comp-spill-lap-function, comp-final) (comp-eln-load-path-eff, comp-trampoline-compile) (comp-clean-up-stale-eln, comp-run-async-workers) (comp-lookup-eln, batch-byte-native-compile-for-bootstrap): Likewise.
This commit is contained in:
parent
901ce56603
commit
fbbcbed10e
@ -1333,7 +1333,7 @@ clashes."
|
||||
(setf (comp-ctxt-output comp-ctxt) (comp-el-to-eln-filename
|
||||
filename
|
||||
(when byte-native-for-bootstrap
|
||||
(car (last comp-eln-load-path))))))
|
||||
(car (last native-comp-eln-load-path))))))
|
||||
(setf (comp-ctxt-speed comp-ctxt) (alist-get 'native-comp-speed
|
||||
byte-native-qualities)
|
||||
(comp-ctxt-debug comp-ctxt) (alist-get 'native-comp-debug
|
||||
@ -3653,7 +3653,7 @@ Prepare every function for final compilation and drive the C back-end."
|
||||
(setf native-comp-verbose ,native-comp-verbose
|
||||
comp-libgccjit-reproducer ,comp-libgccjit-reproducer
|
||||
comp-ctxt ,comp-ctxt
|
||||
comp-eln-load-path ',comp-eln-load-path
|
||||
native-comp-eln-load-path ',native-comp-eln-load-path
|
||||
native-comp-driver-options
|
||||
',native-comp-driver-options
|
||||
load-path ',load-path)
|
||||
@ -3703,12 +3703,12 @@ Prepare every function for final compilation and drive the C back-end."
|
||||
|
||||
(defun comp-eln-load-path-eff ()
|
||||
"Return a list of effective eln load directories.
|
||||
Account for `comp-eln-load-path' and `comp-native-version-dir'."
|
||||
Account for `native-comp-eln-load-path' and `comp-native-version-dir'."
|
||||
(mapcar (lambda (dir)
|
||||
(expand-file-name comp-native-version-dir
|
||||
(file-name-as-directory
|
||||
(expand-file-name dir invocation-directory))))
|
||||
comp-eln-load-path))
|
||||
native-comp-eln-load-path))
|
||||
|
||||
(defun comp-trampoline-filename (subr-name)
|
||||
"Given SUBR-NAME return the filename containing the trampoline."
|
||||
@ -3772,14 +3772,14 @@ Return the trampoline if found or nil otherwise."
|
||||
when (file-writable-p f)
|
||||
do (cl-return f)
|
||||
finally (error "Cannot find suitable directory for output in \
|
||||
`comp-eln-load-path'")))))
|
||||
`native-comp-eln-load-path'")))))
|
||||
|
||||
|
||||
;; Some entry point support code.
|
||||
|
||||
;;;###autoload
|
||||
(defun comp-clean-up-stale-eln (file)
|
||||
"Given FILE remove all its *.eln files in `comp-eln-load-path'
|
||||
"Given FILE remove all its *.eln files in `native-comp-eln-load-path'
|
||||
sharing the original source filename (including FILE)."
|
||||
(when (string-match (rx "-" (group-n 1 (1+ hex)) "-" (1+ hex) ".eln" eos)
|
||||
file)
|
||||
@ -3910,7 +3910,7 @@ display a message."
|
||||
native-comp-verbose ,native-comp-verbose
|
||||
comp-libgccjit-reproducer ,comp-libgccjit-reproducer
|
||||
comp-async-compilation t
|
||||
comp-eln-load-path ',comp-eln-load-path
|
||||
native-comp-eln-load-path ',native-comp-eln-load-path
|
||||
native-comp-driver-options
|
||||
',native-comp-driver-options
|
||||
load-path ',load-path
|
||||
@ -4123,10 +4123,10 @@ bytecode definition was not changed in the meantime)."
|
||||
;;;###autoload
|
||||
(defun comp-lookup-eln (filename)
|
||||
"Given a Lisp source FILENAME return the corresponding .eln file if found.
|
||||
Search happens in `comp-eln-load-path'."
|
||||
Search happens in `native-comp-eln-load-path'."
|
||||
(cl-loop
|
||||
with eln-filename = (comp-el-to-eln-rel-filename filename)
|
||||
for dir in comp-eln-load-path
|
||||
for dir in native-comp-eln-load-path
|
||||
for f = (expand-file-name eln-filename
|
||||
(expand-file-name comp-native-version-dir
|
||||
(expand-file-name
|
||||
@ -4169,7 +4169,7 @@ Native compilation equivalent to `batch-byte-compile'."
|
||||
"Like `batch-native-compile', but used for bootstrap.
|
||||
Generate .elc files in addition to the .eln files.
|
||||
Force the produced .eln to be outputted in the eln system
|
||||
directory (the last entry in `comp-eln-load-path').
|
||||
directory (the last entry in `native-comp-eln-load-path').
|
||||
If the environment variable 'NATIVE_DISABLED' is set, only byte
|
||||
compile."
|
||||
(comp-ensure-native-compiler)
|
||||
|
@ -519,7 +519,7 @@ DIRS are relative."
|
||||
xdg-dir)
|
||||
(t emacs-d-dir))))
|
||||
|
||||
(defvar comp-eln-load-path)
|
||||
(defvar native-comp-eln-load-path)
|
||||
(defun normal-top-level ()
|
||||
"Emacs calls this function when it first starts up.
|
||||
It sets `command-line-processed', processes the command-line,
|
||||
@ -538,21 +538,21 @@ It is the default value of the variable `top-level'."
|
||||
(startup--xdg-or-homedot startup--xdg-config-home-emacs nil))
|
||||
|
||||
(when (featurep 'native-compile)
|
||||
;; Form `comp-eln-load-path'.
|
||||
;; Form `native-comp-eln-load-path'.
|
||||
(let ((path-env (getenv "EMACSNATIVELOADPATH")))
|
||||
(when path-env
|
||||
(dolist (path (split-string path-env path-separator))
|
||||
(unless (string= "" path)
|
||||
(push path comp-eln-load-path)))))
|
||||
(push path native-comp-eln-load-path)))))
|
||||
(push (expand-file-name "eln-cache/" user-emacs-directory)
|
||||
comp-eln-load-path)
|
||||
native-comp-eln-load-path)
|
||||
;; When $HOME is set to '/nonexistent' means we are running the
|
||||
;; testsuite, add a temporary folder in front to produce there
|
||||
;; new compilations.
|
||||
(when (equal (getenv "HOME") "/nonexistent")
|
||||
(let ((tmp-dir (make-temp-file "emacs-testsuite-" t)))
|
||||
(add-hook 'kill-emacs-hook (lambda () (delete-directory tmp-dir t)))
|
||||
(push tmp-dir comp-eln-load-path))))
|
||||
(push tmp-dir native-comp-eln-load-path))))
|
||||
;; Look in each dir in load-path for a subdirs.el file. If we
|
||||
;; find one, load it, which will add the appropriate subdirs of
|
||||
;; that dir into load-path. This needs to be done before setting
|
||||
@ -640,12 +640,12 @@ It is the default value of the variable `top-level'."
|
||||
(decode-coding-string dir coding t))
|
||||
path)))))
|
||||
(when (featurep 'native-compile)
|
||||
(let ((npath (symbol-value 'comp-eln-load-path)))
|
||||
(set 'comp-eln-load-path
|
||||
(let ((npath (symbol-value 'native-comp-eln-load-path)))
|
||||
(set 'native-comp-eln-load-path
|
||||
(mapcar (lambda (dir)
|
||||
;; Call expand-file-name to remove all the
|
||||
;; pesky ".." from the directyory names in
|
||||
;; comp-eln-load-path.
|
||||
;; native-comp-eln-load-path.
|
||||
(expand-file-name
|
||||
(decode-coding-string dir coding t)))
|
||||
npath))))
|
||||
|
14
src/comp.c
14
src/comp.c
@ -4095,11 +4095,11 @@ directory in `comp-eln-load-path' otherwise. */)
|
||||
Lisp_Object source_filename = filename;
|
||||
filename = Fcomp_el_to_eln_rel_filename (filename);
|
||||
|
||||
/* If base_dir was not specified search inside Vcomp_eln_load_path
|
||||
/* If base_dir was not specified search inside Vnative_comp_eln_load_path
|
||||
for the first directory where we have write access. */
|
||||
if (NILP (base_dir))
|
||||
{
|
||||
Lisp_Object eln_load_paths = Vcomp_eln_load_path;
|
||||
Lisp_Object eln_load_paths = Vnative_comp_eln_load_path;
|
||||
FOR_EACH_TAIL (eln_load_paths)
|
||||
{
|
||||
Lisp_Object dir = XCAR (eln_load_paths);
|
||||
@ -4630,7 +4630,7 @@ void
|
||||
eln_load_path_final_clean_up (void)
|
||||
{
|
||||
#ifdef WINDOWSNT
|
||||
Lisp_Object dir_tail = Vcomp_eln_load_path;
|
||||
Lisp_Object dir_tail = Vnative_comp_eln_load_path;
|
||||
FOR_EACH_TAIL (dir_tail)
|
||||
{
|
||||
Lisp_Object files_in_dir =
|
||||
@ -4755,7 +4755,7 @@ void
|
||||
fixup_eln_load_path (Lisp_Object eln_filename)
|
||||
{
|
||||
Lisp_Object last_cell = Qnil;
|
||||
Lisp_Object tem = Vcomp_eln_load_path;
|
||||
Lisp_Object tem = Vnative_comp_eln_load_path;
|
||||
FOR_EACH_TAIL (tem)
|
||||
if (CONSP (tem))
|
||||
last_cell = tem;
|
||||
@ -5127,7 +5127,7 @@ static bool
|
||||
file_in_eln_sys_dir (Lisp_Object filename)
|
||||
{
|
||||
Lisp_Object eln_sys_dir = Qnil;
|
||||
Lisp_Object tmp = Vcomp_eln_load_path;
|
||||
Lisp_Object tmp = Vnative_comp_eln_load_path;
|
||||
FOR_EACH_TAIL (tmp)
|
||||
eln_sys_dir = XCAR (tmp);
|
||||
return !NILP (Fstring_match (Fregexp_quote (Fexpand_file_name (eln_sys_dir,
|
||||
@ -5369,7 +5369,7 @@ For internal use. */);
|
||||
doc: /* Hash table eln-filename -> el-filename. */);
|
||||
Vcomp_eln_to_el_h = CALLN (Fmake_hash_table, QCtest, Qequal);
|
||||
|
||||
DEFVAR_LISP ("comp-eln-load-path", Vcomp_eln_load_path,
|
||||
DEFVAR_LISP ("native-comp-eln-load-path", Vnative_comp_eln_load_path,
|
||||
doc: /* List of eln cache directories.
|
||||
|
||||
If a directory is non absolute is assumed to be relative to
|
||||
@ -5381,7 +5381,7 @@ The last directory of this list is assumed to be the system one. */);
|
||||
/* Temporary value in use for bootstrap. We can't do better as
|
||||
`invocation-directory' is still unset, will be fixed up during
|
||||
dump reload. */
|
||||
Vcomp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil);
|
||||
Vnative_comp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil);
|
||||
|
||||
DEFVAR_BOOL ("comp-enable-subr-trampolines", comp_enable_subr_trampolines,
|
||||
doc: /* If non-nil enable primitive trampoline synthesis.
|
||||
|
@ -1700,7 +1700,7 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd,
|
||||
return;
|
||||
|
||||
/* Search eln in the eln-cache directories. */
|
||||
Lisp_Object eln_path_tail = Vcomp_eln_load_path;
|
||||
Lisp_Object eln_path_tail = Vnative_comp_eln_load_path;
|
||||
Lisp_Object src_name =
|
||||
Fsubstring (*filename, Qnil, make_fixnum (-1));
|
||||
if (NILP (Ffile_exists_p (src_name)))
|
||||
|
Loading…
Reference in New Issue
Block a user