Implement working make install for native build.

This commit is contained in:
Andrea Corallo 2020-04-11 13:59:59 +01:00
parent 7f5d1e9aa8
commit 3dd6cf8139
4 changed files with 29 additions and 9 deletions

View file

@ -421,7 +421,8 @@ lib lib-src lisp nt: Makefile
dirstate = .git/logs/HEAD
VCSWITNESS = $(if $(wildcard $(srcdir)/$(dirstate)),$$(srcdir)/../$(dirstate))
src: Makefile
$(MAKE) -C $@ VCSWITNESS='$(VCSWITNESS)' all
$(MAKE) -C $@ VCSWITNESS='$(VCSWITNESS)' BIN_DESTDIR='$(DESTDIR)${bindir}/' \
LISP_DESTDIR='$(DESTDIR)${lispdir}/' all
blessmail: Makefile src
$(MAKE) -C lib-src maybe-blessmail

View file

@ -449,19 +449,32 @@ lost after dumping")))
;; At this point, we're ready to resume undo recording for scratch.
(buffer-enable-undo "*scratch*")
(when (boundp 'comp-ctxt) ; FIXME better native-comp build discriminant?
;; Set the filename for every compilation unit as realtive
;; to obtain a position independent dump.
(let ((h (make-hash-table :test #'eq)))
(when (boundp 'comp-ctxt) ; FIXME better native-comp feature discriminant?
;; Fix the compilation unit filename to have it working when
;; when installed or if the source directory got moved. This is set to be
;; a pair in the form: (rel-path-from-install-bin . rel-path-from-local-bin).
(let ((h (make-hash-table :test #'eq))
(lisp-src-dir (expand-file-name (concat default-directory "../lisp")))
(bin-dest-dir (cadr (member "--bin-dest" command-line-args)))
(lisp-dest-dir (cadr (member "--lisp-dest" command-line-args))))
(mapatoms (lambda (s)
(let ((f (symbol-function s)))
(when (subr-native-elisp-p f)
(puthash (subr-native-comp-unit f) nil h)))))
(maphash (lambda (cu _)
(native-comp-unit-set-file
(native-comp-unit-set-file
cu
(file-relative-name (native-comp-unit-file cu)
invocation-directory)))
(cons
;; Relative path from the installed binary.
(file-relative-name
(concat lisp-dest-dir
(replace-regexp-in-string
(regexp-quote lisp-src-dir) ""
(native-comp-unit-file cu)))
bin-dest-dir)
;; Relative path from the built uninstalled binary.
(file-relative-name (native-comp-unit-file cu)
invocation-directory))))
h)))
(when (hash-table-p purify-flag)

View file

@ -588,7 +588,8 @@ endif
ifeq ($(DUMPING),pdumper)
$(pdmp): emacs$(EXEEXT)
LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=pdump
LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=pdump \
--bin-dest $(BIN_DESTDIR) --lisp-dest $(LISP_DESTDIR)
cp -f $@ $(bootstrap_pdmp)
endif

View file

@ -5298,6 +5298,11 @@ dump_do_dump_relocation (const uintptr_t dump_base,
{
struct Lisp_Native_Comp_Unit *comp_u =
dump_ptr (dump_base, reloc_offset);
if (!CONSP (comp_u->file))
error ("Trying to load incoherent dumped .eln");
comp_u->file =
NILP (Ffile_exists_p (XCAR (comp_u->file)))
? XCDR (comp_u->file) : XCAR (comp_u->file);
comp_u->handle =
dynlib_open (SSDATA (concat2 (Vinvocation_directory, comp_u->file)));
if (!comp_u->handle)