[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-NG] [FYI] {elisp-work} elisp: honour AM_ELCFLAFS and ELCFLAGS
From: |
Stefano Lattarini |
Subject: |
[Automake-NG] [FYI] {elisp-work} elisp: honour AM_ELCFLAFS and ELCFLAGS in byte-compilation |
Date: |
Sat, 4 Aug 2012 15:48:38 +0200 |
* lib/am/lisp.am (.el.elc): Add "$(AM_ELCFLAFS) $(ELCFLAGS)"
to the emacs command line.
* t/lisp-flags.sh: New test.
* t/list-of-tests.mk: Add it.
* doc/automake.texi (Emacs Lisp): Update.
Signed-off-by: Stefano Lattarini <address@hidden>
---
doc/automake.texi | 5 ++++-
lib/am/lisp.am | 1 +
t/lisp-flags.sh | 41 +++++++++++++++++++++++++++++++++++++++++
t/list-of-tests.mk | 1 +
4 files changed, 47 insertions(+), 1 deletion(-)
create mode 100755 t/lisp-flags.sh
diff --git a/doc/automake.texi b/doc/automake.texi
index a34b401..d2bc574 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -7469,7 +7469,10 @@ Lisp sources are not distributed by default. You can
prefix the
distributed.
Automake will byte-compile all Emacs Lisp source files using the Emacs
-found by @code{AM_PATH_LISPDIR}, if any was found.
+found by @code{AM_PATH_LISPDIR}, if any was found. When performing such
+byte-compilation, the flags specified in the (developer-reserved)
address@hidden and (user-reserved) @code{ELCFLAGS} make variables
+will be passed to the Emacs invocation.
Byte-compiled Emacs Lisp files are not portable among all versions of
Emacs, so it makes sense to turn this off if you expect sites to have
diff --git a/lib/am/lisp.am b/lib/am/lisp.am
index 36b1243..fc3575b 100644
--- a/lib/am/lisp.am
+++ b/lib/am/lisp.am
@@ -39,6 +39,7 @@ endif %?INSTALL%
## Emacs byte-compilation won't create this automatically, sadly.
test -d $$am__dir || $(MKDIR_P) $$am__dir || exit 1; \
$(EMACS) --batch \
+ $(AM_ELCFLAGS) $(ELCFLAGS) \
$$am__subdir_includes -L $(builddir) -L $(srcdir) \
--eval "(defun byte-compile-dest-file (f) \"address@hidden")" \
--eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"; \
diff --git a/t/lisp-flags.sh b/t/lisp-flags.sh
new file mode 100755
index 0000000..1d7d8f3
--- /dev/null
+++ b/t/lisp-flags.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Elisp byte-compilation honours AM_ELCFLAFS and ELCFLAGS.
+
+. ./defs || exit 1
+
+cat > Makefile.am << 'EOF'
+lisp_LISP = foo.el
+AM_ELCFLAGS = __am_elcflags__
+EOF
+
+cat >> configure.ac << 'EOF'
+AM_PATH_LISPDIR
+AC_OUTPUT
+EOF
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure EMACS='echo >$@' --with-lispdir="$(pwd)/unused"
+
+: > foo.el
+ELCFLAGS='__usr_elcflags__' $MAKE -e
+grep '__am_elcflags__.*__usr_elcflags__' foo.elc
+
+:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index c0a7572..84fc61c 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -635,6 +635,7 @@ t/lisp-subdir.sh \
t/lisp-subdir2.sh \
t/lispdry.sh \
t/lisp-pr11806.sh \
+t/lisp-flags.sh \
t/listval.sh \
t/location.sh \
t/longline.sh \
--
1.7.12.rc0
- [Automake-NG] [FYI] {elisp-work} elisp: honour AM_ELCFLAFS and ELCFLAGS in byte-compilation,
Stefano Lattarini <=