diff options
Diffstat (limited to 'bin/automake.in')
-rw-r--r-- | bin/automake.in | 61 |
1 files changed, 48 insertions, 13 deletions
diff --git a/bin/automake.in b/bin/automake.in index 19ea9538f..72c35793d 100644 --- a/bin/automake.in +++ b/bin/automake.in @@ -1,7 +1,7 @@ #!@PERL@ # automake - create Makefile.in from Makefile.am -*- perl -*- # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -199,11 +199,14 @@ my @libtool_files = qw(ltmain.sh config.guess config.sub); # ltconfig appears here for compatibility with old versions of libtool. my @libtool_sometimes = qw(ltconfig ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh); -# Commonly found files we look for and automatically include in -# DISTFILES. +# Top-level files that can be foo.md instead of foo. We assume that all +# but THANKS are required at strictness level gnu. +my @toplevelmd_ok = qw(AUTHORS ChangeLog INSTALL NEWS README THANKS); + +# Commonly found files we look for and automatically include in DISTFILES. my @common_files = - (qw(ABOUT-GNU ABOUT-NLS AUTHORS BACKLOG COPYING COPYING.DOC COPYING.LIB - COPYING.LESSER ChangeLog INSTALL NEWS README THANKS TODO + (qw(ABOUT-GNU ABOUT-NLS BACKLOG COPYING + COPYING.DOC COPYING.LIB COPYING.LESSER TODO ar-lib compile config.guess config.rpath config.sub depcomp install-sh libversion.in mdate-sh missing mkinstalldirs py-compile texinfo.tex ylwrap), @@ -3833,7 +3836,7 @@ sub handle_dist () $check_aux = 1; } } - foreach my $cfile (@common_files) + foreach my $cfile (@toplevelmd_ok, @common_files) { if (dir_has_case_matching_file ($relative_dir, $cfile) # The file might be absent, but if it can be built it's ok. @@ -3841,13 +3844,30 @@ sub handle_dist () { push_dist_common ($cfile); } + elsif (grep { $_ eq $cfile } @toplevelmd_ok) + { # Irritatingly, have to repeat the checks, now for .md files; + # we want to prefer non-.md, so do this second, and only "elsif". + if (dir_has_case_matching_file ($relative_dir, "$cfile.md") + || rule "$cfile.md") + { + push_dist_common ("$cfile.md"); + } + } # Don't use 'elsif' here because a file might meaningfully - # appear in both directories. + # appear in both $relative_dir and $config_aux_dir. if ($check_aux && dir_has_case_matching_file ($config_aux_dir, $cfile)) { push_dist_common ("$config_aux_dir/$cfile") } + elsif ($check_aux && grep { $_ eq $cfile } @toplevelmd_ok) + { + if (dir_has_case_matching_file ($config_aux_dir, "$cfile.md") + || rule "$cfile.md") + { + push_dist_common ("$cfile.md"); + } + } } # We might copy elements from @configure_dist_common to @@ -5119,11 +5139,12 @@ sub handle_minor_options () "version '$package_version' doesn't follow " . "Gnits standards"); } - if (defined $1 && -f 'README-alpha') + if (defined $1 && (-f 'README-alpha' || -f 'README-alpha.md')) { # This means we have an alpha release. See # GNITS_VERSION_PATTERN for details. - push_dist_common ('README-alpha'); + my $af = -f 'README-alpha' ? 'README-alpha' : 'README-alpha.md'; + push_dist_common ($af); } } } @@ -5610,8 +5631,16 @@ sub check_gnu_standards () if ($relative_dir eq '.') { # In top level (or only) directory. - require_file ("$am_file.am", GNU, - qw/INSTALL NEWS README AUTHORS ChangeLog/); + + foreach my $file (@toplevelmd_ok) + { + next if $file eq 'THANKS'; # gnits, checked below + # if non-.md is absent, and .md is present, require .md; + # otherwise require non-.md. + my $required + = (! -f $file && -f "$file.md") ? "$file.md" : $file; + require_file ("$am_file.am", GNU, $required); + } # Accept one of these three licenses; default to COPYING. # Make sure we do not overwrite an existing license. @@ -5642,7 +5671,10 @@ sub check_gnits_standards () if ($relative_dir eq '.') { # In top level (or only) directory. - require_file ("$am_file.am", GNITS, 'THANKS'); + my $file = 'THANKS'; + my $required + = (! -f $file && -f "$file.md") ? "$file.md" : $file; + require_file ("$am_file.am", GNITS, $file); } } @@ -8156,8 +8188,11 @@ Library files: "(always):\n"; print_autodist_files @common_files; print "\nFiles automatically distributed if found " . + "(as .md if needed):\n"; + print_autodist_files (map { "${_}[.md]" } @toplevelmd_ok); + print "\nFiles automatically distributed if found " . "(under certain conditions):\n"; - print_autodist_files @common_sometimes; + print_autodist_files @common_sometimes, 'README-alpha[.md]'; print ' Report bugs to <@PACKAGE_BUGREPORT@>. |