* m4/lispdir.m4 (AM_PATH_LISPDIR): Always check for Emacs.
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 21 Oct 2003 16:29:04 +0000 (16:29 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 21 Oct 2003 16:29:04 +0000 (16:29 +0000)
Always define lispdir.
* lib/am/lisp.am (install-%DIR%LISP, uninstall-%DIR%LISP): Check
$(EMACS) to decide whether _LISP files must be installed,
not $(lispdir).
* doc/automake.texi (Emacs Lisp): Mention the two ways to install
non byte-compiled Emacs lisp files.
* tests/lisp4.test, tests/lisp5.test: Check "make install"
when EMACS=no.
Suggested by Simon Josefsson.

ChangeLog
NEWS
doc/automake.texi
doc/stamp-vti
doc/version.texi
lib/am/lisp.am
m4/lispdir.m4
tests/lisp4.test
tests/lisp5.test

index adee96c..7959030 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2003-10-21  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * m4/lispdir.m4 (AM_PATH_LISPDIR): Always check for Emacs.
+       Always define lispdir.
+       * lib/am/lisp.am (install-%DIR%LISP, uninstall-%DIR%LISP): Check
+       $(EMACS) to decide whether _LISP files must be installed,
+       not $(lispdir).
+       * doc/automake.texi (Emacs Lisp): Mention the two ways to install
+       non byte-compiled Emacs lisp files.
+       * tests/lisp4.test, tests/lisp5.test: Check "make install"
+       when EMACS=no.
+       Suggested by Simon Josefsson.
+
        * NEWS: Clarify the entry about multiple conditional definitions
        of _PROGRAMS, _LDADD, and _LIBADD.
        Report from Simon Josefsson.
diff --git a/NEWS b/NEWS
index 7009a81..e9babbf 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -102,12 +102,14 @@ New in 1.7a:
     (Former versions would try to use only the first of the input
     files.)
 
-* Obsolete features
-
   - lisp_DATA is now allowed.  If you are using the empty ELCFILES
     idiom to disable byte-compilation of lisp_LISP files, it is
-    recommended that you switch to using lisp_DATA.  ELCFILES is no
-    longer documented.
+    recommended that you switch to using lisp_DATA.  Note that
+    this is not strictly equivalent: lisp_DATA will install elisp
+    files even if emacs is not installed, while *_LISP do not
+    install anything unless emacs is found.
+
+* Obsolete features
 
   - AM_PROG_CC_STDC is now empty.  The content of this macro was
     merged in AC_PROG_CC.  If your code uses $am_cv_prog_cc_stdc, you
index 8ea81d3..b226615 100644 (file)
@@ -4357,9 +4357,7 @@ primary are @samp{lisp_} and @samp{noinst_}.  Note that if
 @code{AM_PATH_LISPDIR} (@pxref{Macros}).
 
 Automake will byte-compile all Emacs Lisp source files using the Emacs
-found by @code{AM_PATH_LISPDIR}, if any was found.  If you wish to
-avoid byte-compiling, use @code{lisp_DATA} instead of
-@code{lisp_LISP}.
+found by @code{AM_PATH_LISPDIR}, if any was found.
 
 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
@@ -4369,6 +4367,28 @@ that you byte-compile your Emacs Lisp sources.  It is probably better
 for sites with strange setups to cope for themselves than to make the
 installation less nice for everybody else.
 
+There are two ways to avoid byte-compiling.  Historically, we have
+recommended the following construct.
+@example
+lisp_LISP = file1.el file2.el
+ELCFILES =
+@end example
+@noindent
+@code{ELCFILES} is an internal Automake variables that normally lists
+all @file{.elc} files that must be byte-compiled.  Automake defines
+@code{ELCFILES} automatically from @code{lisp_LISP}.  Emptying this
+variables explicitly prevents byte-compilation to occur.
+
+Since Automake 1.8, we now recommend using @code{lisp_DATA} instead.  As
+in
+@example
+lisp_DATA = file1.el file2.el
+@end example
+
+Note that these two constructs are not equivalent.  @code{_LISP} will
+not install a file if Emacs is not installed, while @code{_DATA} will
+always install its files.
+
 @node gettext
 @section Gettext
 
index 0d7e108..7303ba4 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 30 September 2003
-@set UPDATED-MONTH September 2003
+@set UPDATED 21 October 2003
+@set UPDATED-MONTH October 2003
 @set EDITION 1.7a
 @set VERSION 1.7a
index 0d7e108..7303ba4 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 30 September 2003
-@set UPDATED-MONTH September 2003
+@set UPDATED 21 October 2003
+@set UPDATED-MONTH October 2003
 @set EDITION 1.7a
 @set VERSION 1.7a
index daea72e..f7d5d59 100644 (file)
@@ -58,8 +58,8 @@ am__installdirs += $(DESTDIR)$(%NDIR%dir)
 ?!EXEC?.PHONY install-data-am: install-%DIR%LISP
 install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES)
        @$(NORMAL_INSTALL)
-## lispdir might not be defined.
-       @if test -n "$(lispdir)"; then \
+## Do not install anything if EMACS was not found.
+       @if test "$(EMACS)" != no; then \
          $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir); \
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
@@ -88,8 +88,8 @@ if %?INSTALL%
 .PHONY uninstall-am: uninstall-%DIR%LISP
 uninstall-%DIR%LISP:
        @$(NORMAL_UNINSTALL)
