From: Alexandre Duret-Lutz Date: Sun, 1 Feb 2004 12:54:02 +0000 (+0000) Subject: Support for conditional _LISP. X-Git-Tag: Release-1-8b~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5bf5b1c8c791668421ac616f5ee37c890a11a59;p=thirdparty%2Fautomake.git Support for conditional _LISP. * automake.in (handle_emacs_lisp): Define $(ELCFILES) from LISP, not from $(am__ELCFILES). * lib/am/lisp.am (elc-stamp): Use $(LISP) instead of $(am__ELFILES). * tests/lisp6.test: New file. * tests/Makefile.am (TESTS): Add it. --- diff --git a/ChangeLog b/ChangeLog index fa0676d2f..c6890dbd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-02-01 Alexandre Duret-Lutz + Support for conditional _LISP. + * automake.in (handle_emacs_lisp): Define $(ELCFILES) from LISP, not + from $(am__ELCFILES). + * lib/am/lisp.am (elc-stamp): Use $(LISP) instead of $(am__ELFILES). + * tests/lisp6.test: New file. + * tests/Makefile.am (TESTS): Add it. + * automake.in (handle_emacs_lisp): Define $(ELCFILES) as $(am__ELCFILES), and always push it on @all. Do not mention elc-stamp. diff --git a/NEWS b/NEWS index 50f38c97d..e90e9a44d 100644 --- a/NEWS +++ b/NEWS @@ -17,13 +17,7 @@ New in 1.8a: the two .o and .obj rules for usual objects, or the .lo rule for libtool objects. -* Bug fixes. - - - Distribute all files, even those which are built and installed - conditionally. This change affects files listed in conditionally - defined *_HEADERS and *_PYTHON variable (unless they are nodist_*) - as well as those listed in conditionally defined dist_*_DATA, - dist_*_JAVA, dist_*_LISP, and dist_*_SCRIPTS variables. +* Support for conditional _LISP. New in 1.8: diff --git a/automake.in b/automake.in index c383d69c5..f22cffc88 100755 --- a/automake.in +++ b/automake.in @@ -4333,7 +4333,7 @@ sub handle_emacs_lisp define_pretty_variable ('am__ELCFILES', TRUE, INTERNAL, '$(am__ELFILES:.el=.elc)'); # This one can be overridden by users. - define_pretty_variable ('ELCFILES', TRUE, INTERNAL, '$(am__ELCFILES)'); + define_pretty_variable ('ELCFILES', TRUE, INTERNAL, '$(LISP:.el=.elc)'); push @all, '$(ELCFILES)'; diff --git a/lib/am/lisp.am b/lib/am/lisp.am index a9232a8a2..840df01cb 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -25,7 +25,7 @@ endif %?INSTALL% ## Building. ## ## ---------- ## -elc-stamp: $(am__ELFILES) +elc-stamp: $(LISP) @echo 'WARNING: Warnings can be ignored. :-)' @rm -f elc-temp && touch elc-temp if test "$(EMACS)" != no; then \ @@ -33,7 +33,7 @@ elc-stamp: $(am__ELFILES) set x; \ ## Populate "$@" with elisp files (found in the current directory ## or in $srcdir). - list='$(am__ELFILES)'; for p in $$list; do \ + list='$(LISP)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ set x "$$@" "$$d$$p"; shift; \ done; \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 3c86a6b62..91f017462 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -292,6 +292,7 @@ lisp2.test \ lisp3.test \ lisp4.test \ lisp5.test \ +lisp6.test \ listval.test \ location.test \ ltcond.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index ad56ddd11..75145f458 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -65,6 +65,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ FGREP = @FGREP@ +GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -406,6 +407,7 @@ lisp2.test \ lisp3.test \ lisp4.test \ lisp5.test \ +lisp6.test \ listval.test \ location.test \ ltcond.test \ diff --git a/tests/lisp6.test b/tests/lisp6.test new file mode 100755 index 000000000..0b415a60c --- /dev/null +++ b/tests/lisp6.test @@ -0,0 +1,100 @@ +#! /bin/sh +# Copyright (C) 2004 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake 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. +# +# GNU Automake 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 GNU Automake; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Test for conditional _LISP. + +required=emacs +. ./defs || exit 1 + +set -e + +cat > Makefile.am << 'EOF' +dist_lisp_LISP = am-one.el +if WANT_TWO + dist_lisp_LISP += am-two.el +endif +dist_noinst_LISP = am-three.el + +dist-test: distdir + test -f $(distdir)/am-one.el + test -f $(distdir)/am-two.el + test -f $(distdir)/am-three.el +EOF + +cat >> configure.in << 'EOF' +AM_CONDITIONAL([WANT_TWO], test -n "$want_two") +AM_PATH_LISPDIR +AC_OUTPUT +EOF + +echo "(provide 'am-one)" > am-one.el +echo "(require 'am-one)" > am-two.el +echo "(require 'am-one)" > am-three.el + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing +./configure --with-lispdir=`pwd`/lisp + +$MAKE +test -f am-one.elc +test ! -f am-two.elc +test -f am-three.elc +test -f elc-stamp + +$MAKE install +test -f lisp/am-one.el +test -f lisp/am-one.elc +test ! -f lisp/am-two.el +test ! -f lisp/am-two.elc +test ! -f lisp/am-three.el +test ! -f lisp/am-three.elc + +$MAKE dist-test + +$MAKE distclean +test ! -f am-one.elc +test ! -f am-two.elc +test ! -f am-three.elc +test ! -f elc-stamp + + +./configure --with-lispdir=`pwd`/lisp want_two=1 +$MAKE +test -f am-one.elc +test -f am-two.elc +test -f am-three.elc +test -f elc-stamp + +$MAKE install +test -f lisp/am-one.el +test -f lisp/am-one.elc +test -f lisp/am-two.el +test -f lisp/am-two.elc +test ! -f lisp/am-three.el +test ! -f lisp/am-three.elc + +$MAKE dist-test + +$MAKE distclean +test ! -f am-one.elc +test ! -f am-two.elc +test ! -f am-three.elc +test ! -f elc-stamp