* lib/Automake/XFile.pm: Update to use ChannelDefs.
authorAlexandre Duret-Lutz <adl@gnu.org>
Sat, 6 Sep 2003 21:10:40 +0000 (21:10 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sat, 6 Sep 2003 21:10:40 +0000 (21:10 +0000)
(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.

22 files changed:
ChangeLog
NEWS
aclocal.in
automake.in
configure
configure.in
lib/Automake/XFile.pm
lib/missing
stamp-vti
tests/.cvsignore
tests/Makefile.am
tests/Makefile.in
tests/aclocal.in [new file with mode: 0644]
tests/automake.in [new file with mode: 0644]
tests/defs.in
tests/defun.test
tests/depacl2.test
tests/dup2.test
tests/missing.test [moved from tests/dup3.test with 52% similarity]
tests/missing2.test [new file with mode: 0755]
tests/order.test
version.texi

index 2716c62..6f26df5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,32 @@
 2003-09-06  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * 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.
+
        * tests/unused.test: Quote AC_DEFUN arguments.
 
 2003-09-05  Paul Eggert  <eggert@twinsun.com>
diff --git a/NEWS b/NEWS
index f339ef6..b6e812f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -88,6 +88,13 @@ New in 1.7a:
     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 e4465a8..c5635f7 100644 (file)
@@ -36,6 +36,7 @@ BEGIN
 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 @@ $default_dirlist = "$default_acdir/dirlist";
 # 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 @@ $ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
 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 @@ sub scan_configure ()
        {
          # 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 @@ sub add_macro ($)
     if (! defined $map{$macro})
     {
        warn "aclocal: macro `$macro' required but not defined\n";
-       $exit_status = 1;
+       $exit_code = 1;
        return;
     }
 
@@ -415,7 +413,7 @@ sub add_file ($)
        {
          # 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 @@ sub trace_used_macros ($)
       chomp;
       $traced{$_} = 1 if $macro_seen{$_};
     }
+
+  $tracefh->close;
+
   return %traced;
 }
 
index 4faad11..2e91761 100755 (executable)
@@ -4334,7 +4334,9 @@ sub scan_autoconf_traces ($)
                 "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 @@ sub scan_autoconf_traces ($)
                if $mtime > $configure_deps_greatest_timestamp;
            }
        }
-   }
+    }
+
+  $tracefh->close;
 }
 
 
@@ -4446,7 +4450,9 @@ sub scan_autoconf_files ()
              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 389a006..fb22fc7 100755 (executable)
--- a/configure
+++ b/configure
@@ -1840,6 +1840,10 @@ echo "${ECHO_T}$ac_cv_prog_fgrep" >&6
 
                                                                                 ac_config_files="$ac_config_files Makefile lib/Automake/Makefile lib/Automake/tests/Makefile lib/Makefile lib/am/Makefile m4/Makefile tests/Makefile tests/defs"
 
+          ac_config_files="$ac_config_files tests/aclocal-${APIVERSION}:tests/aclocal.in"
+
+          ac_config_files="$ac_config_files tests/automake-${APIVERSION}:tests/automake.in"
+
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -2381,7 +2385,14 @@ fi
 
 _ACEOF
 
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
 
+APIVERSION=$APIVERSION
+
+_ACEOF
 
 
 
@@ -2398,6 +2409,8 @@ do
   "m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
   "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
   "tests/defs" ) CONFIG_FILES="$CONFIG_FILES tests/defs" ;;
+  "tests/aclocal-${APIVERSION}" ) CONFIG_FILES="$CONFIG_FILES tests/aclocal-${APIVERSION}:tests/aclocal.in" ;;
+  "tests/automake-${APIVERSION}" ) CONFIG_FILES="$CONFIG_FILES tests/automake-${APIVERSION}:tests/automake.in" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
@@ -2717,6 +2730,11 @@ s,@INSTALL@,$ac_INSTALL,;t t
     rm -f $tmp/out
   fi
 
+  # Run the commands associated with the file.
+  case $ac_file in
+    tests/aclocal-${APIVERSION} ) chmod +x tests/aclocal-${APIVERSION} ;;
+    tests/automake-${APIVERSION} ) chmod +x tests/automake-${APIVERSION} ;;
+  esac
 done
 _ACEOF
 
index d526e04..cf3a932 100644 (file)
@@ -116,5 +116,10 @@ AC_CONFIG_FILES([
   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 19ab872..06bb558 100644 (file)
@@ -89,6 +89,8 @@ use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
 use Carp;
 use IO::File;
 use File::Basename;
+use Automake::ChannelDefs;
+use Automake::FileUtils;
 
 require Exporter;
 require DynaLoader;
@@ -143,7 +145,7 @@ sub open
 
   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 @@ sub close
   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 @@ sub lock
   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 @@ sub seek
   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 @@ sub truncate
   if (!truncate ($fh, $len))
     {
       my $file = $fh->name;
-      croak "$me: cannot truncate $file at $len: $!\n";
+      fatal "cannot truncate $file at $len: $!";
     }
 }
 
index fc54c64..e7ef83a 100755 (executable)
@@ -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 <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -38,12 +42,23 @@ else
   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 @@ Supported PROGRAM values:
   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 <bug-automake@gnu.org>."
     ;;
 
   -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
-    echo "missing 0.4 - GNU automake"
+    echo "missing $scriptversion (GNU Automake)"
     ;;
 
   -*)
