automake-patches
[Top][All Lists]
Advanced

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

FYI: $? = 63, version mismatch, missing


From: Alexandre Duret-Lutz
Subject: FYI: $? = 63, version mismatch, missing
Date: Sat, 06 Sep 2003 23:10:16 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

I'm installing this on HEAD.  This teach missing about exit code 63.

63 is returned by Autoconf to indicate version mismatch [1].
Now it's also returned by Automake.  When missing run a tool
that exits with 63 it will not bail out but instead emulate the
tool.  

[1] http://mail.gnu.org/archive/html/autoconf-patches/2003-05/msg00083.html

This will allow projects generated with future versions of this
tools to ignore older installed versions (but older versions
only starting with this one).

2003-09-06  Alexandre Duret-Lutz  <address@hidden>

        * lib/Automake/XFile.pm: Update to use ChannelDefs.
        (close): Call Automake::FileUtils::handle_exec_errors on errors.
        * automake.in (scan_autoconf_files): Exit with $?=63 on version
        mismatch.
        (scan_autoconf_traces): Likewise.  Close the autoconf pipe to
        capture abnormal exits.
        * aclocal.in ($exit_status): Remove, and use Channels.pm's $exit_code
        instead.
        (trace_used_macros): Close the autom4te pipe to capture abnormal exits.
        * lib/missing: When a tool has run and exited with $?=63, emulate
        it.  Adjust the diagnostic and pretend the tool is tool old in this
        case.  Use an emacs-updated "scriptversion" variable.
        * configure.in: Output tests/aclocal-${APIVERSION} and
        tests/automake-${APIVERSION}.
        * tests/aclocal.in, tests/automake.in,
        tests/missing.test, tests/missing2.test: New files.
        * tests/defs.in (AUTOMAKE, ACLOCAL, PATH): Define
        to use tests/aclocal-$APIVERSION and tests/automake-$APIVERSION.
        * tests/dup3.test: Remove. alocal9.test, acloca10.test, and others are
        already testing for this.
        * tests/depacl2.test, tests/dup2.test, tests/order.test: Fix
        configure.in so that aclocal works.
        * tests/defun.test: Quote the AC_DEFUN body.
        * tests/Makefile.am (TESTS): Add missing.test and missing2.test,
        and remove dup3.test.
        (check_SCRIPTS): Add aclocal and automake.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.226
diff -u -r1.226 NEWS
--- NEWS        6 Sep 2003 05:36:56 -0000       1.226
+++ NEWS        6 Sep 2003 21:04:44 -0000
@@ -88,6 +88,13 @@
     argument.  The latter can be used to override the default behavior
     (which is to abort).
 
+  - Automake will exit with $? = 63 on version mismatch.  (So does
+    Autoconf 2.58)  missing knows this, and in this case it will
+    emulate the tools as if they were absent.  Because older versions
+    of Automake and Autoconf did not use this exit code, this change
+    will only be useful in projects generated with future versions of
+    these tools.
+
 * Obsolete features
 
   - lisp_DATA is now allowed.  If you are using the empty ELCFILES
Index: aclocal.in
===================================================================
RCS file: /cvs/automake/automake/aclocal.in,v
retrieving revision 1.89
diff -u -r1.89 aclocal.in
--- aclocal.in  6 Sep 2003 05:36:56 -0000       1.89
+++ aclocal.in  6 Sep 2003 20:38:42 -0000
@@ -36,6 +36,7 @@
 use Automake::Config;
 use Automake::General;
 use Automake::Configure_ac;
+use Automake::Channels;
 use Automake::XFile;
 use Automake::FileUtils;
 use File::stat;
@@ -55,9 +56,6 @@
 # configure.ac or configure.in.
 my $configure_ac = require_configure_ac;
 
-# Exit status.
-$exit_status = 0;
-
 # Output file name.
 $output_file = 'aclocal.m4';
 
@@ -103,14 +101,14 @@
 local (@dirlist) = &parse_arguments (@ARGV);
 &scan_m4_files (@dirlist);
 &scan_configure;
-if (! $exit_status)
+if (! $exit_code)
   {
     my %macro_traced = &trace_used_macros;
     &write_aclocal ($output_file, keys %macro_traced);
   }
 &check_acinclude;
 
-exit $exit_status;
+exit $exit_code;
 
 ################################################################
 
@@ -268,7 +266,7 @@
        {
          # Macro not found, but AM_ prefix found.
          warn "aclocal: $configure_ac: $.: macro `$2' not found in library\n";
-         $exit_status = 1;
+         $exit_code = 1;
        }
     }
 
