From 74b6138e3d2512aa00cd9a066e59dc6b3ae4163a Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 22 Jul 2002 17:00:44 +0000 Subject: [PATCH] * lib/am/progs.am (installcheck-%DIR%PROGRAMS): Honor AM_INSTALLCHECK_STD_OPTIONS_EXEMPT. * lib/am/scripts.am (installcheck-%DIR%SCRIPTS): Likewise. * automake.texi (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. --- ChangeLog | 12 +++++++++ automake.texi | 12 +++++++-- lib/am/progs.am | 3 +++ lib/am/scripts.am | 3 +++ stamp-vti | 2 +- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/gnits3.test | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ version.texi | 2 +- 9 files changed, 112 insertions(+), 4 deletions(-) create mode 100755 tests/gnits3.test diff --git a/ChangeLog b/ChangeLog index 83cbbe8..f4eca45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2002-07-21 Alexandre Duret-Lutz + + * lib/am/progs.am (installcheck-%DIR%PROGRAMS): Honor + AM_INSTALLCHECK_STD_OPTIONS_EXEMPT. + * lib/am/scripts.am (installcheck-%DIR%SCRIPTS): Likewise. + * automake.texi (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 * tests/gnits2.test: Use --program-prefix. Test for scripts too. diff --git a/automake.texi b/automake.texi index 97271ee..3522308 100644 --- a/automake.texi +++ b/automake.texi @@ -4274,8 +4274,17 @@ letter; it should be omitted for non-alpha releases. @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 @@ -4600,8 +4609,7 @@ checks the following as well: @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 diff --git a/lib/am/progs.am b/lib/am/progs.am index 3c1c0e8..9afe0de 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -109,6 +109,9 @@ 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 \ + 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)/'`; \ diff --git a/lib/am/scripts.am b/lib/am/scripts.am index 9f24486..6b219d6 100644 --- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -88,6 +88,9 @@ 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 \ + 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. diff --git a/stamp-vti b/stamp-vti index e5cda01..b35254a 100644 --- a/stamp-vti +++ b/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 16 July 2002 +@set UPDATED 21 July 2002 @set UPDATED-MONTH July 2002 @set EDITION 1.6a @set VERSION 1.6a diff --git a/tests/Makefile.am b/tests/Makefile.am index dbed2d1..23bfee9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -178,6 +178,7 @@ gettext2.test \ gnuwarn.test \ gnits.test \ gnits2.test \ +gnits3.test \ header.test \ implicit.test \ include.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 1447a93..27e0d97 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -266,6 +266,7 @@ gettext2.test \ gnuwarn.test \ gnits.test \ gnits2.test \ +gnits3.test \ header.test \ implicit.test \ include.test \ diff --git a/tests/gnits3.test b/tests/gnits3.test new file mode 100755 index 0000000..256023b --- /dev/null +++ b/tests/gnits3.test @@ -0,0 +1,80 @@ +#! /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 < 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 diff --git a/version.texi b/version.texi index e5cda01..b35254a 100644 --- a/version.texi +++ b/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 16 July 2002 +@set UPDATED 21 July 2002 @set UPDATED-MONTH July 2002 @set EDITION 1.6a @set VERSION 1.6a -- 2.7.4