@@ -94,7 +111,7 @@ Supported PROGRAM values:
     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 @@ WARNING: \`$1' is missing on your system.  You should only need it if
     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 @@ WARNING: \`$1' is missing on your system.  You should only need it if
     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 @@ WARNING: \`$1' is missing on your system.  You should only need it if
     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 @@ WARNING: \`$1' is missing on your system.  You should only need it if
     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 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your
 
   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 @@ WARNING: \`$1' is missing on your system.  You should only need it if
 
   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 @@ WARNING: \`$1' is missing on your system.  You should only need it if
     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 @@ WARNING: \`$1' is missing on your system.  You should only need it if
     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 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments.
 
   *)
     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 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your
 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 3ab03a6..8ff2043 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 31 August 2003
-@set UPDATED-MONTH August 2003
+@set UPDATED 6 September 2003
+@set UPDATED-MONTH September 2003
 @set EDITION 1.7a
 @set VERSION 1.7a
index 59e1e8d..74ac3e4 100644 (file)
@@ -1,6 +1,8 @@
-testSubDir
-Makefile
 *.log
-log
+Makefile
+aclocal
+automake
 defs
 diffs
+log
+testSubDir
index b70ad8b..c969678 100644 (file)
@@ -180,7 +180,6 @@ distname.test \
 dollar.test \
 double.test \
 dup2.test \
-dup3.test \
 else.test \
 empty.test \
 empty2.test \
@@ -300,6 +299,8 @@ mdate.test \
 mdate2.test \
 mdate3.test \
 mdate4.test \
+missing.test \
+missing2.test \
 mkinst2.test \
 mkinstall.test \
 multlib.test \
@@ -497,8 +498,8 @@ yaccvpath.test
 
 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 155727b..446860e 100644 (file)
@@ -41,9 +41,10 @@ am__configure_deps = $(top_srcdir)/m4/amversion.m4 \
        $(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 @@ distname.test \
 dollar.test \
 double.test \
 dup2.test \
-dup3.test \
 else.test \
 empty.test \
 empty2.test \
@@ -409,6 +409,8 @@ mdate.test \
 mdate2.test \
 mdate3.test \
 mdate4.test \
+missing.test \
+missing2.test \
 mkinst2.test \
 mkinstall.test \
 multlib.test \
@@ -606,8 +608,8 @@ yaccvpath.test
 
 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:
@@ -641,6 +643,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
 TAGS:
diff --git a/tests/aclocal.in b/tests/aclocal.in
new file mode 100644 (file)
index 0000000..631f5b9
--- /dev/null
@@ -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
+
+perllibdir=@abs_top_builddir@/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 --acdir=@abs_top_srcdir@/m4 ${1+"$@"}
diff --git a/tests/automake.in b/tests/automake.in
new file mode 100644 (file)
index 0000000..320be8d
--- /dev/null
@@ -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
+
+perllibdir=@abs_top_builddir@/lib:@abs_top_srcdir@/lib
+export perllibdir
+exec @abs_top_builddir@/automake --libdir=@abs_top_srcdir@/lib ${1+"$@"}
index 59a47df..82c6376 100644 (file)
@@ -69,6 +69,18 @@ test -z "$MAKE" && MAKE=make
 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="aclocal-@APIVERSION@"
+# 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="automake-@APIVERSION@ --foreign -Werror -Wall"
+
+PATH=`pwd`:$PATH
+echo $PATH
 
 if test -n "$required"
 then
@@ -231,28 +243,6 @@ unset DESTDIR
 
 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
@@ -290,10 +280,6 @@ case $required in
     ;;
 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'.
 EGREP='@EGREP@'
index 543296e..19977e2 100755 (executable)
@@ -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 e87e575..6d5dd19 100755 (executable)
@@ -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.
 #
 
 . ./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 0df5f0b..43cf8b4 100755 (executable)
@@ -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 @@ cat > acinclude.m4 << 'END'
 AC_DEFUN([AM_FUNC_STRTOD])
 END
 
-$ACLOCAL || exit 1
-exit 0
+$ACLOCAL
similarity index 52%
rename from tests/dup3.test
rename to tests/missing.test
index 4997faa..3993d61 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
 # 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
+# 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.
 
-# Make sure aclocal searches includes in the right order.
+# Test missing with version mismatches.
 
 . ./defs || exit 1
 
-mkdir zoo
-cat > zoo/zoo.m4 << 'END'
-AC_DEFUN([AM_INIT_AUTOMAKE], zardoz)
-END
+required=GNUmake
+set -e
 
-# Strip all options from ACLOCAL, especially -I's.
-ACLOCAL="`echo $ACLOCAL | sed -e 's/ -.*$//'` --acdir=$testsrcdir/../m4"
-$ACLOCAL -I zoo || exit 1
+cat >>configure.in <<'EOF'
+AC_OUTPUT
+EOF
+
+: > Makefile.am
+
+$ACLOCAL
 $AUTOCONF
-grep zardoz configure
+$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
+:
diff --git a/tests/missing2.test b/tests/missing2.test
new file mode 100755 (executable)
index 0000000..7d0a664
--- /dev/null
@@ -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 2f69c7d..19a4584 100755 (executable)
@@ -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.
 #
 
 . ./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
index 3ab03a6..8ff2043 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 31 August 2003
-@set UPDATED-MONTH August 2003
+@set UPDATED 6 September 2003
+@set UPDATED-MONTH September 2003
 @set EDITION 1.7a
 @set VERSION 1.7a