bug#58025: [PATCH] Ensure `byte-compile-dest-file-function' is used

2022-09-23 Thread emacs

The attached `git format-patch` is based on automake v1.16.5 and fixes
the following warning

Warning (bytecomp): byte-compile-dest-file is obsolete (as of 23.2);
Set byte-compile-dest-file-function instead.

The solution is to ensure bytecomp is loaded which defines
byte-compile-dest-file-function so it can be used when available,
and fallback to the original byte-compile-dest-file for earlier
GNU Emacs and XEmacs.

So far I've tested the result on

* CentOS 7.9 (distro emacs 24.3)
* OpenBSD 7.1 (custom emacs 28.2)
* OpenSUSE Leap 15.4 (distro emacs 27.2, xemacs 21.5)

and the warning is no longer generated.From 2cc2732a76823886614724db729dc8e92ae23d9e Mon Sep 17 00:00:00 2001
From: Richard Hopkins <>
Date: Tue, 20 Sep 2022 22:02:32 +0100
Subject: [PATCH] Ensure `byte-compile-dest-file-function' is used when
 available

* lib/am/lisp.am (.el.elc): Require the bytecomp library so
byte-compile-dest-file-function can be used when available.

Without this change the byte compilation check in
am__emacs_byte_compile_setup would always fallback to the deprecated
byte-compile-dest-file instead and then show the following:

Warning (bytecomp): byte-compile-dest-file is obsolete (as of 23.2);
Set byte-compile-dest-file-function instead.

For example, using the original check on Emacs 28.2:

$ emacs --batch --eval \
"(princ (boundp 'byte-compile-dest-file-function))"
=> nil

and using the new check:

$ emacs --batch -l bytecomp --eval \
"(princ (boundp 'byte-compile-dest-file-function))"
=> t
---
 lib/am/lisp.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/am/lisp.am b/lib/am/lisp.am
index 11b5e5842..b40251f62 100644
--- a/lib/am/lisp.am
+++ b/lib/am/lisp.am
@@ -41,6 +41,7 @@ endif %?INSTALL%
 	  $(EMACS) --batch \
 	$(AM_ELCFLAGS) $(ELCFLAGS) \
 	$$am__subdir_includes -L $(builddir) -L $(srcdir) \
+	-l bytecomp \
 	--eval '$(am__emacs_byte_compile_setup)' \
 	-f batch-byte-compile '$<'; \
 	else :; fi
-- 
2.37.3



bug#58026: [PATCH] Emacs .elc byte compilation now respects silent rules

2022-09-23 Thread emacs

Emacs byte compilation now respects silent build rules (e.g. make V=0).

i.e. use AM_V_GEN to show this instead

GEN  bar.elcFrom 08056da08160eb6ea4ba8e2a75a5c78ec8813db5 Mon Sep 17 00:00:00 2001
From: Richard Hopkins <>
Date: Tue, 20 Sep 2022 22:19:42 +0100
Subject: [PATCH] Emacs .elc byte compilation now respects silent rules

* lib/am/lisp.am: Use $(AM_V_GEN) in .el.elc rule.

As the build output now respects silent rules the $(make V=0) output
is clearer and now shows...

GEN  bar.elc
GEN  foo.elc
---
 lib/am/lisp.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/am/lisp.am b/lib/am/lisp.am
index b40251f62..77ada75cf 100644
--- a/lib/am/lisp.am
+++ b/lib/am/lisp.am
@@ -30,7 +30,7 @@ endif %?INSTALL%
 ## The destination file is normally determined by appending "c" to the
 ## input (which would erroneously put it in $(srcdir) in VPATH builds),
 ## so we override that, too.
-	if test '$(EMACS)' != no; then \
+	$(AM_V_GEN)if test '$(EMACS)' != no; then \
 	  am__dir=. am__subdir_includes=''; \
 	  case $@ in */*) \
 	am__dir=`echo '$@' | sed 's,/[^/]*$$,,'`; \
-- 
2.37.3