]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
elisp: honour AM_ELCFLAFS and ELCFLAGS in byte-compilation
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 4 Aug 2012 12:56:27 +0000 (14:56 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 4 Aug 2012 13:12:20 +0000 (15:12 +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 <stefano.lattarini@gmail.com>
doc/automake.texi
lib/am/lisp.am
t/lisp-flags.sh [new file with mode: 0755]
t/list-of-tests.mk

index a34b40151907195cc2ed78e4311836a937d59cbc..d2bc574e54f4dd26efc3aa36cb95a5268ba4a48f 100644 (file)
@@ -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)
+@code{AM_ELCFLAGS} 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
index 36b124382b36ed62903e5de4f9e476bd0f60ec8d..fc3575b8581bc8de95f40115cc4a282614daf215 100644 (file)
@@ -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) \"$@\")" \
            --eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"; \
diff --git a/t/lisp-flags.sh b/t/lisp-flags.sh
new file mode 100755 (executable)
index 0000000..1d7d8f3
--- /dev/null
@@ -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
+
+:
index c0a75728c568e9789cf445c4c6e1043aa206cc64..84fc61ceff8c20cacebd8c2d11ae29ad5adeb999 100644 (file)
@@ -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 \