@@ -361,7 +359,7 @@
     if (! defined $map{$macro})
     {
        warn "aclocal: macro `$macro' required but not defined\n";
-       $exit_status = 1;
+       $exit_code = 1;
        return;
     }
 
@@ -415,7 +413,7 @@
        {
          # Macro not found, but AM_ prefix found.
          warn "aclocal: $configure_ac: $.: macro `$2' not found in library\n";
-         $exit_status = 1;
+         $exit_code = 1;
        }
     }
 
@@ -502,6 +500,9 @@
       chomp;
       $traced{$_} = 1 if $macro_seen{$_};
     }
+
+  $tracefh->close;
+
   return %traced;
 }
 
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1502
diff -u -r1.1502 automake.in
--- automake.in 6 Sep 2003 05:36:56 -0000       1.1502
+++ automake.in 6 Sep 2003 20:38:46 -0000
@@ -4334,7 +4334,9 @@
                 "version mismatch.  This is Automake $VERSION,\n" .
                 "but the definition used by this AM_INIT_AUTOMAKE\n" .
                 "comes from Automake $args[1].  You should recreate\n" .
-                "aclocal.m4 with aclocal and run automake again.\n")
+                "aclocal.m4 with aclocal and run automake again.\n",
+                # $? = 63 is used to indicate version mismatch to missing.
+                exit_code => 63)
            if $VERSION ne $args[1];
 
          $seen_automake_version = 1;
@@ -4393,7 +4395,9 @@
                if $mtime > $configure_deps_greatest_timestamp;
            }
        }
-   }
+    }
+
+  $tracefh->close;
 }
 
 
@@ -4446,7 +4450,9 @@
              error ($seen_init_automake,
                     "your implementation of AM_INIT_AUTOMAKE comes from " .
                     "an\nold Automake version.  You should recreate " .
-                    "aclocal.m4\nwith aclocal and run automake again.\n");
+                    "aclocal.m4\nwith aclocal and run automake again.\n",
+                    # $? = 63 is used to indicate version mismatch to missing.
+                    exit_code => 63);
            }
          else
            {
Index: configure.in
===================================================================
RCS file: /cvs/automake/automake/configure.in,v
retrieving revision 1.129
diff -u -r1.129 configure.in
--- configure.in        24 Aug 2003 19:56:07 -0000      1.129
+++ configure.in        6 Sep 2003 20:38:47 -0000
@@ -116,5 +116,10 @@
   tests/Makefile
   tests/defs
 ])
+AC_CONFIG_FILES([tests/aclocal-${APIVERSION}:tests/aclocal.in],
+                [chmod +x tests/aclocal-${APIVERSION}],
+               [APIVERSION=$APIVERSION])
+AC_CONFIG_FILES([tests/automake-${APIVERSION}:tests/automake.in],
+                [chmod +x tests/automake-${APIVERSION}])
 
 AC_OUTPUT
Index: lib/missing
===================================================================
RCS file: /cvs/automake/automake/lib/missing,v
retrieving revision 1.23
diff -u -r1.23 missing
--- lib/missing 6 Sep 2003 05:36:56 -0000       1.23
+++ lib/missing 6 Sep 2003 20:38:47 -0000
@@ -1,6 +1,10 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, 
Inc.
+
+scriptversion=2003-09-02.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 
+#   Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <address@hidden>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -38,12 +42,23 @@
   configure_ac=configure.in
 fi
 
+msg="missing on your system"
+
 case "$1" in
 --run)
   # Try to run requested program, and just exit if it succeeds.
   run=
   shift
   "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
   ;;
 esac
 
