Hello,

On Sun, Apr 09, 2006 at 11:43:11AM -0700, Noah Misch wrote:
> [...] invalid.  Sorry for that.

No problem.

> Most of this patch has nothing to do with the original goal of avoiding some
> spurious `testsuite' rebuilds, [...]

Yes, you are right.  There are two changes:
 1) mktests.sh is no longer a maintainer tool, thus $(TESTSUITE_GENERATED_AT)
    are no longer distributed,
 2) avoid spurious rebuilds.

But I realized this too late, so I left it as a combined patch.

> They do expose folks who simply want to run the test suite of an unmodified
> Autoconf to any portability problems in `mktests.sh'.

I understand that mktests.sh is no longer considered maintainer-only, so this
should be OK.

> > --- tests/Makefile.am       9 Apr 2006 11:36:08 -0000       1.100
> > +++ tests/Makefile.am       9 Apr 2006 14:01:41 -0000
> 
> > -DISTCLEANFILES = atconfig atlocal $(TESTSUITE)
> > -MAINTAINERCLEANFILES = Makefile.in
> > +DISTCLEANFILES = atconfig atlocal $(TESTSUITE) $(TESTSUITE_GENERATED_AT)
> 
> While you're changing it, $(TESTSUITE) and $(TESTSUITE_GENERATED_AT) belong in
> MOSTLYCLEANFILES, not DISTCLEANFILES.

In theory, you might be right, because they are not created at configure time.

But there are two reasons why I decided to put them here:

1) I thought their cleanup could be ``delayed'' until distclean because they
are expensive and not platform dependent.

2) clean-local calls `./testsuite --clean' so you cannot put ./testsuite
to CLEANFILES.  You can add `rm -f ./testsuite' to clean-local, though.
For the same reason `make mostlyclean' cannot remove it; a subsequent
`make clean' wouldn't work then.

Before we hear from others, I'm leaving it in `make distclean'.

> > +$(TESTSUITE): $(TESTSUITE_dependencies) $(AUTOCONF_FILES)
> > +   $(srcdir)/mktests.sh $(AUTOCONF_FILES)
> > +   mv $@ [EMAIL PROTECTED]
> 
> This needs to be `if test -f $@; then mv $@ [EMAIL PROTECTED]; fi' or 
> similar, for when
> $(TESTSUITE) does not exist.

Sure, thanks for catching this.

> > --- tests/mktests.sh        8 Apr 2006 21:44:13 -0000       1.53
> > +++ tests/mktests.sh        9 Apr 2006 14:01:41 -0000
> 
> > +   diff ac$base.at ac$base.tat || :
> 
> This line was a debugging aid; delete it.

Done.
Moreover I made the change discussed elsewhere that mktests.sh should
fail in the created *.at file happens to be empty.

Attached please find an updated version of the patch.

Have a nice day,
        Stepan
2006-04-10  Noah Misch  <[EMAIL PROTECTED]>
        and Stepan Kasal  <[EMAIL PROTECTED]>

        Do not rebuild `testsuite' when a lib/autoconf/*.m4 edit does
        not affect the generated test cases.

        * tests/mktests: Only touch the products if they would change.
        If one of the *.at files would be empty, err out.
        * tests/Makefile.am: Do not call the autom4te for $(TESTSUTE)
        directly, use a new rule for $(TESTSUTE).tmp.  Move these rules
        from the ``maintainer section'' up.  Do not distribute
        $(TESTSUITE_GENERATED_AT).
        (MAINTAINERCLEANFILES): Remove.

Index: tests/Makefile.am
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/Makefile.am,v
retrieving revision 1.100
diff -u -r1.100 Makefile.am
--- tests/Makefile.am   9 Apr 2006 11:36:08 -0000       1.100
+++ tests/Makefile.am   10 Apr 2006 09:35:16 -0000
@@ -1,7 +1,7 @@
 ## Process this file with automake to create Makefile.in. -*-Makefile-*-
 
 ## Makefile for Autoconf testsuite.
-## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -21,13 +21,12 @@
 
 # We don't actually distribute the testsuite, since one only
 # needs m4 to build it, m4 being required anyway to install Autoconf.
-EXTRA_DIST = $(TESTSUITE_AT) local.at mktests.sh \
+EXTRA_DIST = $(TESTSUITE_HAND_AT) local.at mktests.sh \
             atlocal.in package.m4 wrapper.as
 
 # Running the uninstalled scripts.
 check_SCRIPTS = $(wrappers)
-DISTCLEANFILES = atconfig atlocal $(TESTSUITE)
-MAINTAINERCLEANFILES = Makefile.in
+DISTCLEANFILES = atconfig atlocal $(TESTSUITE) $(TESTSUITE_GENERATED_AT)
 
 # Import the dependencies on Autotest and M4sh.
 include ../lib/freeze.mk
@@ -79,20 +78,36 @@
 ## Test suite.  ##
 ## ------------ ##
 
+# The files which contain macros we check for syntax.
+AUTOCONF_FILES = \
+       $(top_srcdir)/lib/autoconf/general.m4 \
+       $(top_srcdir)/lib/autoconf/status.m4 \
+       $(top_srcdir)/lib/autoconf/autoheader.m4 \
+       $(top_srcdir)/lib/autoconf/autoupdate.m4 \
+       $(top_srcdir)/lib/autoconf/specific.m4 \
+       $(top_srcdir)/lib/autoconf/functions.m4 \
+       $(top_srcdir)/lib/autoconf/lang.m4 \
+       $(top_srcdir)/lib/autoconf/c.m4 \
+       $(top_srcdir)/lib/autoconf/fortran.m4 \
+       $(top_srcdir)/lib/autoconf/headers.m4 \
+       $(top_srcdir)/lib/autoconf/libs.m4 \
+       $(top_srcdir)/lib/autoconf/types.m4 \
+       $(top_srcdir)/lib/autoconf/programs.m4
+
 TESTSUITE_GENERATED_AT = \
-       $(srcdir)/aclang.at \
-       $(srcdir)/acc.at \
-       $(srcdir)/acfortran.at \
-       $(srcdir)/acgeneral.at \
-       $(srcdir)/acstatus.at \
-       $(srcdir)/acautoheader.at \
-       $(srcdir)/acautoupdate.at \
-       $(srcdir)/acspecific.at \
-       $(srcdir)/acfunctions.at \
-       $(srcdir)/acheaders.at \
-       $(srcdir)/actypes.at \
-       $(srcdir)/aclibs.at \
-       $(srcdir)/acprograms.at
+       aclang.at \
+       acc.at \
+       acfortran.at \
+       acgeneral.at \
+       acstatus.at \
+       acautoheader.at \
+       acautoupdate.at \
+       acspecific.at \
+       acfunctions.at \
+       acheaders.at \
+       actypes.at \
+       aclibs.at \
+       acprograms.at
 
 TESTSUITE_HAND_AT = \
        suite.at \
@@ -103,21 +118,28 @@
        autoscan.at \
        foreign.at
 
-TESTSUITE_AT = $(TESTSUITE_GENERATED_AT) $(TESTSUITE_HAND_AT)
 TESTSUITE = ./testsuite
 
 # Run the non installed autom4te.
 # Don't use AUTOM4TE since `make alpha' makes it unavailable although
 # we are allowed to use it (since we ship it).
 AUTOTEST = ./autom4te --language=autotest
