Make the build of source tarball produce *.eln files

* lisp/emacs-lisp/comp.el (batch-native-compile): Accept an
optional argument; if non-nil, place the .eln file as appropriate
for building a source tarball.

* doc/lispref/compile.texi (Native-Compilation Functions):
Document the new optional argument of 'batch-native-compile'.

* lisp/Makefile.in (.PHONY, $(THEFILE)n) [HAVE_NATIVE_COMP]: New
targets.

* src/Makefile.in (%.eln) [HAVE_NATIVE_COMP]: New recipe.
(all) [HAVE_NATIVE_COMP]: Add ../native-lisp to prerequisites.
(elnlisp) [HAVE_NATIVE_COMP]: New list of *.eln files.
(../native-lisp) [HAVE_NATIVE_COMP]: New recipe.

* src/verbose.mk.in (AM_V_ELN): New macro.
This commit is contained in:
Eli Zaretskii 2021-09-28 15:00:50 +03:00
parent b02a7ad263
commit 90655e4bc0
5 changed files with 77 additions and 11 deletions

View file

@ -4191,20 +4191,27 @@ form, return the compiled function."
(comp--native-compile function-or-file nil output))
;;;###autoload
(defun batch-native-compile ()
(defun batch-native-compile (&optional for-tarball)
"Perform batch native compilation of remaining command-line arguments.
Native compilation equivalent of `batch-byte-compile'.
Use this from the command line, with -batch; it wont work
in an interactive Emacs session."
in an interactive Emacs session.
Optional argument FOR-TARBALL non-nil means the file being compiled
as part of building the source tarball, in which case the .eln file
will be placed under the native-lisp/ directory (actually, in the
last directory in `native-comp-eln-load-path')."
(comp-ensure-native-compiler)
(cl-loop for file in command-line-args-left
if (or (null byte+native-compile)
(cl-notany (lambda (re) (string-match re file))
native-comp-bootstrap-deny-list))
do (comp--native-compile file)
else
do (byte-compile-file file)))
(let ((native-compile-target-directory
(if for-tarball
(car (last native-comp-eln-load-path)))))
(cl-loop for file in command-line-args-left
if (or (null byte+native-compile)
(cl-notany (lambda (re) (string-match re file))
native-comp-bootstrap-deny-list))
do (comp--native-compile file)
else
do (byte-compile-file file))))
;;;###autoload
(defun batch-byte+native-compile ()