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.
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.
(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
@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
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
-@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
-@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
?!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.
.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"; \
# 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])
# 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"
-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
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
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'
$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
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
$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