summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>2018-06-19 15:54:58 +0200
committerMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>2018-06-22 14:20:12 +0200
commit916b23672c8ddbee121ca375eb6ae246e6fb3a84 (patch)
tree39a4a520f18e044f798e193cf10af2af0d748538
parent58b5e5d82f93561188d3540188b3f19bb7690424 (diff)
downloadautomake-916b23672c8ddbee121ca375eb6ae246e6fb3a84.tar.gz
Add the Errors.pm perl module
This module takes care of outputing errors for Makefile.am and Configure.ac files. * lib/Automake/Errors.pm: New file for printing errors about am and ac files.
-rwxr-xr-xbin/automake.in35
-rw-r--r--lib/Automake/Errors.pm83
-rw-r--r--lib/Automake/local.mk1
3 files changed, 85 insertions, 34 deletions
diff --git a/bin/automake.in b/bin/automake.in
index 18a6fbf3e..ca9548518 100755
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -71,6 +71,7 @@ use Automake::Language;
use Automake::Utils;
use Automake::CondStack;
use Automake::ConfVars;
+use Automake::Errors;
use File::Basename;
use File::Spec;
use Carp;
@@ -575,41 +576,7 @@ register_language ('name' => 'java',
################################################################
-# Error reporting functions.
-# err_am ($MESSAGE, [%OPTIONS])
-# -----------------------------
-# Uncategorized errors about the current Makefile.am.
-sub err_am
-{
- msg_am ('error', @_);
-}
-
-# err_ac ($MESSAGE, [%OPTIONS])
-# -----------------------------
-# Uncategorized errors about configure.ac.
-sub err_ac
-{
- msg_ac ('error', @_);
-}
-
-# msg_am ($CHANNEL, $MESSAGE, [%OPTIONS])
-# ---------------------------------------
-# Messages about about the current Makefile.am.
-sub msg_am
-{
- my ($channel, $msg, %opts) = @_;
- msg $channel, "${am_file}.am", $msg, %opts;
-}
-
-# msg_ac ($CHANNEL, $MESSAGE, [%OPTIONS])
-# ---------------------------------------
-# Messages about about configure.ac.
-sub msg_ac
-{
- my ($channel, $msg, %opts) = @_;
- msg $channel, $configure_ac, $msg, %opts;
-}
################################################################
diff --git a/lib/Automake/Errors.pm b/lib/Automake/Errors.pm
new file mode 100644
index 000000000..7d11e0aaa
--- /dev/null
+++ b/lib/Automake/Errors.pm
@@ -0,0 +1,83 @@
+# 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 <http://www.gnu.org/licenses/>.
+
+package Automake::Errors;
+
+use strict;
+use 5.006;
+
+use Automake::Channels;
+use Automake::Global;
+use Exporter;
+
+use vars '@ISA', '@EXPORT';
+
+@ISA = qw (Exporter);
+
+@EXPORT = qw (err_am err_ac);
+
+=head1 NAME
+
+Automake::Errors - Functions for printing error messages about am and ac
+files
+
+=head1 DESCRIPTION
+
+This package provides two methods for printing errors about
+C<Makefile.am> and C<configure.ac> files.
+
+=head2 FUNCTIONS
+
+=cut
+
+# _msg_am ($CHANNEL, $MESSAGE, [%OPTIONS])
+#---------------------------------------
+# Messages about about the current Makefile.am.
+sub _msg_am
+{
+ my ($channel, $msg, %opts) = @_;
+ msg $channel, "${am_file}.am", $msg, %opts;
+}
+
+# _msg_ac ($CHANNEL, $MESSAGE, [%OPTIONS])
+# ---------------------------------------
+# Messages about about configure.ac.
+sub _msg_ac
+{
+ my ($channel, $msg, %opts) = @_;
+ msg $channel, $configure_ac, $msg, %opts;
+}
+
+=item C<err_am ($MESSAGE, [%OPTIONS])>
+
+Uncategorized errors about the current Makefile.am.
+
+=cut
+
+sub err_am
+{
+ _msg_am ('error', @_);
+}
+
+=item C<err_ac ($MESSAGE, [%OPTIONS])>
+
+Uncategorized errors about configure.ac.
+
+=cut
+
+sub err_ac
+{
+ _msg_ac ('error', @_);
+}
diff --git a/lib/Automake/local.mk b/lib/Automake/local.mk
index 16c56d819..bdc7aa066 100644
--- a/lib/Automake/local.mk
+++ b/lib/Automake/local.mk
@@ -28,6 +28,7 @@ dist_perllib_DATA = \
%D%/Configure_ac.pm \
%D%/ConfVars.pm \
%D%/DisjConditions.pm \
+ %D%/Errors.pm \
%D%/File.pm \
%D%/FileUtils.pm \
%D%/General.pm \