]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
lib: Rearrange modules inclusions
authorMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>
Fri, 15 Jun 2018 09:44:06 +0000 (11:44 +0200)
committerMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>
Fri, 22 Jun 2018 12:19:45 +0000 (14:19 +0200)
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.

23 files changed:
lib/Automake/ChannelDefs.pm
lib/Automake/Channels.pm
lib/Automake/CondStack.pm
lib/Automake/ConfVars.pm
lib/Automake/Config.in
lib/Automake/Configure_ac.pm
lib/Automake/DisjConditions.pm
lib/Automake/File.pm
lib/Automake/FileUtils.pm
lib/Automake/General.pm
lib/Automake/Getopt.pm
lib/Automake/Global.pm
lib/Automake/Item.pm
lib/Automake/Location.pm
lib/Automake/Options.pm
lib/Automake/Rule.pm
lib/Automake/RuleDef.pm
lib/Automake/Utils.pm
lib/Automake/VarDef.pm
lib/Automake/Variable.pm
lib/Automake/Version.pm
lib/Automake/Wrap.pm
lib/Automake/XFile.pm

index c9265f3633870834f0040ce210c35e27a3dd2927..e4f7f4a20b8ae1d6318284693bf6ea2a81db6cb6 100644 (file)
@@ -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
 
index 5713bbf6d0f6dc71ee477865ba1075f3f98dd5e4..9d17fe5c7104890b8d6db5f990b91e5663c6b091 100644 (file)
@@ -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);
index 286ecfd4979fcf2cc1d2ccd0e3551d917d273844..3617381915322ff961c7c1d6ddeced91eacc49b5 100644 (file)
@@ -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);
 
index 5acf017e7e041de97573e9ab2a3b1284142be0a4..006147e24b4ce43251c48c3c081efa71673cc16d 100644 (file)
@@ -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);
 
index 6edac116b2329aac699086b92661f1f195befdb6..777fe3722761353d93e178a40671be6ab621cdcb 100644 (file)
 # 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);
index 00aaebe69f73ede337992d1f4e2cd5324af165bd..18bfa5e031db186c955448fb642a8077f0d9fa1f 100644 (file)
@@ -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);
 
index e5ef10805b85b277cdbe66bf675c5acdb13e38ec..9e431c0409eacfc44a353c96f67e8df90ee86f73 100644 (file)
@@ -18,6 +18,7 @@ package Automake::DisjConditions;
 use 5.006;
 use strict;
 use Carp;
+
 use Automake::Condition qw/TRUE FALSE/;
 
 =head1 NAME
index 9a34543fa88bbff8a053d9839375e363d1ac2cc1..89cc4776eea6faef34a97ba1489031781ef342f2 100644 (file)
@@ -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);
 
index 7ebf547e045503d657be7d6f8986eb82ec2c0fe0..43b66966a2ebe44b138c8d19439d8b7196e6249b 100644 (file)
@@ -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);
 
index aa2de38b8d98acd573d4c28110e97b4d1bde85e7..f9ec8c67f8fba742b755033fdd936c05f048df5b 100644 (file)
@@ -17,6 +17,7 @@ package Automake::General;
 
 use 5.006;
 use strict;
+
 use Exporter;
 use File::Basename;
 
index 28b3852027d781ca7024922848ddbdd8422b694b..c6614f2cce4b60747ef88d3e20f826d7e97c6bda 100644 (file)
@@ -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);
index 00e50cd5dece76ab89449795f29b9728a4003897..b025fc9f3008dfe6fde374ff71a5d910092ac474 100644 (file)
@@ -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";
index fe61256125a424de3b81d21c0d8f7b69c1369033..e370edf292f5040be8788e773d71ba1f1d0154d3 100644 (file)
@@ -18,6 +18,7 @@ package Automake::Item;
 use 5.006;
 use strict;
 use Carp;
+
 use Automake::ChannelDefs;
 use Automake::DisjConditions;
 
index 77a34c505cecf5e802c974b38406e3e44cc6fc45..3d368ca9e59436072ee7d30c89b58f34bc3ee29b 100644 (file)
@@ -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>.
index 8a1adc9ff54921af31e50cfb0a1fed996e2e6d6e..ce123d6293dc94d29d7a4b5daa6ccde43b0a9c98 100644 (file)
@@ -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);
 
index 14c2f218bd2af24b8a17ebe0727b72bfaab12c9a..7245bf2f1abce3279d0b49aef73608f4e90a9d62 100644 (file)
@@ -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
index 831d87f83acf475b78793d88fad86e318655f90c..928db96919ca5785a656fc1b853531ce3ed073e2 100644 (file)
@@ -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);
 
index aa4a2d906045e8a17c5b8d474f1cc63f40a81dac..c273d943e3711bf81f5bc5f84d058a8985dd70ce 100644 (file)
@@ -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);
 
index 93d0487ea887610578c3bb3b7d96407a9616af80..d978b3189d2328e9f5b46db92abe36655e691042 100644 (file)
@@ -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);
index 8732eb87a67268c9ba6680e664d3db570d91c4e7..5dea97e7f6cedde8b628ce00567e81355b67c79f 100644 (file)
@@ -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
index 3d5c22bc24522583d897a603c2c1acf8b7fd4c03..05625a06c415aeac256024a82adc596ece925d3a 100644 (file)
@@ -17,6 +17,7 @@ package Automake::Version;
 
 use 5.006;
 use strict;
+
 use Automake::ChannelDefs;
 
 =head1 NAME
index 0efd2da4b0f9495b6fa19de60d9202d4cbf4e0c3..34570ada2dd36b65662704f13e4033c2228f8147 100644 (file)
@@ -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/;
 
index 856661c323bd5c8d0385cc61c6adbe3cf9b57a88..259235f5f8c63725d6d1e8f8598f096a470ac978 100644 (file)
@@ -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);