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
;; 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)
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
{
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)