-$(TESTSUITE): $(srcdir)/package.m4 \
-             local.at \
-             $(TESTSUITE_AT) \
-             $(autotest_m4f_dependencies)
-       cd $(top_builddir)/lib/autotest && $(MAKE) $(AM_MAKEFLAGS) autotest.m4f
-       $(AUTOTEST) -I $(srcdir) suite.at -o [EMAIL PROTECTED]
+
+# All the dependencies, except the generated *.at files:
+TESTSUITE_dependencies = $(srcdir)/package.m4 local.at \
+       $(autotest_m4f_dependencies) $(TESTSUITE_HAND_AT) mktests.sh
+
+$(TESTSUITE): $(TESTSUITE_dependencies) $(AUTOCONF_FILES)
+       $(srcdir)/mktests.sh $(AUTOCONF_FILES)
+       test ! -f $@ || mv $@ [EMAIL PROTECTED]
+       $(MAKE) $(AM_MAKEFLAGS) [EMAIL PROTECTED]
+       touch [EMAIL PROTECTED]
        mv [EMAIL PROTECTED] $@
 
+$(TESTSUITE).tmp: $(TESTSUITE_dependencies) $(TESTSUITE_GENERATED_AT)
+       cd $(top_builddir)/lib/autotest && $(MAKE) $(AM_MAKEFLAGS) autotest.m4f
+       $(AUTOTEST) -I $(srcdir) suite.at -o $@
+
 atconfig: $(top_builddir)/config.status
        cd $(top_builddir) && ./config.status tests/$@
 
@@ -139,33 +161,6 @@
 ## Maintainer rules.  ##
 ## ------------------ ##
 
-MAINTAINERCLEANFILES += $(TESTSUITE_GENERATED_AT)
-
-## Producing the test files.
-
-# The files which contain macros we check for syntax.  Use $(top_srcdir)
-# for the benefit of non-GNU make.  Fix the names in the rule below
-# where we `cd' to $srcdir.
-autoconfdir = $(top_srcdir)/lib/autoconf
-AUTOCONF_FILES = $(autoconfdir)/general.m4 \
-                $(autoconfdir)/status.m4 \
-                $(autoconfdir)/autoheader.m4 \
-                $(autoconfdir)/autoupdate.m4 \
-                $(autoconfdir)/specific.m4 \
-                $(autoconfdir)/functions.m4 \
-                $(autoconfdir)/lang.m4 \
-                $(autoconfdir)/c.m4 \
-                $(autoconfdir)/fortran.m4 \
-                $(autoconfdir)/headers.m4 \
-                $(autoconfdir)/libs.m4 \
-                $(autoconfdir)/types.m4 \
-                $(autoconfdir)/programs.m4
-
-$(TESTSUITE_GENERATED_AT): mktests.sh $(AUTOCONF_FILES)
-       cd $(srcdir) && ./mktests.sh \
-         `echo " "$(AUTOCONF_FILES) | sed 's, [^ ]*/, ../lib/autoconf/,g'`
-
-
 ## maintainer-check ##
 
 maintainer-check: maintainer-check-posix maintainer-check-c++
Index: tests/mktests.sh
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/mktests.sh,v
retrieving revision 1.53
diff -u -r1.53 mktests.sh
--- tests/mktests.sh    8 Apr 2006 21:44:13 -0000       1.53
+++ tests/mktests.sh    10 Apr 2006 09:35:16 -0000
@@ -214,15 +214,18 @@
   } >ac$base.tat
 
   # In one atomic step so that if something above fails, the trap
-  # preserves the old version of the file.  If there is nothing to
-  # check, output /rien du tout/[1].
+  # preserves the old version of the file.
   if grep AT_CHECK ac$base.tat >/dev/null 2>&1; then
-    mv -f ac$base.tat ac$base.at
-    # Help people not to update these files by hand.
-    chmod a-w ac$base.at
+    if diff ac$base.at ac$base.tat >/dev/null 2>&1; then
+       rm -f ac$base.tat
+    else
+       mv -f ac$base.tat ac$base.at
+       # Help people not to update these files by hand.
+       chmod a-w ac$base.at
+    fi
   else
-    rm -f ac$base.tat ac$base.at
-    touch ac$base.at
+    echo "Error: ac$base.at would be empty." >&2
+    exit 1
   fi
 done
 
@@ -230,5 +233,3 @@
 
 trap 0
 exit 0
-
-# [1] En franc,ais dans le texte.

Reply via email to