diff options
| author | Andrea Corallo | 2020-08-16 11:18:36 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-08-17 18:04:23 +0200 |
| commit | 171db3110159d95803dea13c4ee7bca4a795747b (patch) | |
| tree | 6dd47e1c08c0282b819847c7ad59bb47fe67fe1d /src | |
| parent | b6238d826e5abd1f49144df711deac6bffa3fe32 (diff) | |
| download | emacs-171db3110159d95803dea13c4ee7bca4a795747b.tar.gz emacs-171db3110159d95803dea13c4ee7bca4a795747b.zip | |
Make install target functional for new eln-cache directory arrangement
* src/comp.h (fixup_eln_load_path): New extern.
* src/comp.c (fixup_eln_load_path): New function.
* src/pdumper.c (dump_do_dump_relocation): Update to make use of
'fixup_eln_load_path'.
* lisp/loadup.el: Update to store in the compilation unit the
correct eln-cache installed path. Rename --lisp-dest -> --eln-dest
and.
* Makefile.in: Pass the eln destination directory to
src/Makefile. Rename LISP_DESTDIR -> ELN_DESTDIR.
(ELN_DESTDIR): Define.
(install-eln): New target.
(install): Add install-eln as prerequisite.
* src/Makefile.in: Rename --lisp-dest -> --eln-dest and
LISP_DESTDIR -> ELN_DESTDIR.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.in | 2 | ||||
| -rw-r--r-- | src/comp.c | 21 | ||||
| -rw-r--r-- | src/comp.h | 2 | ||||
| -rw-r--r-- | src/pdumper.c | 15 |
4 files changed, 26 insertions, 14 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 7380a87644b..31a5a7e7709 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -587,7 +587,7 @@ endif | |||
| 587 | ifeq ($(DUMPING),pdumper) | 587 | ifeq ($(DUMPING),pdumper) |
| 588 | $(pdmp): emacs$(EXEEXT) | 588 | $(pdmp): emacs$(EXEEXT) |
| 589 | LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=pdump \ | 589 | LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=pdump \ |
| 590 | --bin-dest $(BIN_DESTDIR) --lisp-dest $(LISP_DESTDIR) | 590 | --bin-dest $(BIN_DESTDIR) --eln-dest $(ELN_DESTDIR) |
| 591 | cp -f $@ $(bootstrap_pdmp) | 591 | cp -f $@ $(bootstrap_pdmp) |
| 592 | endif | 592 | endif |
| 593 | 593 | ||
diff --git a/src/comp.c b/src/comp.c index b795afae351..d42bb4f8eb5 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -4529,6 +4529,27 @@ maybe_defer_native_compilation (Lisp_Object function_name, | |||
| 4529 | /* Functions used to load eln files. */ | 4529 | /* Functions used to load eln files. */ |
| 4530 | /**************************************/ | 4530 | /**************************************/ |
| 4531 | 4531 | ||
| 4532 | /* Fixup the system eln-cache dir. This is the last entry in | ||
| 4533 | `comp-eln-load-path'. */ | ||
| 4534 | void | ||
| 4535 | fixup_eln_load_path (Lisp_Object directory) | ||
| 4536 | { | ||
| 4537 | Lisp_Object last_cell = Qnil; | ||
| 4538 | Lisp_Object tmp = Vcomp_eln_load_path; | ||
| 4539 | FOR_EACH_TAIL (tmp) | ||
| 4540 | if (CONSP (tmp)) | ||
| 4541 | last_cell = tmp; | ||
| 4542 | |||
| 4543 | Lisp_Object eln_cache_sys = | ||
| 4544 | Ffile_name_directory (concat2 (Vinvocation_directory, | ||
| 4545 | directory)); | ||
| 4546 | /* One directory up... */ | ||
| 4547 | eln_cache_sys = | ||
| 4548 | Ffile_name_directory (Fsubstring (eln_cache_sys, Qnil, | ||
| 4549 | make_fixnum (-1))); | ||
| 4550 | Fsetcar (last_cell, eln_cache_sys); | ||
| 4551 | } | ||
| 4552 | |||
| 4532 | typedef char *(*comp_lit_str_func) (void); | 4553 | typedef char *(*comp_lit_str_func) (void); |
| 4533 | 4554 | ||
| 4534 | /* Deserialize read and return static object. */ | 4555 | /* Deserialize read and return static object. */ |
diff --git a/src/comp.h b/src/comp.h index 687e426b1ef..9270f8bf664 100644 --- a/src/comp.h +++ b/src/comp.h | |||
| @@ -101,6 +101,8 @@ extern void dispose_all_remaining_comp_units (void); | |||
| 101 | 101 | ||
| 102 | extern void clean_package_user_dir_of_old_comp_units (void); | 102 | extern void clean_package_user_dir_of_old_comp_units (void); |
| 103 | 103 | ||
| 104 | extern void fixup_eln_load_path (Lisp_Object directory); | ||
| 105 | |||
| 104 | #else /* #ifdef HAVE_NATIVE_COMP */ | 106 | #else /* #ifdef HAVE_NATIVE_COMP */ |
| 105 | 107 | ||
| 106 | static inline void | 108 | static inline void |
diff --git a/src/pdumper.c b/src/pdumper.c index ca055a1327c..8172389a49b 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -5249,23 +5249,12 @@ dump_do_dump_relocation (const uintptr_t dump_base, | |||
| 5249 | { | 5249 | { |
| 5250 | fclose (file); | 5250 | fclose (file); |
| 5251 | installation_state = INSTALLED; | 5251 | installation_state = INSTALLED; |
| 5252 | /* FIXME Vcomp_eln_load_path = ?? */ | 5252 | fixup_eln_load_path (XCAR (comp_u->file)); |
| 5253 | } | 5253 | } |
| 5254 | else | 5254 | else |
| 5255 | { | 5255 | { |
| 5256 | installation_state = LOCAL_BUILD; | 5256 | installation_state = LOCAL_BUILD; |
| 5257 | /* Fixup `comp-eln-load-path' so emacs can be invoked | 5257 | fixup_eln_load_path (XCDR (comp_u->file)); |
| 5258 | position independently. */ | ||
| 5259 | Lisp_Object eln_cache_sys = | ||
| 5260 | Ffile_name_directory (concat2 (Vinvocation_directory, | ||
| 5261 | XCDR (comp_u->file))); | ||
| 5262 | /* One directory up... */ | ||
| 5263 | eln_cache_sys = | ||
| 5264 | Ffile_name_directory (Fsubstring (eln_cache_sys, Qnil, | ||
| 5265 | make_fixnum (-1))); | ||
| 5266 | /* FIXME for subsequent dumps we should fixup only the | ||
| 5267 | last entry. */ | ||
| 5268 | Vcomp_eln_load_path = Fcons (eln_cache_sys, Qnil); | ||
| 5269 | } | 5258 | } |
| 5270 | } | 5259 | } |
| 5271 | 5260 | ||