This change fixes automake bug#7819.
* automake.in (usage): Distinguish between files that are always
automatically distributed when found, and those which are only
"under certain conditions".
* doc/automake.texi (Basics of Distribution): Update accordingly.
* tests/autodist-subdir.test: Update.
* tests/autodist-no-duplicate.test: Likewise.
* tests/autodist.test: Likewise.
(configure.in): Remove useless call to AM_MAINTAINER_MODE.
2011-06-23 Stefano Lattarini <stefano.lattarini@gmail.com>
+ help: improve text about automatically-distributed files
+ This change fixes automake bug#7819.
+ * automake.in (usage): Distinguish between files that are always
+ automatically distributed when found, and those which are only
+ "under certain conditions".
+ * doc/automake.texi (Basics of Distribution): Update accordingly.
+ * tests/autodist-subdir.test: Update.
+ * tests/autodist-no-duplicate.test: Likewise.
+ * tests/autodist.test: Likewise.
+ (configure.in): Remove useless call to AM_MAINTAINER_MODE.
+
+2011-06-23 Stefano Lattarini <stefano.lattarini@gmail.com>
+
refactor: split 'usage' subroutine in automake
This change is related to automake bug#7819.
* automake.in (print_autodist_files): New subroutine,
";
Automake::ChannelDefs::usage;
- print "\nFiles which are automatically distributed, if found:\n";
- print_autodist_files (@common_files, @common_sometimes);
+ print "\nFiles automatically distributed if found " .
+ "(always):\n";
+ print_autodist_files @common_files;
+ print "\nFiles automatically distributed if found " .
+ "(under certain conditions):\n";
+ print_autodist_files @common_sometimes;
print '
Report bugs to <@PACKAGE_BUGREPORT@>.
has a built-in list of commonly used files that are automatically
included if they are found in the current directory (either physically,
or as the target of a @file{Makefile.am} rule). This list is printed by
-@samp{automake --help}. Also, files that are read by @command{configure}
+@samp{automake --help}@footnote{Note that some of these files are actually
+distributed only when other certain conditions hold}. Also, files that
+are read by @command{configure}
(i.e.@: the source files corresponding to the files specified in various
Autoconf macros such as @code{AC_CONFIG_FILES} and siblings) are
automatically distributed. Files included in @file{Makefile.am}s (using
set -e
+re='Files .*automatically distributed.*if found'
+
# The automake manual states that the list of automatically-distributed
# files should be given by `automake --help'.
-list=`$AUTOMAKE --help \
- | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+
+list1=`$AUTOMAKE --help \
+ | sed -n "/^$re.*always/,/^ *$/p" \
+ | sed 1d`
+list1=`echo $list1`
+
+list2=`$AUTOMAKE --help \
+ | sed -n "/^$re.*under certain conditions/,/^ *$/p" \
| sed 1d`
-list=`echo $list`
-test -n "$list"
+list2=`echo $list2`
-for f in $list; do echo $f; done | sort > files.lst
-uniq files.lst > files.uniq
+test -n "$list1"
+test -n "$list2"
-cat files.lst
-cat files.uniq
-diff files.lst files.uniq
+st=0
+for i in 1 2; do
+ eval list=\${list$i}
+ for f in $list; do echo $f; done | sort > files$i.lst
+ uniq files$i.lst > files$i.uniq
+ cat files$i.lst
+ cat files$i.uniq
+ diff files$i.lst files$i.uniq || st=1
+done
-:
+Exit $st
# The automake manual states that the list of automatically-distributed
# files should be given by `automake --help'.
list=`$AUTOMAKE --help \
- | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+ | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
| sed 1d`
-list=`for f in $list; do
- case $f in
- configure|configure.in|configure.ac)
- # See test 'autodist-configure-no-subdir.test'.
- ;;
- aclocal.m4)
- # This file should be distributed only when it is a real
- # dependency for configure. Anyway, not a check to be
- # performed in this test.
- ;;
- acconfig.h)
- # Works only when it really exists, not when it is a
- # target in Makefile.am.
- ;;
- stamp-vti)
- # Works only when using info_TEXINFOS and version.texi.
- ;;
- config.h.bot|config.h.top)
- # Works only when the AC_CONFIG_HADERS macro is used.
- ;;
- *)
- echo $f
- ;;
- esac
- done`
# Normalize whitespace, just in case.
list=`echo $list`
AC_INIT([$me], [1.0])
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE
-## Will avoid useless regeneration of aclocal.m4, configure, etc.
-AM_MAINTAINER_MODE
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
# The automake manual states that the list of automatically-distributed
# files should be given by `automake --help'.
list=`$AUTOMAKE --help \
- | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+ | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
| sed 1d`
-list=`for f in $list; do
- case $f in
- configure|configure.in|configure.ac)
- # See test 'autodist-configure-no-subdir.test'.
- ;;
- aclocal.m4)
- # This file should be distributed only when it is a real
- # dependency for configure. Anyway, not a check to be
- # performed in this test.
- ;;
- acconfig.h)
- # Works only when it really exists, not when it is a
- # target in Makefile.am.
- ;;
- stamp-vti)
- # Works only when using info_TEXINFOS and version.texi.
- ;;
- config.h.bot|config.h.top)
- # Works only when the AC_CONFIG_HADERS macro is used.
- ;;
- *)
- echo $f
- ;;
- esac
- done`
# Normalize whitespace, just in case.
list=`echo $list`