summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>2018-06-15 11:44:06 +0200
committerMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>2018-06-22 14:19:45 +0200
commit0d54a3da046150120fcb6c65ddc8fc5650d86191 (patch)
treee14166e4b0bc2699a50f1e9a97276c774783a591
parentc6eb8832ad2824d33c2c6203709f856fcb53bae8 (diff)
downloadautomake-0d54a3da046150120fcb6c65ddc8fc5650d86191.tar.gz
lib: Rearrange modules inclusions
The use directives are now rearranged to be more easily read (alphabetical order) and we removed some include cycles in the process. * Location.pm: This module now serves the INTERNAL constant.
-rw-r--r--lib/Automake/ChannelDefs.pm2
-rw-r--r--lib/Automake/Channels.pm3
-rw-r--r--lib/Automake/CondStack.pm6
-rw-r--r--lib/Automake/ConfVars.pm2
-rw-r--r--lib/Automake/Config.in3
-rw-r--r--lib/Automake/Configure_ac.pm3
-rw-r--r--lib/Automake/DisjConditions.pm1
-rw-r--r--lib/Automake/File.pm2
-rw-r--r--lib/Automake/FileUtils.pm5
-rw-r--r--lib/Automake/General.pm1
-rw-r--r--lib/Automake/Getopt.pm5
-rw-r--r--lib/Automake/Global.pm9
-rw-r--r--lib/Automake/Item.pm1
-rw-r--r--lib/Automake/Location.pm22
-rw-r--r--lib/Automake/Options.pm5
-rw-r--r--lib/Automake/Rule.pm9
-rw-r--r--lib/Automake/RuleDef.pm4
-rw-r--r--lib/Automake/Utils.pm5
-rw-r--r--lib/Automake/VarDef.pm4
-rw-r--r--lib/Automake/Variable.pm16
-rw-r--r--lib/Automake/Version.pm1
-rw-r--r--lib/Automake/Wrap.pm2
-rw-r--r--lib/Automake/XFile.pm11
23 files changed, 79 insertions, 43 deletions
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index c9265f363..e4f7f4a20 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -15,6 +15,7 @@
package Automake::ChannelDefs;
+use Automake::Channels;
use Automake::Config;
BEGIN
{
@@ -24,7 +25,6 @@ BEGIN
import threads;
}
}
-use Automake::Channels;
=head1 NAME
diff --git a/lib/Automake/Channels.pm b/lib/Automake/Channels.pm
index 5713bbf6d..9d17fe5c7 100644
--- a/lib/Automake/Channels.pm
+++ b/lib/Automake/Channels.pm
@@ -68,8 +68,9 @@ etc.) that can also be overridden on a per-message basis.
use 5.006;
use strict;
-use Exporter;
use Carp;
+
+use Exporter;
use File::Basename;
use vars qw (@ISA @EXPORT %channels $me);
diff --git a/lib/Automake/CondStack.pm b/lib/Automake/CondStack.pm
index 286ecfd49..361738191 100644
--- a/lib/Automake/CondStack.pm
+++ b/lib/Automake/CondStack.pm
@@ -18,11 +18,11 @@ package Automake::CondStack;
use 5.006;
use strict;
-use Exporter;
+use Automake::ChannelDefs;
use Automake::Condition qw (TRUE FALSE);
-use Automake::Global;
use Automake::Channels;
-use Automake::ChannelDefs;
+use Automake::Global;
+use Exporter;
use vars qw (@ISA @EXPORT);
diff --git a/lib/Automake/ConfVars.pm b/lib/Automake/ConfVars.pm
index 5acf017e7..006147e24 100644
--- a/lib/Automake/ConfVars.pm
+++ b/lib/Automake/ConfVars.pm
@@ -18,7 +18,6 @@ package Automake::ConfVars;
use 5.006;
use strict;
-use Exporter;
use Automake::ChannelDefs;
use Automake::Channels;
use Automake::Condition qw (TRUE FALSE);
@@ -29,6 +28,7 @@ use Automake::Location;
use Automake::Utils;
use Automake::VarDef;
use Automake::Variable;
+use Exporter;
use vars qw (@ISA @EXPORT);
diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in
index 6edac116b..777fe3722 100644
--- a/lib/Automake/Config.in
+++ b/lib/Automake/Config.in
@@ -16,9 +16,10 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
package Automake::Config;
-use strict;
+use strict;
use 5.006;
+
require Exporter;
our @ISA = qw (Exporter);
diff --git a/lib/Automake/Configure_ac.pm b/lib/Automake/Configure_ac.pm
index 00aaebe69..18bfa5e03 100644
--- a/lib/Automake/Configure_ac.pm
+++ b/lib/Automake/Configure_ac.pm
@@ -22,9 +22,10 @@ package Automake::Configure_ac;
use 5.006;
use strict;
-use Exporter;
+
use Automake::Channels;
use Automake::ChannelDefs;
+use Exporter;
use vars qw (@ISA @EXPORT);
diff --git a/lib/Automake/DisjConditions.pm b/lib/Automake/DisjConditions.pm
index e5ef10805..9e431c040 100644
--- a/lib/Automake/DisjConditions.pm
+++ b/lib/Automake/DisjConditions.pm
@@ -18,6 +18,7 @@ package Automake::DisjConditions;
use 5.006;
use strict;
use Carp;
+
use Automake::Condition qw/TRUE FALSE/;
=head1 NAME
diff --git a/lib/Automake/File.pm b/lib/Automake/File.pm
index 9a34543fa..89cc4776e 100644
--- a/lib/Automake/File.pm
+++ b/lib/Automake/File.pm
@@ -18,7 +18,6 @@ package Automake::File;
use 5.006;
use strict;
-use Exporter;
use Automake::ChannelDefs;
use Automake::Channels;
use Automake::Condition qw (TRUE FALSE);
@@ -31,6 +30,7 @@ use Automake::RuleDef;
use Automake::Utils;
use Automake::VarDef;
use Automake::Variable;
+use Exporter;
use vars qw (@ISA @EXPORT);
diff --git a/lib/Automake/FileUtils.pm b/lib/Automake/FileUtils.pm
index 7ebf547e0..43b66966a 100644
--- a/lib/Automake/FileUtils.pm
+++ b/lib/Automake/FileUtils.pm
@@ -36,11 +36,12 @@ This perl module provides various general purpose file handling functions.
use 5.006;
use strict;
+
+use Automake::Channels;
+use Automake::ChannelDefs;
use Exporter;
use File::stat;
use IO::File;
-use Automake::Channels;
-use Automake::ChannelDefs;
use vars qw (@ISA @EXPORT);
diff --git a/lib/Automake/General.pm b/lib/Automake/General.pm
index aa2de38b8..f9ec8c67f 100644
--- a/lib/Automake/General.pm
+++ b/lib/Automake/General.pm
@@ -17,6 +17,7 @@ package Automake::General;
use 5.006;
use strict;
+
use Exporter;
use File::Basename;
diff --git a/lib/Automake/Getopt.pm b/lib/Automake/Getopt.pm
index 28b385202..c6614f2cc 100644
--- a/lib/Automake/Getopt.pm
+++ b/lib/Automake/Getopt.pm
@@ -33,10 +33,11 @@ line options in conformance to the GNU Coding standards.
use 5.006;
use strict;
use warnings FATAL => 'all';
+use Carp qw/croak confess/;
+
+use Automake::ChannelDefs qw/fatal/;
use Exporter ();
use Getopt::Long ();
-use Automake::ChannelDefs qw/fatal/;
-use Carp qw/croak confess/;
use vars qw (@ISA @EXPORT);
@ISA = qw (Exporter);
diff --git a/lib/Automake/Global.pm b/lib/Automake/Global.pm
index 00e50cd5d..b025fc9f3 100644
--- a/lib/Automake/Global.pm
+++ b/lib/Automake/Global.pm
@@ -17,9 +17,8 @@ package Automake::Global;
use 5.006;
use strict;
-use Exporter;
-use Automake::Location;
+use Exporter;
use vars qw (@ISA @EXPORT);
@@ -50,7 +49,7 @@ use vars qw (@ISA @EXPORT);
$need_link $must_handle_compiled_objects %transformed_files
AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET MOSTLY_CLEAN
CLEAN DIST_CLEAN MAINTAINER_CLEAN LANG_IGNORE LANG_PROCESS LANG_SUBDIR
- COMPILE_LIBTOOL COMPILE_ORDINARY INTERNAL QUEUE_MESSAGE QUEUE_CONF_FILE
+ COMPILE_LIBTOOL COMPILE_ORDINARY QUEUE_MESSAGE QUEUE_CONF_FILE
QUEUE_LOCATION QUEUE_STRING);
## ----------- ##
@@ -157,10 +156,6 @@ use constant LANG_SUBDIR => 2;
use constant COMPILE_LIBTOOL => 1;
use constant COMPILE_ORDINARY => 2;
-# We can't always associate a location to a variable or a rule,
-# when it's defined by Automake. We use INTERNAL in this case.
-use constant INTERNAL => new Automake::Location;
-
# Serialization keys for message queues.
use constant QUEUE_MESSAGE => "msg";
use constant QUEUE_CONF_FILE => "conf file";
diff --git a/lib/Automake/Item.pm b/lib/Automake/Item.pm
index fe6125612..e370edf29 100644
--- a/lib/Automake/Item.pm
+++ b/lib/Automake/Item.pm
@@ -18,6 +18,7 @@ package Automake::Item;
use 5.006;
use strict;
use Carp;
+
use Automake::ChannelDefs;
use Automake::DisjConditions;
diff --git a/lib/Automake/Location.pm b/lib/Automake/Location.pm
index 77a34c505..3d368ca9e 100644
--- a/lib/Automake/Location.pm
+++ b/lib/Automake/Location.pm
@@ -17,6 +17,14 @@ package Automake::Location;
use 5.006;
+use Exporter;
+
+use vars qw (@ISA @EXPORT);
+
+@ISA = qw (Exporter);
+
+@EXPORT = qw (INTERNAL);
+
=head1 NAME
Automake::Location - a class for location tracking, with a stack of contexts
@@ -86,6 +94,18 @@ You can pass a C<Location> to C<Automake::Channels::msg>.
=cut
+=head2 Constants
+
+=over
+
+=item C<INTERNAL>
+
+We can't always associate a location to a variable or a rule, when it's
+defined by Automake. We use C<INTERNAL> in this case.
+
+=cut
+
+
=head2 Methods
=over
@@ -107,6 +127,8 @@ sub new ($;$)
return $self;
}
+use constant INTERNAL => new Automake::Location;
+
=item C<$location-E<gt>set ($position)>
Change the location to be C<$position>.
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index 8a1adc9ff..ce123d629 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -17,11 +17,12 @@ package Automake::Options;
use 5.006;
use strict;
-use Exporter;
-use Automake::Config;
+
use Automake::ChannelDefs;
use Automake::Channels;
+use Automake::Config;
use Automake::Version;
+use Exporter;
use vars qw (@ISA @EXPORT);
diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm
index 14c2f218b..7245bf2f1 100644
--- a/lib/Automake/Rule.pm
+++ b/lib/Automake/Rule.pm
@@ -19,15 +19,16 @@ use 5.006;
use strict;
use Carp;
-use Automake::Item;
-use Automake::RuleDef;
use Automake::ChannelDefs;
use Automake::Channels;
-use Automake::Options;
use Automake::Condition qw (TRUE FALSE);
use Automake::DisjConditions;
+use Automake::Item;
+use Automake::Options;
+use Automake::RuleDef;
require Exporter;
-use vars '@ISA', '@EXPORT', '@EXPORT_OK';
+
+use vars '@ISA', '@EXPORT';
@ISA = qw/Automake::Item Exporter/;
@EXPORT = qw (reset register_suffix_rule next_in_suffix_chain
suffixes rules $KNOWN_EXTENSIONS_PATTERN
diff --git a/lib/Automake/RuleDef.pm b/lib/Automake/RuleDef.pm
index 831d87f83..928db9691 100644
--- a/lib/Automake/RuleDef.pm
+++ b/lib/Automake/RuleDef.pm
@@ -18,11 +18,13 @@ package Automake::RuleDef;
use 5.006;
use strict;
use Carp;
+
use Automake::ChannelDefs;
use Automake::ItemDef;
-
require Exporter;
+
use vars '@ISA', '@EXPORT';
+
@ISA = qw/Automake::ItemDef Exporter/;
@EXPORT = qw (&RULE_AUTOMAKE &RULE_USER);
diff --git a/lib/Automake/Utils.pm b/lib/Automake/Utils.pm
index aa4a2d906..c273d943e 100644
--- a/lib/Automake/Utils.pm
+++ b/lib/Automake/Utils.pm
@@ -17,14 +17,15 @@ package Automake::Utils;
use 5.006;
use strict;
-use Exporter;
+
use Automake::Global;
use Automake::Location;
use Automake::Options;
use Automake::XFile;
use Automake::ChannelDefs;
-use Automake::Variable;
+use Automake::Variable 'var';
use Automake::Rule;
+use Exporter;
use vars qw (@ISA @EXPORT);
diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm
index 93d0487ea..d978b3189 100644
--- a/lib/Automake/VarDef.pm
+++ b/lib/Automake/VarDef.pm
@@ -18,11 +18,13 @@ package Automake::VarDef;
use 5.006;
use strict;
use Carp;
+
use Automake::ChannelDefs;
use Automake::ItemDef;
-
require Exporter;
+
use vars '@ISA', '@EXPORT';
+
@ISA = qw/Automake::ItemDef Exporter/;
@EXPORT = qw (&VAR_AUTOMAKE &VAR_CONFIGURE &VAR_MAKEFILE
&VAR_ASIS &VAR_PRETTY &VAR_SILENT &VAR_SORTED);
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index 8732eb87a..5dea97e7f 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -19,23 +19,23 @@ use 5.006;
use strict;
use Carp;
-use Automake::Channels;
use Automake::ChannelDefs;
+use Automake::Channels;
+use Automake::Condition qw (TRUE FALSE);
use Automake::Config;
use Automake::Configure_ac;
-use Automake::Item;
-use Automake::VarDef;
-use Automake::Condition qw (TRUE FALSE);
use Automake::DisjConditions;
+use Automake::File;
use Automake::General 'uniq';
-use Automake::Wrap 'makefile_wrap';
use Automake::Global;
+use Automake::Item;
use Automake::Location;
-use Automake::Utils;
-use Automake::File;
-
+use Automake::VarDef;
+use Automake::Wrap 'makefile_wrap';
require Exporter;
+
use vars '@ISA', '@EXPORT', '@EXPORT_OK';
+
@ISA = qw/Automake::Item Exporter/;
@EXPORT = qw (err_var msg_var msg_cond_var reject_var
var rvar vardef rvardef
diff --git a/lib/Automake/Version.pm b/lib/Automake/Version.pm
index 3d5c22bc2..05625a06c 100644
--- a/lib/Automake/Version.pm
+++ b/lib/Automake/Version.pm
@@ -17,6 +17,7 @@ package Automake::Version;
use 5.006;
use strict;
+
use Automake::ChannelDefs;
=head1 NAME
diff --git a/lib/Automake/Wrap.pm b/lib/Automake/Wrap.pm
index 0efd2da4b..34570ada2 100644
--- a/lib/Automake/Wrap.pm
+++ b/lib/Automake/Wrap.pm
@@ -19,7 +19,9 @@ use 5.006;
use strict;
require Exporter;
+
use vars '@ISA', '@EXPORT_OK';
+
@ISA = qw/Exporter/;
@EXPORT_OK = qw/wrap makefile_wrap/;
diff --git a/lib/Automake/XFile.pm b/lib/Automake/XFile.pm
index 856661c32..259235f5f 100644
--- a/lib/Automake/XFile.pm
+++ b/lib/Automake/XFile.pm
@@ -71,17 +71,18 @@ and C<getlines> methods to translate C<\r\n> to C<\n>.
use 5.006;
use strict;
-use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
use Carp;
use Errno;
-use IO::File;
-use File::Basename;
+
use Automake::ChannelDefs;
use Automake::Channels qw(msg);
use Automake::FileUtils;
-
-require Exporter;
require DynaLoader;
+require Exporter;
+use File::Basename;
+use IO::File;
+
+use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
@ISA = qw(IO::File Exporter DynaLoader);