@@ -74,11 +89,13 @@
   lex          create \`lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
   tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <address@hidden>."
     ;;
 
   -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
-    echo "missing 0.4 - GNU automake"
+    echo "missing $scriptversion (GNU Automake)"
     ;;
 
   -*)
@@ -94,7 +111,7 @@
     fi
 
     echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+WARNING: \`$1' is $msg.  You should only need it if
          you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
          to install the \`Automake' and \`Perl' packages.  Grab them from
          any GNU archive site."
@@ -108,7 +125,7 @@
     fi
 
     echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+WARNING: \`$1' is $msg.  You should only need it if
          you modified \`${configure_ac}'.  You might want to install the
          \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
          archive site."
@@ -122,7 +139,7 @@
     fi
 
     echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+WARNING: \`$1' is $msg.  You should only need it if
          you modified \`acconfig.h' or \`${configure_ac}'.  You might want
          to install the \`Autoconf' and \`GNU m4' packages.  Grab them
          from any GNU archive site."
@@ -146,7 +163,7 @@
     fi
 
     echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+WARNING: \`$1' is $msg.  You should only need it if
          you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
          You might want to install the \`Automake' and \`Perl' packages.
          Grab them from any GNU archive site."
@@ -162,8 +179,8 @@
     fi
 
     echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
-         system.  You might have modified some files without having the
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
          proper tools for further handling them.
          You can get \`$1' as part of \`Autoconf' from any GNU
          archive site."
@@ -185,7 +202,7 @@
 
   bison|yacc)
     echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+WARNING: \`$1' $msg.  You should only need it if
          you modified a \`.y' file.  You may need the \`Bison' package
          in order for those modifications to take effect.  You can get
          \`Bison' from any GNU archive site."
@@ -215,7 +232,7 @@
 
   lex|flex)
     echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+WARNING: \`$1' is $msg.  You should only need it if
          you modified a \`.l' file.  You may need the \`Flex' package
          in order for those modifications to take effect.  You can get
          \`Flex' from any GNU archive site."
@@ -243,7 +260,7 @@
     fi
 
     echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+WARNING: \`$1' is $msg.  You should only need it if
         you modified a dependency of a manual page.  You may need the
         \`Help2man' package in order for those modifications to take
         effect.  You can get \`Help2man' from any GNU archive site."
@@ -268,7 +285,7 @@
     fi
 
     echo 1>&2 "\
-WARNING: \`$1' is missing on your system.  You should only need it if
+WARNING: \`$1' is $msg.  You should only need it if
          you modified a \`.texi' or \`.texinfo' file, or any other file
          indirectly affecting the aspect of the manual.  The spurious
          call might also be the consequence of using a buggy \`make' (AIX,
@@ -323,8 +340,8 @@
 
   *)
     echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
-         system.  You might have modified some files without having the
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
          proper tools for further handling them.  Check the \`README' file,
          it often tells you about the needed prerequisites for installing
          this package.  You may also peek at any GNU archive site, in case
@@ -334,3 +351,10 @@
 esac
 
 exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
Index: lib/Automake/XFile.pm
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/XFile.pm,v
retrieving revision 1.4
diff -u -r1.4 XFile.pm
--- lib/Automake/XFile.pm       18 May 2003 08:38:21 -0000      1.4
+++ lib/Automake/XFile.pm       6 Sep 2003 20:38:47 -0000
@@ -89,6 +89,8 @@
 use Carp;
 use IO::File;
 use File::Basename;
+use Automake::ChannelDefs;
+use Automake::FileUtils;
 
 require Exporter;
 require DynaLoader;
@@ -143,7 +145,7 @@
 
   if (!$fh->SUPER::open (@_))
     {
-      croak "$me: cannot open $file: $!\n";
+      fatal "cannot open $file: $!";
     }
 
   # In case we're running under MSWindows, don't write with CRLF.
@@ -163,7 +165,9 @@
   if (!$fh->SUPER::close (@_))
     {
       my $file = $fh->name;
-      croak "$me: cannot close $file: $!\n";
+      Automake::FileUtils::handle_exec_errors $file
+       unless $!;
+      fatal "cannot close $file: $!";
     }
 }
 
@@ -215,7 +219,7 @@
   if (!flock ($fh, $mode))
     {
       my $file = $fh->name;
-      croak "$me: cannot lock $file with mode $mode: $!\n";
+      fatal "cannot lock $file with mode $mode: $!";
     }
 }
 
@@ -230,7 +234,7 @@
   if (!seek ($fh, $_[0], $_[1]))
     {
       my $file = $fh->name;
-      croak "$me: cannot rewind $file with @_: $!\n";
+      fatal "$me: cannot rewind $file with @_: $!";
     }
 }
 
@@ -244,7 +248,7 @@
   if (!truncate ($fh, $len))
     {
       my $file = $fh->name;
-      croak "$me: cannot truncate $file at $len: $!\n";
+      fatal "cannot truncate $file at $len: $!";
     }
 }
 
Index: tests/.cvsignore
===================================================================
RCS file: /cvs/automake/automake/tests/.cvsignore,v
retrieving revision 1.3
diff -u -r1.3 .cvsignore
--- tests/.cvsignore    16 Sep 2002 20:39:59 -0000      1.3
+++ tests/.cvsignore    6 Sep 2003 20:38:47 -0000
@@ -1,6 +1,8 @@
-testSubDir
-Makefile
 *.log
-log
+Makefile
+aclocal
+automake
 defs
 diffs
+log
+testSubDir
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.513
diff -u -r1.513 Makefile.am
--- tests/Makefile.am   28 Aug 2003 22:49:58 -0000      1.513
+++ tests/Makefile.am   6 Sep 2003 20:38:48 -0000
@@ -180,7 +180,6 @@
 dollar.test \
 double.test \
 dup2.test \
-dup3.test \
 else.test \
 empty.test \
 empty2.test \
@@ -300,6 +299,8 @@
 mdate2.test \
 mdate3.test \
 mdate4.test \
+missing.test \
+missing2.test \
 mkinst2.test \
 mkinstall.test \
 multlib.test \
@@ -497,8 +498,8 @@
 
 EXTRA_DIST = ChangeLog-old $(TESTS)
 
-# Each test case depends on defs.
-check_SCRIPTS = defs
+# Each test case depends on defs, aclocal, and automake.
+check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
 
 distclean-local:
        -rm -rf testSubDir
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.660
diff -u -r1.660 Makefile.in
--- tests/Makefile.in   28 Aug 2003 22:49:58 -0000      1.660
+++ tests/Makefile.in   6 Sep 2003 20:38:48 -0000
@@ -41,9 +41,10 @@
        $(top_srcdir)/m4/missing.m4 $(top_srcdir)/m4/options.m4 \
        $(top_srcdir)/m4/runlog.m4 $(top_srcdir)/m4/sanity.m4 \
        $(top_srcdir)/m4/strip.m4
-DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am defs.in
+DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am aclocal.in \
+       automake.in defs.in
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
-CONFIG_CLEAN_FILES = defs
+CONFIG_CLEAN_FILES = defs aclocal-${APIVERSION} automake-${APIVERSION}
 SOURCES =
 DIST_SOURCES =
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -289,7 +290,6 @@
 dollar.test \
 double.test \
 dup2.test \
-dup3.test \
 else.test \
 empty.test \
 empty2.test \
@@ -409,6 +409,8 @@
 mdate2.test \
 mdate3.test \
 mdate4.test \
+missing.test \
+missing2.test \
 mkinst2.test \
 mkinstall.test \
 multlib.test \
@@ -606,8 +608,8 @@
 
 EXTRA_DIST = ChangeLog-old $(TESTS)
 
-# Each test case depends on defs.
-check_SCRIPTS = defs
+# Each test case depends on defs, aclocal, and automake.
+check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
 all: all-am
 
 .SUFFIXES:
@@ -640,6 +642,10 @@
 $(ACLOCAL_M4):  $(top_srcdir)/configure.in  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 defs: $(top_builddir)/config.status defs.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+aclocal-${APIVERSION}: $(top_builddir)/config.status aclocal.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+automake-${APIVERSION}: $(top_builddir)/config.status automake.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 uninstall-info-am:
 tags: TAGS
Index: tests/aclocal.in
===================================================================
RCS file: tests/aclocal.in
diff -N tests/aclocal.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/aclocal.in    6 Sep 2003 20:38:48 -0000
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+fi
+
address@hidden@/lib:@abs_top_srcdir@/lib
+export perllibdir
+# Most of the files are in $srcdir/../m4.  However amversion.m4 is
+# generated in ../m4, so we include that directory in the search path too.
+exec @abs_top_builddir@/aclocal \
+     -I @abs_top_builddir@/m4 address@hidden@/m4 ${1+"$@"}
Index: tests/automake.in
===================================================================
RCS file: tests/automake.in
diff -N tests/automake.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/automake.in   6 Sep 2003 20:38:48 -0000
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+fi
+
address@hidden@/lib:@abs_top_srcdir@/lib
+export perllibdir
+exec @abs_top_builddir@/automake address@hidden@/lib ${1+"$@"}
Index: tests/defs.in
===================================================================
RCS file: /cvs/automake/automake/tests/defs.in,v
retrieving revision 1.20
diff -u -r1.20 defs.in
--- tests/defs.in       6 Sep 2003 05:36:57 -0000       1.20
+++ tests/defs.in       6 Sep 2003 20:38:48 -0000
@@ -69,6 +69,18 @@
 test -z "$AUTOCONF" && AUTOCONF="@AUTOCONF@"
 test -z "$AUTOHEADER" && AUTOHEADER="@AUTOHEADER@"
 test -z "$AUTOUPDATE" && AUTOUPDATE=autoupdate
+test -z "$MISSING" && MISSING=`pwd`/../lib/missing
+test -z "$ACLOCAL" && ACLOCAL="address@hidden@"
+# See how Automake should be run.  We put --foreign as the default
+# strictness to avoid having to create lots and lots of files.  A test
+# can override this by specifying a different strictness.  Use -Wall
+# -Werror by default.  Tests for which this is inappropriate
+# (e.g. when testing that a warning is enabled by a specific switch)
+# should use -Wnone or/and -Wno-error
+test -z "$AUTOMAKE" && AUTOMAKE="address@hidden@ --foreign -Werror -Wall"
+
+PATH=`pwd`:$PATH
+echo $PATH
 
 if test -n "$required"
 then
@@ -231,28 +243,6 @@
 
 echo "=== Running test $0"
 
-# See how Automake should be run.  We put --foreign as the default
-# strictness to avoid having to create lots and lots of files.  A test
-# can override this by specifying a different strictness.
-if test -z "$AUTOMAKE"; then
-   perllibdir=`pwd`/../../lib:$srcdir/../lib
-   export perllibdir
-   # Use -Wall -Werror by default.  Tests for which this is inappropriate
-   # (e.g. when testing that a warning is enabled by a specific switch)
-   # should use -Wnone or/and -Wno-error
-   AUTOMAKE="$PERL `pwd`/../../automake --libdir=$srcdir/../lib --foreign 
-Werror -Wall"
-fi
-
-# See how aclocal should be run.
-if test -z "$ACLOCAL"; then
-   perllibdir=`pwd`/../../lib:$srcdir/../lib
-   export perllibdir
-   # Most of the files are in $srcdir/../m4.  However amversion.m4 is
-   # generated in ../m4, so we include that directory in the search
-   # path too.
-   ACLOCAL="$PERL `pwd`/../../aclocal -I `pwd`/../../m4 --acdir=$srcdir/../m4"
-fi
-
 # We might need extra macros, e.g., from Libtool or Gettext.
 # Find them on the system.
 # Use `-I $srcdir/../m4' in addition to `--acdir=$srcdir/../m4', because the
