automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: test case for rebuild rules and make -j


From: Alexandre Duret-Lutz
Subject: FYI: test case for rebuild rules and make -j
Date: Wed, 07 May 2003 00:28:53 +0200
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3 (gnu/linux)

I'm installing this on HEAD.  This tests `make -j' with rebuild rules.

Although this requires CVS Autoconf I've not added an AC_PREREQ
to the test case.  This is because Automake 1.8 will require
Autoconf 2.58.  (autoreconf's support for the new aclocal is the
main reason.)

I've found two bugs while working on this patch
  1. the rebuild rules for Makefile failed to propagate automake's
     exit status.  This is fixed in this patch.
  2. the locking code of autom4te failed to obtain an exclusive
     lock.  There is a pending patch for this in address@hidden

2003-05-07  Alexandre Duret-Lutz  <address@hidden>

        * lib/am/configure.am (%MAKEFILE-IN%): Propagate automake's exit
        status.
        * tests/makej.test: New file (test Autom4te's cache locking,
        new in CVS Autoconf).
        * tests/Makefile.am (TESTS): Add makej.test.

Index: lib/am/configure.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/configure.am,v
retrieving revision 1.19
diff -u -r1.19 configure.am
--- lib/am/configure.am 25 Apr 2003 20:46:21 -0000      1.19
+++ lib/am/configure.am 6 May 2003 22:19:11 -0000
@@ -42,9 +42,10 @@
          case '$(top_srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) 
$(am__configure_deps)' in \
            *$$dep*) \
 ?TOPDIR_P?           echo ' cd $(srcdir) && $(AUTOMAKE) --%STRICTNESS% 
%USE-DEPS%'; \
-?TOPDIR_P?           cd $(srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS%; \
-?!TOPDIR_P?          cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) 
am--refresh; \
-             exit 0;; \
+?TOPDIR_P?           cd $(srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% \
+?!TOPDIR_P?          cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 
\
+               && exit 0; \
+             exit 1;; \
          esac; \
        done; \
 ## Otherwise, rebuild only this file.
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.491
diff -u -r1.491 Makefile.am
--- tests/Makefile.am   6 May 2003 12:07:22 -0000       1.491
+++ tests/Makefile.am   6 May 2003 22:19:12 -0000
@@ -272,6 +272,7 @@
 ltlibobjs.test \
 maintclean.test \
 make.test \
+makej.test \
 makevars.test \
 man.test \
 man2.test \
Index: tests/makej.test
===================================================================
RCS file: tests/makej.test
diff -N tests/makej.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/makej.test    6 May 2003 22:19:13 -0000
@@ -0,0 +1,57 @@
+#! /bin/sh
+# Copyright (C) 2003  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 autoconf; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# `make -j' used to fail with Autoconf < 2.58, because tools like
+# autoconf and automake can try to update autom4te's cache in parallel.
+#
+# Note that failures might not be reproducible systematically as they
+# depend on the time at which autoconf and automake update the cache
+# via autom4te.
+
+required=GNUmake
+. ./defs || exit 1
+
+set -e
+
+cat >configure.in <<'END'
+m4_include([version.m4])
+AC_INIT([version7], [THE_VERSION])
+AM_INIT_AUTOMAKE
+AC_CONFIG_HEADER([config.h])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+echo 'm4_define([THE_VERSION], [2.718])' > version.m4
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOHEADER
+$AUTOMAKE --add-missing
+./configure --version | grep '2\.718'
+./configure
+$MAKE
+
+$sleep
+echo 'm4_define([THE_VERSION], [3.141])' > version.m4
+$MAKE -j
+./configure --version | grep '3\.141'

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]