(handle_options): Enable std-options in gnits strictness.
(am_install_var): If std-options, enable CK-OPTS section.
* lib/am/scripts.am (installcheck-am): New target.
* lib/am/progs.am (installcheck-am): New target.
* tests/gnits2.test: New file.
* tests/Makefile.am (TESTS): Add gnits2.test.
* automake.texi (Gnits, Options): Document std-options.
+2002-06-17 Paolo Bonzini <bonzini@gnu.org>
+
+ * automake.in (process_option_list): Recognize std-options.
+ (handle_options): Enable std-options in gnits strictness.
+ (am_install_var): If std-options, enable CK-OPTS section.
+ * lib/am/scripts.am (installcheck-am): New target.
+ * lib/am/progs.am (installcheck-am): New target.
+ * tests/gnits2.test: New file.
+ * tests/Makefile.am (TESTS): Add gnits2.test.
+ * automake.texi (Gnits, Options): Document std-options.
+
2002-06-17 Kevin Ryde <user42@zip.com.au>
* automake.in (scan_texinfo_file): Add tmp to @clean_suffixes,
New in 1.6a:
+* A new option, std-options, tests that programs support --help and --version
+ when `make installcheck' is run. This is enabled by --gnits.
* PDF files are generated by Automake
* `make distcheck' will enforce DESTDIR support by attempting
a DESTDIR install.
* should not put texiname_TEXINFOS into distribution
should rename this macro anyway, to foo_texi_DEPENDENCIES
-* *all* installed scripts should support --version, --help
-
* For now I guess I'll just have automake give an error if it encounters
non-C source in a libtool library specification.
fragments to be merged. e.g., `install-local'.
consider putting all check-* targets onto @check?
-To support --help/--version checking?
take diff-n-query code from libit
* Don't include any symbolic links in the distribution itself.
(ditto hard links)
* Make sure that all the files in the distribution are world-readable.
-** also, check --help output and --version output. Idea from François
* standards no longer prohibit ANSI C. What does this imply
for the de-ansi-fication feature? [ must keep it -- some users rely on it ]
|| $_ eq 'dejagnu' || $_ eq 'no-texinfo.tex'
|| $_ eq 'readme-alpha' || $_ eq 'check-news'
|| $_ eq 'subdir-objects' || $_ eq 'nostdinc'
- || $_ eq 'no-exeext' || $_ eq 'no-define')
+ || $_ eq 'no-exeext' || $_ eq 'no-define'
+ || $_ eq 'std-options')
{
# Explicitly recognize these.
}
if ($strictness == GNITS)
{
$options{'readme-alpha'} = 1;
+ $options{'std-options'} = 1;
$options{'check-news'} = 1;
}
# If so, with install-exec? (or install-data?).
my $exec_p = ($nodir_name =~ /$EXEC_DIR_PATTERN/o);
+ my $check_options_p = $install_p
+ && defined $options{'std-options'};
+
# Singular form of $PRIMARY.
(my $one_primary = $primary) =~ s/S$//;
$output_rules .= &file_contents ($file,
'EXEC' => $exec_p,
'INSTALL' => $install_p,
- 'DIST' => $dist_p));
+ 'DIST' => $dist_p,
+ 'CK-OPTS' => $check_options_p));
$first = 0;
}
@samp{@var{MAJOR}.@var{MINOR}@var{ALPHA}}, where @var{ALPHA} is a
letter; it should be omitted for non-alpha releases.
+@item @code{std-options}
+@cindex Options, std-options
+Make the @code{installcheck} target check that installed scripts and
+programs support the @code{--help} and @code{--version} options.
+
@item @code{subdir-objects}
If this option is specified, then objects are placed into the
subdirectory of the build directory corresponding to the subdirectory of
checks the following as well:
@itemize @bullet
+@item
+@samp{make installcheck} will check to make sure that the @code{--help}
+and @code{--version} really print a usage message and a version string,
+respectively. This also provides a basic check that the program's
+run-time dependencies are satisfied after installation.
+
@item
@samp{make dist} will check to make sure the @file{NEWS} file has been
updated to the current version.
?LIBTOOL? echo " rm -f $$p $$f"; \
?LIBTOOL? rm -f $$p $$f ; \
?LIBTOOL? done
+
+
+## ---------- ##
+## Checking. ##
+## ---------- ##
+
+if %?CK-OPTS%
+.PHONY installcheck-am: installcheck-%DIR%PROGRAMS
+installcheck-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
+ bad=0; pid=$$$$; list="$(%DIR%_PROGRAMS)"; for p in $$list; do \
+ for opt in --help --version; do \
+ if $(DESTDIR)$(%NDIR%dir)/$$p $$opt > c$${pid}_.out 2> c$${pid}_.err \
+ && test -n "`cat c$${pid}_.out`" \
+ && test -z "`cat c$${pid}_.err`"; then :; \
+ else echo "$$p does not support $$opt" 1>&2; bad=1; fi; \
+ done; \
+ done; rm -f c$${pid}_.???; exit $$bad
+endif %?CK-OPTS%
## Checking. ##
## ---------- ##
-## Uncomment line in handle_scripts when this is uncommented.
-## check-%DIR%SCRIPTS:
-## pid=$$$$; list="$(%DIR%_SCRIPTS)"; for p in $$list; do \
-## for opt in --help --version; do \
-## if test -f $$p; then :; \
-## elif test -f $(srcdir)/$$p; then \
-## p=$(srcdir)/$$p; \
-## else exit 1; fi; \
-## if $$p $$opt > .chkout$$pid 2> .chkerr$$pid \
-## && test -n "`cat .chkout$$pid`" \
-## && test -z "`cat .chkerr$$pid`"; then :; \
-## else echo "$$p failed $$opt test" 1>&2; exit 1; fi; \
-## done; \
-## done; rm -f .chk???$$pid
+if %?CK-OPTS%
+.PHONY installcheck-am: installcheck-%DIR%SCRIPTS
+installcheck-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
+ bad=0; pid=$$$$; list="$(%DIR%_SCRIPTS)"; for p in $$list; do \
+ for opt in --help --version; do \
+ if $(DESTDIR)$(%NDIR%dir)/$$p $$opt > c$${pid}_.out 2> c$${pid}_.err \
+ && test -n "`cat c$${pid}_.out`" \
+ && test -z "`cat c$${pid}_.err`"; then :; \
+ else echo "$$p does not support $$opt" 1>&2; bad=1; fi; \
+ done; \
+ done; rm -f c$${pid}_.???; exit $$bad
+endif %?CK-OPTS%
+
-@set UPDATED 13 June 2002
+@set UPDATED 17 June 2002
@set UPDATED-MONTH June 2002
@set EDITION 1.6a
@set VERSION 1.6a
gcj3.test \
gcj4.test \
gnits.test \
+gnits2.test \
header.test \
implicit.test \
include.test \
gcj3.test \
gcj4.test \
gnits.test \
+gnits2.test \
header.test \
implicit.test \
include.test \
--- /dev/null
+#! /bin/sh
+
+# Test to ensure std-options checking is correct.
+
+required=gcc
+. $srcdir/defs || exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = gnits
+noinst_PROGRAMS = fubar2
+bin_PROGRAMS = fubar fine
+fubar_SOURCES = fubar.c
+fubar2_SOURCES = fubar2.c
+fine_SOURCES = fine.c
+END
+
+echo 'main(int argc, char **argv) { exit(0); }' > fubar.c
+echo 'main(int argc, char **argv) { exit(0); }' > fubar2.c
+
+cat > fine.c << 'END'
+#include <stdio.h>
+main(int argc, char **argv) {
+ puts ("Which version? Which usage?");
+ exit(0);
+}
+END
+
+cat > check.sed << 'END'
+/fubar does not/ {
+ s/.*/0/
+ H
+}
+/fubar2 does not/ {
+ s/.*/1/
+ H
+}
+/fine does not/ {
+ s/.*/1/
+ H
+}
+$!d
+
+g
+/^\n0\n0$/! {
+ s/.*/1/
+ q
+}
+s/.*/0/
+END
+
+# Files required by Gnits.
+: > INSTALL
+: > NEWS
+: > README
+: > COPYING
+: > AUTHORS
+: > ChangeLog
+: > THANKS
+
+set -e
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+mkdir sub
+cd sub
+
+../configure --prefix=`pwd`/../inst-dir
+$MAKE all
+$MAKE install
+exit `$MAKE installcheck 2>&1 | sed -f ../check.sed`
+
-@set UPDATED 13 June 2002
+@set UPDATED 17 June 2002
@set UPDATED-MONTH June 2002
@set EDITION 1.6a
@set VERSION 1.6a