From 09cce90f0b24665e65a32194d15a5e97186cbc2d Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sat, 6 Sep 2003 21:10:40 +0000 Subject: [PATCH] * 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. --- ChangeLog | 27 +++++++++++++++ NEWS | 7 ++++ aclocal.in | 17 +++++----- automake.in | 12 +++++-- configure | 18 ++++++++++ configure.in | 5 +++ lib/Automake/XFile.pm | 14 +++++--- lib/missing | 54 ++++++++++++++++++++--------- stamp-vti | 4 +-- tests/.cvsignore | 8 +++-- tests/Makefile.am | 7 ++-- tests/Makefile.in | 16 ++++++--- tests/aclocal.in | 17 ++++++++++ tests/automake.in | 14 ++++++++ tests/defs.in | 38 +++++++-------------- tests/defun.test | 7 ++-- tests/depacl2.test | 9 +++-- tests/dup2.test | 9 ++--- tests/{dup3.test => missing.test} | 41 ++++++++++++++++------ tests/missing2.test | 56 +++++++++++++++++++++++++++++++ tests/order.test | 12 ++++--- version.texi | 4 +-- 22 files changed, 297 insertions(+), 99 deletions(-) create mode 100644 tests/aclocal.in create mode 100644 tests/automake.in rename tests/{dup3.test => missing.test} (52%) create mode 100755 tests/missing2.test diff --git a/ChangeLog b/ChangeLog index 2716c6269..6f26df5cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,32 @@ 2003-09-06 Alexandre Duret-Lutz + * 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 diff --git a/NEWS b/NEWS index f339ef6ba..b6e812f88 100644 --- 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 diff --git a/aclocal.in b/aclocal.in index e4465a8bd..c5635f734 100644 --- a/aclocal.in +++ b/aclocal.in @@ -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; } diff --git a/automake.in b/automake.in index 4faad1194..2e9176103 100755 --- a/automake.in +++ b/automake.in @@ -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 { diff --git a/configure b/configure index 389a00695..fb22fc7a8 100755 --- 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 diff --git a/configure.in b/configure.in index d526e04fb..cf3a93287 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/lib/Automake/XFile.pm b/lib/Automake/XFile.pm index 19ab87241..06bb55879 100644 --- a/lib/Automake/XFile.pm +++ b/lib/Automake/XFile.pm @@ -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: $!"; } } diff --git a/lib/missing b/lib/missing index fc54c64ec..e7ef83a1c 100755 --- a/lib/missing +++ b/lib/missing @@ -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 , 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 ." ;; -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: diff --git a/stamp-vti b/stamp-vti index 3ab03a68b..8ff204370 100644 --- 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 diff --git a/tests/.cvsignore b/tests/.cvsignore index 59e1e8d18..74ac3e486 100644 --- a/tests/.cvsignore +++ b/tests/.cvsignore @@ -1,6 +1,8 @@ -testSubDir -Makefile *.log -log +Makefile +aclocal +automake defs diffs +log +testSubDir diff --git a/tests/Makefile.am b/tests/Makefile.am index b70ad8be2..c96967892 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 diff --git a/tests/Makefile.in b/tests/Makefile.in index 155727b8f..446860ef2 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 000000000..631f5b95e --- /dev/null +++ b/tests/aclocal.in @@ -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 index 000000000..320be8d77 --- /dev/null +++ b/tests/automake.in @@ -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+"$@"} diff --git a/tests/defs.in b/tests/defs.in index 59a47df23..82c637664 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -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@' diff --git a/tests/defun.test b/tests/defun.test index 543296e94..19977e2f1 100755 --- a/tests/defun.test +++ b/tests/defun.test @@ -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 diff --git a/tests/depacl2.test b/tests/depacl2.test index e87e5755c..6d5dd198a 100755 --- a/tests/depacl2.test +++ b/tests/depacl2.test @@ -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. diff --git a/tests/dup2.test b/tests/dup2.test index 0df5f0b8c..43cf8b407 100755 --- a/tests/dup2.test +++ b/tests/dup2.test @@ -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 diff --git a/tests/dup3.test b/tests/missing.test similarity index 52% rename from tests/dup3.test rename to tests/missing.test index 4997faa16..3993d6174 100755 --- a/tests/dup3.test +++ b/tests/missing.test @@ -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. # @@ -14,21 +14,40 @@ # 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 index 000000000..7d0a66432 --- /dev/null +++ b/tests/missing2.test @@ -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 +: diff --git a/tests/order.test b/tests/order.test index 2f69c7d91..19a458415 100755 --- a/tests/order.test +++ b/tests/order.test @@ -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 diff --git a/version.texi b/version.texi index 3ab03a68b..8ff204370 100644 --- a/version.texi +++ b/version.texi @@ -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 -- 2.47.2