summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Paulmier <matt@mpaulmier.home>2018-07-02 12:07:22 +0200
committerMatthias Paulmier <matt@mpaulmier.home>2018-07-02 14:05:50 +0200
commitee8c73d1e23e5352412aebbfa23d38ae7e680314 (patch)
tree40b223d4cba492927fc10e30e64022bd8abdf107
parent2e028d54b9f13a8df0033e874e8ca4bffbb9d21b (diff)
downloadautomake-ee8c73d1e23e5352412aebbfa23d38ae7e680314.tar.gz
Add the Standards.pm library
The library provides functions for checking that the required files in a given standard (GNU org GNITS) are present.
-rwxr-xr-xbin/automake.in47
-rw-r--r--lib/Automake/Standards.pm74
-rw-r--r--lib/Automake/local.mk1
3 files changed, 76 insertions, 46 deletions
diff --git a/bin/automake.in b/bin/automake.in
index b17ad7bd1..301c850e4 100755
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -70,6 +70,7 @@ use Automake::Requires;
use Automake::Rule;
use Automake::RuleDef;
use Automake::SilentRules;
+use Automake::Standards;
use Automake::Texi;
use Automake::Utils;
use Automake::VarDef;
@@ -90,8 +91,6 @@ sub append_exeext (&$);
sub check_canonical_spelling;
sub check_directories_in_var;
sub check_directory;
-sub check_gnits_standards ();
-sub check_gnu_standards ();
sub check_libobjs_sources;
sub check_trailing_slash ($\$);
sub check_typos ();
@@ -4396,50 +4395,6 @@ sub scan_autoconf_files ()
@configure_dist_common = @dist_common;
}
-################################################################
-
-# Do any extra checking for GNU standards.
-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/);
-
- # Accept one of these three licenses; default to COPYING.
- # Make sure we do not overwrite an existing license.
- my $license;
- foreach (qw /COPYING COPYING.LIB COPYING.LESSER/)
- {
- if (-f $_)
- {
- $license = $_;
- last;
- }
- }
- require_file ("$am_file.am", GNU, 'COPYING')
- unless $license;
- }
-
- for my $opt ('no-installman', 'no-installinfo')
- {
- msg ('error-gnu', option $opt,
- "option '$opt' disallowed by GNU standards")
- if option $opt;
- }
-}
-
-# Do any extra checking for GNITS standards.
-sub check_gnits_standards ()
-{
- if ($relative_dir eq '.')
- {
- # In top level (or only) directory.
- require_file ("$am_file.am", GNITS, 'THANKS');
- }
-}
-
################################################################
diff --git a/lib/Automake/Standards.pm b/lib/Automake/Standards.pm
new file mode 100644
index 000000000..854a271ee
--- /dev/null
+++ b/lib/Automake/Standards.pm
@@ -0,0 +1,74 @@
+# Copyright (C) 2018 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+package Automake::Standards;
+
+use Automake::Channels;
+use Automake::Global;
+use Automake::Options;
+use Automake::Requires;
+use Automake::Utils;
+use Exporter 'import';
+
+use vars qw (@EXPORT);
+
+@EXPORT = qw (check_gnu_standards check_gnits_standards);
+
+
+# Do any extra checking for GNU standards.
+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/);
+
+ # Accept one of these three licenses; default to COPYING.
+ # Make sure we do not overwrite an existing license.
+ my $license;
+ foreach (qw /COPYING COPYING.LIB COPYING.LESSER/)
+ {
+ if (-f $_)
+ {
+ $license = $_;
+ last;
+ }
+ }
+ require_file ("$am_file.am", GNU, 'COPYING')
+ unless $license;
+ }
+
+ for my $opt ('no-installman', 'no-installinfo')
+ {
+ msg ('error-gnu', option $opt,
+ "option '$opt' disallowed by GNU standards")
+ if option $opt;
+ }
+}
+
+
+# Do any extra checking for GNITS standards.
+sub check_gnits_standards ()
+{
+ if ($relative_dir eq '.')
+ {
+ # In top level (or only) directory.
+ require_file ("$am_file.am", GNITS, 'THANKS');
+ }
+}
+
+
+1;
diff --git a/lib/Automake/local.mk b/lib/Automake/local.mk
index b0e0fca66..46668c65f 100644
--- a/lib/Automake/local.mk
+++ b/lib/Automake/local.mk
@@ -44,6 +44,7 @@ dist_perllib_DATA = \
%D%/Rule.pm \
%D%/RuleDef.pm \
%D%/SilentRules.pm \
+ %D%/Standards.pm \
%D%/Texi.pm \
%D%/Utils.pm \
%D%/VarAppend.pm \