@@ -289,10 +279,6 @@
     ACLOCAL="$ACLOCAL -I $srcdir/../m4 $extra_includes -I $aclocaldir"
     ;;
 esac
-
-# Export AUTOMAKE and ACLOCAL so that rebuild rules in Makefiles
-# generated for the tests do not use the installed tools.
-export AUTOMAKE ACLOCAL
 
 # POSIX no longer requires 'egrep' and 'fgrep',
 # but some hosts lack 'grep -E' and 'grep -F'.
Index: tests/defun.test
===================================================================
RCS file: /cvs/automake/automake/tests/defun.test,v
retrieving revision 1.3
diff -u -r1.3 defun.test
--- tests/defun.test    8 Sep 2002 13:07:55 -0000       1.3
+++ tests/defun.test    6 Sep 2003 20:38:48 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -23,9 +23,8 @@
 . ./defs || exit 1
 
 cat > acinclude.m4 << 'END'
-AC_DEFUN([AM_FUNC_TWO],)
-AC_DEFUN([AM_FUNC_ONE],
-AC_REQUIRE([AM_FUNC_TWO]))
+AC_DEFUN([AM_FUNC_TWO])
+AC_DEFUN([AM_FUNC_ONE], [AC_REQUIRE([AM_FUNC_TWO])])
 END
 
 $ACLOCAL
