From: Alexandre Duret-Lutz Date: Tue, 21 Oct 2003 16:29:04 +0000 (+0000) Subject: * m4/lispdir.m4 (AM_PATH_LISPDIR): Always check for Emacs. X-Git-Tag: Release-1-7b~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44784989cab68201bef7b36c6982ed15959f5f49;p=thirdparty%2Fautomake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index adee96c1d..79590306a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2003-10-21 Alexandre Duret-Lutz + * 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 7009a8159..e9babbf3f 100644 --- 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 diff --git a/doc/automake.texi b/doc/automake.texi index 8ea81d30d..b226615ee 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -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 diff --git a/doc/stamp-vti b/doc/stamp-vti index 0d7e10826..7303ba426 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -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 diff --git a/doc/version.texi b/doc/version.texi index 0d7e10826..7303ba426 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -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 diff --git a/lib/am/lisp.am b/lib/am/lisp.am index daea72ef6..f7d5d5906 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -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"; \ diff --git a/m4/lispdir.m4 b/m4/lispdir.m4 index 5ef871731..74aac3cb9 100644 --- a/m4/lispdir.m4 +++ b/m4/lispdir.m4 @@ -27,7 +27,10 @@ # 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 diff --git a/tests/lisp4.test b/tests/lisp4.test index 6ae43a37b..dc950b3d6 100755 --- a/tests/lisp4.test +++ b/tests/lisp4.test @@ -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 diff --git a/tests/lisp5.test b/tests/lisp5.test index c354b8859..edecbcc94 100755 --- a/tests/lisp5.test +++ b/tests/lisp5.test @@ -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