AM_INSTALLCHECK_STD_OPTIONS_EXEMPT.
* lib/am/scripts.am (installcheck-%DIR%SCRIPTS): Likewise.
* automake.texi (Options) <std-options>: Document
AM_INSTALLCHECK_STD_OPTIONS_EXEMPT.
(Gnits): Reference std-options.
* tests/gnits3.test: New file.
* tests/Makefile.am (TESTS): Add gnits3.test.
Suggested by Jim Meyering.
+2002-07-21 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ * lib/am/progs.am (installcheck-%DIR%PROGRAMS): Honor
+ AM_INSTALLCHECK_STD_OPTIONS_EXEMPT.
+ * lib/am/scripts.am (installcheck-%DIR%SCRIPTS): Likewise.
+ * automake.texi (Options) <std-options>: Document
+ AM_INSTALLCHECK_STD_OPTIONS_EXEMPT.
+ (Gnits): Reference std-options.
+ * tests/gnits3.test: New file.
+ * tests/Makefile.am (TESTS): Add gnits3.test.
+ Suggested by Jim Meyering.
+
2002-07-20 Alexandre Duret-Lutz <duret_g@epita.fr>
* tests/gnits2.test: Use --program-prefix. Test for scripts too.
@item @code{std-options}
@cindex Options, std-options
+@cindex make installcheck
Make the @code{installcheck} target check that installed scripts and
programs support the @code{--help} and @code{--version} options.
+This also provides a basic check that the program's
+run-time dependencies are satisfied after installation.
+
+@vindex AM_INSTALLCHECK_STD_OPTIONS_EXEMPT
+In a few situations, programs (or scripts) have to be exempted from this
+test. For instance @command{false} (from GNU sh-utils) is never
+successful, even for @code{--help} or @code{--version}. You can
+list such programs in the variable @code{AM_INSTALLCHECK_STD_OPTIONS_EXEMPT}.
@item @code{subdir-objects}
If this option is specified, then objects are placed into the
@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.
+respectively. This is the @code{std-options} option (@pxref{Options}).
@item
@samp{make dist} will check to make sure the @file{NEWS} file has been
.PHONY installcheck-am: installcheck-%DIR%PROGRAMS
installcheck-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
bad=0; pid=$$$$; list="$(%DIR%_PROGRAMS)"; for p in $$list; do \
+ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
+ *" $$p "*) continue;; \
+ esac; \
## Strip the directory and $(EXEEXT) before applying $(transform).
f=`echo "$$p" | \
sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
.PHONY installcheck-am: installcheck-%DIR%SCRIPTS
installcheck-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
bad=0; pid=$$$$; list="$(%DIR%_SCRIPTS)"; for p in $$list; do \
+ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
+ *" $$p "*) continue;; \
+ esac; \
## Strip any leading directory before applying $(transform).
f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \
## Insert the directory back if nobase_ is used.
-@set UPDATED 16 July 2002
+@set UPDATED 21 July 2002
@set UPDATED-MONTH July 2002
@set EDITION 1.6a
@set VERSION 1.6a
gnuwarn.test \
gnits.test \
gnits2.test \
+gnits3.test \
header.test \
implicit.test \
include.test \
gnuwarn.test \
gnits.test \
gnits2.test \
+gnits3.test \
header.test \
implicit.test \
include.test \
--- /dev/null
+#! /bin/sh
+
+# Check that AM_INSTALLCHECK_STD_OPTIONS_EXEMPT works.
+
+required=gcc
+. $srcdir/defs || exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+# We use the same basename for all targets on purpose. This way
+# we make sure that `AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok'
+# will not match anything containing `nok'.
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = gnits
+
+nobase_bin_PROGRAMS = nok sub/nok
+nok_SOURCES = nok.c
+sub_nok_SOURCES = nok.c
+
+nobase_bin_SCRIPTS = nok.sh sub/nok.sh
+
+AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok nok.sh
+END
+
+echo 'int main () { return 0; }' > nok.c
+
+mkdir sub
+
+cat >nok.sh <<EOF
+#!/bin/sh
+echo "Which version? Which usage?"
+exit 1
+EOF
+
+cp nok.sh sub/nok.sh
+
+chmod +x nok.sh
+chmod +x sub/nok.sh
+
+# Files required by Gnits.
+: > INSTALL
+: > NEWS
+: > README
+: > COPYING
+: > AUTHORS
+: > ChangeLog
+: > THANKS
+
+set -e
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+mkdir build
+cd build
+
+# Use --program-prefix to make sure the std-options check honors it.
+../configure --prefix=`pwd`/../inst-dir --program-prefix=p
+$MAKE
+$MAKE install
+$MAKE -k installcheck 2>stderr && exit 1
+cat stderr
+grep 'sub/pnok does not support' stderr
+grep 'sub/pnok.sh does not support' stderr
+# Only two failures please.
+test `grep 'does not support --help' stderr | wc -l` = 2
+test `grep 'does not support --version' stderr | wc -l` = 2
+
+
+# Make sure there is no more error when all targets are exempted.
+cd ..
+echo 'AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += sub/nok sub/nok.sh' >> Makefile.am
+$AUTOMAKE
+cd build
+./config.status # Don't rely on the rebuild rules (they need GNU make).
+$MAKE installcheck
-@set UPDATED 16 July 2002
+@set UPDATED 21 July 2002
@set UPDATED-MONTH July 2002
@set EDITION 1.6a
@set VERSION 1.6a