Index: tests/depacl2.test
===================================================================
RCS file: /cvs/automake/automake/tests/depacl2.test,v
retrieving revision 1.4
diff -u -r1.4 depacl2.test
--- tests/depacl2.test  6 Sep 2003 05:36:57 -0000       1.4
+++ tests/depacl2.test  6 Sep 2003 20:38:48 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -23,12 +23,15 @@
 
 . ./defs || exit 1
 
-cat > configure.in << 'END'
+set -e
+
+cat >> configure.in << 'END'
 AM_C_PROTOTYPES
+FOO
 END
 
 cat > AM_C_PROTOTYPES.m4 << 'END'
-AC_REQUIRE([AC_HEADER_STDC])
+AC_DEFUN([AM_C_PROTOTYPES], [AC_REQUIRE([AC_HEADER_STDC])])
 END
 
 # Our --acdir overrides the one in $ACLOCAL.
Index: tests/dup2.test
===================================================================
RCS file: /cvs/automake/automake/tests/dup2.test,v
retrieving revision 1.2
diff -u -r1.2 dup2.test
--- tests/dup2.test     8 Sep 2002 13:07:55 -0000       1.2
+++ tests/dup2.test     6 Sep 2003 20:38:48 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -22,7 +22,9 @@
 
 . ./defs || exit 1
 
