diff options
| author | Eli Zaretskii | 2023-06-22 14:03:17 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2023-06-22 14:03:17 +0300 |
| commit | e962cf4ba726943b0f4ea57e1d740742e7618e3a (patch) | |
| tree | 6d2eff92ae7eb1839ad84900e467d030750acdce | |
| parent | 4ca371e9cc7178572cc25cbe47371c0075405ff7 (diff) | |
| download | emacs-e962cf4ba726943b0f4ea57e1d740742e7618e3a.tar.gz emacs-e962cf4ba726943b0f4ea57e1d740742e7618e3a.zip | |
Fix building --with-native-compilation=aot from release tarball
* lisp/Makefile.in (%.eln): Pattern rule for AOT native
compilation.
(compile-eln-targets, compile-eln-aot): New targets for AOT native
compilation.
* src/Makefile.in (../native-lisp): If NATIVE_COMPILATION_AOT is
set, also native-compile all the other Lisp files.
(Bug#64167)
| -rw-r--r-- | lisp/Makefile.in | 36 | ||||
| -rw-r--r-- | src/Makefile.in | 8 |
2 files changed, 44 insertions, 0 deletions
diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 1e0935f565f..0a534a278f7 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in | |||
| @@ -436,6 +436,42 @@ ifeq ($(HAVE_NATIVE_COMP),yes) | |||
| 436 | $(emacs) -l comp -f comp-compile-all-trampolines | 436 | $(emacs) -l comp -f comp-compile-all-trampolines |
| 437 | endif | 437 | endif |
| 438 | 438 | ||
| 439 | .PHONY: compile-eln-targets compile-eln-aot | ||
| 440 | |||
| 441 | # ELNDONE is defined by ../src/Makefile, as the list of preloaded | ||
| 442 | # *.eln files, which are therefore already compiled by the time | ||
| 443 | # compile-eln-aot is called. | ||
| 444 | ifeq ($(NATIVE_COMPILATION_AOT),yes) | ||
| 445 | %.eln: %.el | ||
| 446 | $(AM_V_ELN)$(emacs) $(BYTE_COMPILE_FLAGS) \ | ||
| 447 | -l comp -f byte-compile-refresh-preloaded \ | ||
| 448 | --eval '(batch-native-compile t)' $< | ||
| 449 | |||
| 450 | compile-eln-targets: $(filter-out $(ELNDONE),$(TARGETS)) | ||
| 451 | else | ||
| 452 | compile-eln-targets: | ||
| 453 | endif | ||
| 454 | |||
| 455 | # This is called from ../src/Makefile when building a release tarball | ||
| 456 | # configured --with-native-compilation=aot. | ||
| 457 | compile-eln-aot: | ||
| 458 | @(cd $(lisp) && \ | ||
| 459 | els=`echo "${SUBDIRS_REL} " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ | ||
| 460 | for el in $$els; do \ | ||
| 461 | test -f $$el || continue; \ | ||
| 462 | test -f $${el}c || continue; \ | ||
| 463 | GREP_OPTIONS= grep '^;.*[^a-zA-Z]no-byte-compile: *t' $$el > /dev/null && \ | ||
| 464 | continue; \ | ||
| 465 | GREP_OPTIONS= grep '^;.*[^a-zA-Z]no-native-compile: *t' $$el > /dev/null && \ | ||
| 466 | continue; \ | ||
| 467 | echo "$${el}n"; \ | ||
| 468 | done | xargs $(XARGS_LIMIT) echo) | \ | ||
| 469 | while read chunk; do \ | ||
| 470 | $(MAKE) compile-eln-targets \ | ||
| 471 | TARGETS="$$chunk" ELNDONE="$(ELNDONE)"; \ | ||
| 472 | done | ||
| 473 | |||
| 474 | |||
| 439 | .PHONY: backup-compiled-files compile-after-backup | 475 | .PHONY: backup-compiled-files compile-after-backup |
| 440 | 476 | ||
| 441 | # Backup compiled Lisp files in elc.tar.gz. If that file already | 477 | # Backup compiled Lisp files in elc.tar.gz. If that file already |
diff --git a/src/Makefile.in b/src/Makefile.in index c29c3750e59..9bc53c072ea 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -872,6 +872,11 @@ elnlisp := $(addprefix ${lispsource}/,${elnlisp}) $(lisp:.elc=.eln) | |||
| 872 | ## native-lisp where the *.eln files will be produced, and the exact | 872 | ## native-lisp where the *.eln files will be produced, and the exact |
| 873 | ## names of those *.eln files, cannot be known in advance; we must ask | 873 | ## names of those *.eln files, cannot be known in advance; we must ask |
| 874 | ## Emacs to produce them. | 874 | ## Emacs to produce them. |
| 875 | ## If AOT native compilation is requested, we additionally | ||
| 876 | ## native-compile all the *.el files in ../lisp that need to be | ||
| 877 | ## compiled and haven't yet been compiled. ELDONE holds the list | ||
| 878 | ## of *.el files that were already native-compiled. | ||
| 879 | NATIVE_COMPILATION_AOT = @NATIVE_COMPILATION_AOT@ | ||
| 875 | ../native-lisp: | $(pdmp) | 880 | ../native-lisp: | $(pdmp) |
| 876 | @if test ! -d $@; then \ | 881 | @if test ! -d $@; then \ |
| 877 | mkdir $@ && $(MAKE) $(AM_V_NO_PD) $(elnlisp); \ | 882 | mkdir $@ && $(MAKE) $(AM_V_NO_PD) $(elnlisp); \ |
| @@ -882,6 +887,9 @@ elnlisp := $(addprefix ${lispsource}/,${elnlisp}) $(lisp:.elc=.eln) | |||
| 882 | --bin-dest $(BIN_DESTDIR) --eln-dest $(ELN_DESTDIR) \ | 887 | --bin-dest $(BIN_DESTDIR) --eln-dest $(ELN_DESTDIR) \ |
| 883 | && cp -f emacs$(EXEEXT) bootstrap-emacs$(EXEEXT) \ | 888 | && cp -f emacs$(EXEEXT) bootstrap-emacs$(EXEEXT) \ |
| 884 | && cp -f $(pdmp) $(bootstrap_pdmp); \ | 889 | && cp -f $(pdmp) $(bootstrap_pdmp); \ |
| 890 | if test $(NATIVE_COMPILATION_AOT) = yes; then \ | ||
| 891 | $(MAKE) $(AM_V_NO_PD) -C ../lisp compile-eln-aot EMACS="../src/emacs$(EXEEXT)" ELNDONE="$(addprefix %,$(notdir $(elnlisp))))"; \ | ||
| 892 | fi; \ | ||
| 885 | fi | 893 | fi |
| 886 | endif | 894 | endif |
| 887 | 895 | ||