automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: latest automake vs sh-utils' false (false --help fails)


From: Alexandre Duret-Lutz
Subject: Re: latest automake vs sh-utils' false (false --help fails)
Date: 21 Jul 2002 12:20:20 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>> "Jim" == Jim Meyering <address@hidden> writes:

 Jim> Alexandre Duret-Lutz <address@hidden> wrote:
 >> [...]
 >> 
 Jim> Actually false does support those options,
 Jim> but, as an exception to the GNU Coding Standards,
 Jim> it exits with non-zero status even when (otherwise)
 Jim> honoring those options.
 >> 
 Jim> So I guess I need to be able to filter out `false' from that list.

[...]

 >> have a list a programs and scripts (or two lists) to ignore
 >> in this tests?

 Jim> Sounds fine.

 >> How would you name it? AM_INSTALLCHECK_STD_OPTIONS_IGNORE?

 Jim> or one of these:

 Jim> AM_INSTALLCHECK_STD_OPTIONS_EXEMPT
 Jim> AM_INSTALLCHECK_STD_OPTIONS_EXCLUDE

Here is a patch for this.  I'd like to wait until we hear from the other,
in case they come with better ideas.

2002-07-21  Alexandre Duret-Lutz  <address@hidden>

        * 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.

Index: automake.texi
===================================================================
RCS file: /cvs/automake/automake/automake.texi,v
retrieving revision 1.291
diff -u -r1.291 automake.texi
--- automake.texi       16 Jul 2002 21:46:59 -0000      1.291
+++ automake.texi       21 Jul 2002 10:21:03 -0000
@@ -4274,8 +4274,17 @@
 
 @item @code{std-options}
 @cindex Options, std-options
address@hidden 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.
+
address@hidden 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 @@
 @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
Index: lib/am/progs.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/progs.am,v
retrieving revision 1.38
diff -u -r1.38 progs.am
--- lib/am/progs.am     20 Jul 2002 15:48:34 -0000      1.38
+++ lib/am/progs.am     21 Jul 2002 10:21:03 -0000
@@ -109,6 +109,9 @@
 .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)/'`; \
Index: lib/am/scripts.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/scripts.am,v
retrieving revision 1.47
diff -u -r1.47 scripts.am
--- lib/am/scripts.am   20 Jul 2002 15:48:34 -0000      1.47
+++ lib/am/scripts.am   21 Jul 2002 10:21:04 -0000
@@ -88,6 +88,9 @@
 .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.
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.421
diff -u -r1.421 Makefile.am
--- tests/Makefile.am   19 Jul 2002 20:23:38 -0000      1.421
+++ tests/Makefile.am   21 Jul 2002 10:21:05 -0000
@@ -178,6 +178,7 @@
 gnuwarn.test \
 gnits.test \
 gnits2.test \
+gnits3.test \
 header.test \
 implicit.test \
 include.test \
Index: tests/gnits3.test
===================================================================
RCS file: tests/gnits3.test
diff -N tests/gnits3.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/gnits3.test   21 Jul 2002 10:21:05 -0000
@@ -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 <<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 rule (they need GNU make).
+$MAKE installcheck

-- 
Alexandre Duret-Lutz




reply via email to

[Prev in Thread] Current Thread [Next in Thread]