-cat > configure.in << 'END'
+set -e
+
+cat >> configure.in << 'END'
 AM_FUNC_STRTOD
 END
 
@@ -30,5 +32,4 @@
 AC_DEFUN([AM_FUNC_STRTOD])
 END
 
-$ACLOCAL || exit 1
-exit 0
+$ACLOCAL
Index: tests/dup3.test
===================================================================
RCS file: tests/dup3.test
diff -N tests/dup3.test
--- tests/dup3.test     24 Apr 2003 18:48:07 -0000      1.7
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-#! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 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 sure aclocal searches includes in the right order.
-
-. ./defs || exit 1
-
-mkdir zoo
-cat > zoo/zoo.m4 << 'END'
-AC_DEFUN([AM_INIT_AUTOMAKE], zardoz)
-END
-
-# Strip all options from ACLOCAL, especially -I's.
-ACLOCAL="`echo $ACLOCAL | sed -e 's/ -.*$//'` --acdir=$testsrcdir/../m4"
-$ACLOCAL -I zoo || exit 1
-$AUTOCONF
-grep zardoz configure
Index: tests/missing.test
===================================================================
RCS file: tests/missing.test
diff -N tests/missing.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/missing.test  6 Sep 2003 20:38:48 -0000
@@ -0,0 +1,53 @@
+#! /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 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 missing with version mismatches.
+
+. ./defs || exit 1
+
+required=GNUmake
+set -e
+
+cat >>configure.in <<'EOF'
+AC_OUTPUT
+EOF
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+./configure
+$MAKE
+$sleep
+# Hopefully the install version of Autoconf cannot compete with this one...
+echo 'AC_PREREQ(9999)' >> aclocal.m4
+$MAKE distdir
+
+# Run again, but without missing, to ensure that timestamps were updated.
+export AUTOMAKE ACLOCAL
+./configure
+$MAKE
+
+# Make sure $MAKE fail when timestamps aren't updated and missing is not used.
+$sleep
+touch aclocal.m4
+$MAKE && exit 1
+:
Index: tests/missing2.test
===================================================================
RCS file: tests/missing2.test
diff -N tests/missing2.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/missing2.test 6 Sep 2003 20:38:48 -0000
@@ -0,0 +1,56 @@
+#! /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 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 missing with version mismatches.
+
+. ./defs || exit 1
+
+required=GNUmake
+set -e
+
+cat >>configure.in <<'EOF'
+m4_include([v.m4])
+AC_OUTPUT
+EOF
+
+: > v.m4
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+./configure
+$MAKE
+$sleep
+# Hopefully the install version of Autoconf cannot compete with this one...
+echo 'AC_PREREQ(9999)' > v.m4
+$MAKE distdir
+
+# Run again, but without missing, to ensure that timestamps were updated.
+export AUTOMAKE ACLOCAL
+./configure
+$MAKE
+
+# Make sure $MAKE fail when timestamps aren't updated and missing is not used.
+$sleep
+touch v.m4
+$MAKE && exit 1
+:
Index: tests/order.test
===================================================================
RCS file: /cvs/automake/automake/tests/order.test,v
retrieving revision 1.3
diff -u -r1.3 order.test
--- tests/order.test    8 Sep 2002 13:07:55 -0000       1.3
+++ tests/order.test    6 Sep 2003 20:38:48 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -23,14 +23,16 @@
 
 . ./defs || exit 1
 
-cat > configure.in << 'END'
+set -e
+
+cat >> configure.in << 'END'
 jm_TEST
+FOO
 END
 
 cat > acinclude.m4 << 'END'
-AC_DEFUN(jm_TEST
-)
-AC_REQUIRE([jm_TEST])
+AC_DEFUN([jm_TEST])
+AC_DEFUN([FOO], [AC_REQUIRE([jm_TEST])])
 END
 
 $ACLOCAL

-- 
Alexandre Duret-Lutz





reply via email to

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