;; At this point, we're ready to resume undo recording for scratch.
(buffer-enable-undo "*scratch*")
-(defvar comp-subr-arities-h)
-(when (featurep 'native-compile)
- ;; Save the arity for all primitives so the compiler can always
- ;; retrive it even in case of redefinition.
- (mapatoms (lambda (f)
- (when (subr-primitive-p (symbol-function f))
- (puthash f (func-arity f) comp-subr-arities-h))))
- ;; Fix the compilation unit filename to have it working when
- ;; installed or if the source directory got moved. This is set to be
- ;; a pair in the form of:
- ;; (rel-filename-from-install-bin . rel-filename-from-local-bin).
- (let ((bin-dest-dir (cadr (member "--bin-dest" command-line-args)))
- (eln-dest-dir (cadr (member "--eln-dest" command-line-args))))
- (when (and bin-dest-dir eln-dest-dir)
- (setq eln-dest-dir
- (concat eln-dest-dir "native-lisp/" comp-native-version-dir "/"))
- (maphash (lambda (_ cu)
+(defvar load--bin-dest-dir nil
+ "Store the original value passed by \"--bin-dest\" during dump.
+Internal use only.")
+(defvar load--eln-dest-dir nil
+ "Store the original value passed by \"--eln-dest\" during dump.
+Internal use only.")
+
+(defun load--fixup-all-elns ()
+ "Fix all compilation unit filename.
+This to have it working when installed or if Emacs source
+directory got moved. This is set to be a pair in the form of:
+\(rel-filename-from-install-bin . rel-filename-from-local-bin)."
+ (when (and load--bin-dest-dir load--eln-dest-dir)
+ (setq eln-dest-dir
+ (concat load--eln-dest-dir "native-lisp/" comp-native-version-dir "/"))
+ (maphash (lambda (_ cu)
+ (when (stringp (native-comp-unit-file cu))
(let* ((file (native-comp-unit-file cu))
(preloaded (equal (substring (file-name-directory file)
-10 -1)
(file-name-nondirectory
file)
eln-dest-dir-eff)
- bin-dest-dir)
+ load--bin-dest-dir)
;; Relative filename from the built uninstalled binary.
- (file-relative-name file invocation-directory)))))
- comp-loaded-comp-units-h)))
+ (file-relative-name file invocation-directory))))))
+ comp-loaded-comp-units-h)))
+
+(defvar comp-subr-arities-h)
+(when (featurep 'native-compile)
+ ;; Save the arity for all primitives so the compiler can always
+ ;; retrive it even in case of redefinition.
+ (mapatoms (lambda (f)
+ (when (subr-primitive-p (symbol-function f))
+ (puthash f (func-arity f) comp-subr-arities-h))))
+ (setq load--bin-dest-dir (cadr (member "--bin-dest" command-line-args)))
+ (setq load--eln-dest-dir (cadr (member "--eln-dest" command-line-args)))
;; Set up the mechanism to allow inhibiting native-comp via
;; file-local variables.
(defvar comp--no-native-compile (make-hash-table :test #'equal)))
{
struct Lisp_Native_Comp_Unit *cu = XNATIVE_COMP_UNIT (obj);
print_c_string ("#<native compilation unit: ", printcharfun);
- print_string (cu->file, printcharfun);
+ print_object (cu->file, printcharfun, escapeflag);
printchar (' ', printcharfun);
print_object (cu->optimize_qualities, printcharfun, escapeflag);
printchar ('>', printcharfun);