[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] aclocal: rename search path variables
From: |
Paolo Bonzini |
Subject: |
[PATCH 3/3] aclocal: rename search path variables |
Date: |
Tue, 9 Nov 2010 20:14:40 +0100 |
As suggested in the v1 thread, this renames references to user/system
includes to "local" and "global". The source now refers to "system"
directories as a subset of the global directories (together with
ACLOCAL_PATH-supplied and dirlist-supplied directories).
* aclocal.in (user_includes): Rename to...
(local_includes): ... this.
(system_includes): Rename to...
(global_includes): ... this.
(FT_USER): Rename to...
(FT_LOCAL): ... this.
(FT_SYSTEM): Rename to...
(FT_GLOBAL): ... this.
---
ChangeLog | 12 ++++++++++++
aclocal.in | 50 +++++++++++++++++++++++++-------------------------
2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ede73dc..b3ec1fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2010-11-09 Paolo Bonzini <address@hidden>
+ aclocal: rename search path variables.
+ * aclocal.in (user_includes): Rename to...
+ (local_includes): ... this.
+ (system_includes): Rename to...
+ (global_includes): ... this.
+ (FT_USER): Rename to...
+ (FT_LOCAL): ... this.
+ (FT_SYSTEM): Rename to...
+ (FT_GLOBAL): ... this.
+
+2010-11-09 Paolo Bonzini <address@hidden>
+
aclocal: remove @automake_includes.
* NEWS: Adapt to changes in ACLOCAL_PATH semantics.
* aclocal.in (default_automake_dir): New.
diff --git a/aclocal.in b/aclocal.in
index 1d73f49..895f56b 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -56,16 +56,16 @@ my $default_automake_dir = "@datadir@/aclocal-$APIVERSION";
# Include paths for searching macros. We search macros in this order:
# user-supplied directories first, then the directory containing the
# automake macros, and finally the system-wide directories for
-# third-party macros. @user_includes can be augmented with -I.
-# @system_includes can be augmented with the `dirlist' file or
+# third-party macros. @local_includes can be augmented with -I.
+# @global_includes can be augmented with the `dirlist' file or
# ACLOCAL_PATH.
-my @user_includes = ();
-my @system_includes = ($default_automake_dir, '@datadir@/aclocal');
+my @local_includes = ();
+my @global_includes = ($default_automake_dir, '@datadir@/aclocal');
# Whether --acdir was passed.
my $have_acdir = 0;
-# Whether we should copy M4 file in $user_includes[0].
+# Whether we should copy M4 file in $local_includes[0].
my $install = 0;
# --diff
@@ -109,9 +109,9 @@ my %file_contents = ();
# Map file names to file types.
my %file_type = ();
-use constant FT_USER => 1;
+use constant FT_LOCAL => 1;
use constant FT_AUTOMAKE => 2;
-use constant FT_SYSTEM => 3;
+use constant FT_GLOBAL => 3;
# Map file names to included files (transitively closed).
my %file_includes = ();
@@ -340,17 +340,17 @@ sub scan_m4_files ()
{
# First, scan configure.ac. It may contain macro definitions,
# or may include other files that define macros.
- &scan_file (FT_USER, $configure_ac, 'aclocal');
+ &scan_file (FT_LOCAL, $configure_ac, 'aclocal');
# Then, scan acinclude.m4 if it exists.
if (-f 'acinclude.m4')
{
- &scan_file (FT_USER, 'acinclude.m4', 'aclocal');
+ &scan_file (FT_LOCAL, 'acinclude.m4', 'aclocal');
}
# Finally, scan all files in our search paths.
- scan_m4_dirs (FT_USER, @user_includes);
- scan_m4_dirs (FT_SYSTEM, @system_includes);
+ scan_m4_dirs (FT_LOCAL, @local_includes);
+ scan_m4_dirs (FT_GLOBAL, @global_includes);
# Construct a new function that does the searching. We use a
# function (instead of just evaluating $search in the loop) so that
@@ -467,7 +467,7 @@ my $underquoted_manual_once = 0;
# --------------------------------
# Scan a single M4 file ($FILE), and all files it includes.
# Return the list of included files.
-# $TYPE is one of FT_USER or FT_SYSTEM, depending on where
+# $TYPE is one of FT_LOCAL or FT_GLOBAL, depending on where
# the file comes from.
# $WHERE is the location to use in the diagnostic if the file
# does not exist.
@@ -484,7 +484,7 @@ sub scan_file ($$$)
unshift @file_order, $file;
$type = FT_AUTOMAKE
- if $type == FT_SYSTEM && $default_automake_dir eq dirname $file;
+ if $type == FT_GLOBAL && $default_automake_dir eq dirname $file;
$file_type{$file} = $type;
@@ -761,10 +761,10 @@ sub write_aclocal ($@)
# If the file to add looks like outside the project, copy it
# to the output. The regex catches filenames starting with
# things like `/', `\', or `c:\'.
- if ($file_type{$file} != FT_USER
+ if ($file_type{$file} != FT_LOCAL
|| $file =~ m,^(?:\w:)?[\\/],)
{
- if (!$install || $file_type{$file} != FT_SYSTEM)
+ if (!$install || $file_type{$file} != FT_GLOBAL)
{
# Copy the file into aclocal.m4.
$output .= $file_contents{$file} . "\n";
@@ -775,7 +775,7 @@ sub write_aclocal ($@)
my $dest;
for my $ifile (@{$file_includes{$file}}, $file)
{
- $dest = "$user_includes[0]/" . basename $ifile;
+ $dest = "$local_includes[0]/" . basename $ifile;
verb "installing $ifile to $dest";
install_file ($ifile, $dest);
}
@@ -939,12 +939,12 @@ sub parse_arguments ()
{ # automake (versioned) directory and the
# public (unversioned) system directory.
$have_acdir = 1;
- @system_includes = ($_[1])
+ @global_includes = ($_[1])
},
'diff:s' => \$diff_command,
'dry-run' => \$dry_run,
'force' => \$force_output,
- 'I=s' => address@hidden,
+ 'I=s' => address@hidden,
'install' => \$install,
'output=s' => \$output_file,
'print-ac-dir' => \$print_and_exit,
@@ -1003,7 +1003,7 @@ sub parse_arguments ()
if ($print_and_exit)
{
- my $acdir = $system_includes[$#system_includes];
+ my $acdir = $global_includes[$#global_includes];
print "$acdir\n";
exit 0;
}
@@ -1016,7 +1016,7 @@ sub parse_arguments ()
$dry_run = 1;
}
- if ($install && address@hidden)
+ if ($install && address@hidden)
{
fatal ("--install should copy macros in the directory indicated by the"
. "\nfirst -I option, but no -I was supplied");
@@ -1027,13 +1027,13 @@ sub parse_arguments ()
# By default $(datadir)/aclocal doesn't exist. We don't want to
# get an error in the case where we are searching the default
# directory and it hasn't been created.
- @system_includes = grep { -d } @system_includes;
+ @global_includes = grep { -d } @global_includes;
}
- if (length @system_includes > 0)
+ if (length @global_includes > 0)
{
# Add any directory listed in the `dirlist' file.
- if (open (DIRLIST, "$system_includes[0]/dirlist"))
+ if (open (DIRLIST, "$global_includes[0]/dirlist"))
{
while (<DIRLIST>)
{
@@ -1044,7 +1044,7 @@ sub parse_arguments ()
chomp;
foreach my $dir (glob)
{
- push (@system_includes, $dir) if -d $dir;
+ push (@global_includes, $dir) if -d $dir;
}
}
close (DIRLIST);
@@ -1060,7 +1060,7 @@ sub parse_arguments ()
# coming later, which is why the result of split is reversed.
foreach my $dir (reverse split /:/, $ENV{"ACLOCAL_PATH"})
{
- unshift (@system_includes, $dir) if $dir ne '' && -d $dir;
+ unshift (@global_includes, $dir) if $dir ne '' && -d $dir;
}
}
}
--
1.7.3.2