elisp: support elisp files in subdirectories properly
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 14 Jul 2012 21:14:45 +0000 (23:14 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 15 Jul 2012 07:52:47 +0000 (09:52 +0200)
For more reference, see:
<http://lists.gnu.org/archive/html/automake/2009-10/msg00013.html>
<http://thread.gmane.org/gmane.comp.sysutils.automake.bugs/4772>

* lib/am/lisp.am (.el.elc): If the file being byte-compiled is in
a subdirectory, add that (both as a subdirectory of the builddir
and the srcdir) to the emacs load path.  While we are at it (and
for consistency), drop quoting of $(srcdir) and $(builddir), since
those variables are ensured (by configure-time checks) not to
contain white space nor shell metacharacters.
* t/list-of-tests.mk (XFAIL_TESTS): Add 't/lisp-subdir.sh' and
't/lisp-subdir2.sh', since they now passes.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/lisp.am
t/list-of-tests.mk

index 582d8f3..b18568b 100644 (file)
@@ -31,8 +31,15 @@ endif %?INSTALL%
 ## input (which would erronously put it in $(srcdir) in VPATH builds),
 ## so we override that, too.
        if test "$(EMACS)" != "no"; then \
+         am__subdir_includes=''; \
+         case $@ in */*) \
+           am__dir=`echo '$@' | sed 's,/[^/]*$$,,'`; \
+           am__subdir_includes="-L $$am__dir -L $(srcdir)/$$am__dir"; \
+         esac; \
+## Emacs byte-compilation won't create this automatically, sadly.
+         test -d $$am__dir || $(MKDIR_P) $$am__dir || exit 1; \
          $(EMACS) -q --batch \
-           -L '$(builddir)' -L '$(srcdir)' \
+           $$am__subdir_includes -L $(builddir) -L $(srcdir) \
            --eval "(defun byte-compile-dest-file (f) \"$@\")" \
            --eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"; \
        else :; fi
index c7d0fad..c0a7572 100644 (file)
@@ -38,8 +38,6 @@ t/override-conditional-2.sh \
 t/dist-pr109765.sh \
 t/instdir-cond2.sh \
 t/java-nobase.sh \
-t/lisp-subdir.sh \
-t/lisp-subdir2.sh \
 t/objext-pr10128.sh \
 t/parallel-tests-many.sh \
 t/pr8365-remake-timing.sh \