-## lispdir might not be defined.
-       @if test -n "$(lispdir)"; then \
+## Do not uninstall anything if EMACS was not found.
+       @if test "$(EMACS)" != no; then \
          list='$(%DIR%_LISP)'; for p in $$list; do \
 ?BASE?     f="`echo $$p | sed -e 's|^.*/||'`"; \
 ?!BASE?            f="$$p"; \
index 5ef8717..74aac3c 100644 (file)
 # AM_PATH_LISPDIR
 # ---------------
 AC_DEFUN([AM_PATH_LISPDIR],
-[AC_ARG_WITH([lispdir],
+[AC_CHECK_PROGS([EMACS], [emacs xemacs], [no])
+ AC_ARG_VAR([EMACS], [the Emacs editor command])
+ AC_ARG_VAR([EMACSLOADPATH], [the Emacs library search path])
+ AC_ARG_WITH([lispdir],
  [  --with-lispdir          Override the default lisp directory ],
  [ lispdir="$withval"
    AC_MSG_CHECKING([where .elc files should go])
@@ -36,13 +39,10 @@ AC_DEFUN([AM_PATH_LISPDIR],
  # If set to t, that means we are running in a shell under Emacs.
  # If you have an Emacs named "t", then use the full path.
  test x"$EMACS" = xt && EMACS=
- AC_CHECK_PROGS([EMACS], [emacs xemacs], [no])
- AC_ARG_VAR([EMACS], [the Emacs editor command])
- AC_ARG_VAR([EMACSLOADPATH], [the Emacs library search path])
- if test $EMACS != "no"; then
-   if test x${lispdir+set} != xset; then
-     AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir],
-       [# If $EMACS isn't GNU Emacs or XEmacs, this can blow up pretty badly
+ AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [
+   if test $EMACS != "no"; then
+     if test x${lispdir+set} != xset; then
+  # If $EMACS isn't GNU Emacs or XEmacs, this can blow up pretty badly
   # Some emacsen will start up in interactive mode, requiring C-x C-c to exit,
   #  which is non-obvious for non-emacs users.
   # Redirecting /dev/null should help a bit; pity we can't detect "broken"
@@ -54,13 +54,11 @@ AC_DEFUN([AM_PATH_LISPDIR],
        -e '/.*\/share\/x\?emacs\/site-lisp$/{s,.*/share/\(x\?emacs/site-lisp\),${datadir}/\1,;p;q;}' \
        conftest.out`
        rm conftest.out
-       if test -z "$am_cv_lispdir"; then
-        am_cv_lispdir='${datadir}/emacs/site-lisp'
-       fi
-     ])
-     lispdir="$am_cv_lispdir"
+     fi
    fi
- fi
+   test -z "$am_cv_lispdir" && am_cv_lispdir='${datadir}/emacs/site-lisp'
+  ])
+  lispdir="$am_cv_lispdir"
 ])
 AC_SUBST([lispdir])
 ])# AM_PATH_LISPDIR
index 6ae43a3..dc950b3 100755 (executable)
@@ -34,6 +34,12 @@ am-three.el:
        echo "(provide 'am-three)" > $@
 CLEANFILES = am-three.el
 
+test:
+       test ! -f am-one.elc
+       test ! -f am-two.elc
+       test ! -f am-three.elc
+       test ! -f elc-stamp
+
 install-test: install
        test -f $(lispdir)/am-one.el
        test -f $(lispdir)/am-two.el
@@ -41,6 +47,14 @@ install-test: install
        test ! -f $(lispdir)/am-one.elc
        test ! -f $(lispdir)/am-two.elc
        test ! -f $(lispdir)/am-three.elc
+
+install-test2: install
+       test ! -f $(lispdir)/am-one.el
+       test ! -f $(lispdir)/am-two.el
+       test ! -f $(lispdir)/am-three.el
+       test ! -f $(lispdir)/am-one.elc
+       test ! -f $(lispdir)/am-two.elc
+       test ! -f $(lispdir)/am-three.elc
 EOF
 
 cat >> configure.in << 'EOF'
@@ -55,13 +69,16 @@ echo "(require 'am-three) (provide 'am-two)" > am-two.el
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
-./configure --prefix "`pwd`"
 
+./configure --prefix "`pwd`"
 $MAKE
-
-test ! -f am-one.elc
-test ! -f am-two.elc
-test ! -f am-three.elc
-test ! -f elc-stamp
-
+$MAKE test
 $MAKE install-test
+$MAKE uninstall
+
+# Fake the absence of emacs.
+# *.el files should not be installed.
+./configure EMACS=no --prefix "`pwd`"
+$MAKE
+$MAKE test
+$MAKE install-test2
index c354b88..edecbcc 100755 (executable)
@@ -33,6 +33,12 @@ am-three.el:
        echo "(provide 'am-three)" > $@
 CLEANFILES = am-three.el
 
+test:
+       test ! -f am-one.elc
+       test ! -f am-two.elc
+       test ! -f am-three.elc
+       test ! -f elc-stamp
+
 install-test: install
        test -f $(lispdir)/am-one.el
        test -f $(lispdir)/am-two.el
@@ -54,13 +60,16 @@ echo "(require 'am-three) (provide 'am-two)" > am-two.el
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
-./configure --prefix "`pwd`"
 
+./configure --prefix "`pwd`"
 $MAKE
+$MAKE test
+$MAKE install-test
+$MAKE uninstall
 
-test ! -f am-one.elc
-test ! -f am-two.elc
-test ! -f am-three.elc
-test ! -f elc-stamp
-
+# Fake the absence of emacs.
+# *.el files SHOULD be installed.
+./configure EMACS=no --prefix "`pwd`"
+$MAKE
+$MAKE test
 $MAKE install-test