summaryrefslogtreecommitdiff
path: root/mcon
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2017-10-24 18:36:29 +0100
committerAaron Crane <arc@cpan.org>2017-10-24 18:36:29 +0100
commite66b85ddbd27bb2a83eb28de957a3a0a276b7056 (patch)
tree66de6bcdb77e5aeeea90cfb92b078629989b5d66 /mcon
parent9a6a95281df0a1aae6bb08e9f8dbdd226d33db28 (diff)
Support "-X exclusions-file" option in metaxref
Otherwise, when mconfig is run with that option, the metaxref would confusingly refer to excluded symbols.
Diffstat (limited to 'mcon')
-rwxr-xr-xmcon/man/mxref.SH11
-rwxr-xr-xmcon/mxref.SH7
-rw-r--r--mcon/pl/xref.pl3
3 files changed, 19 insertions, 2 deletions
diff --git a/mcon/man/mxref.SH b/mcon/man/mxref.SH
index b0dbbad..aa4c687 100755
--- a/mcon/man/mxref.SH
+++ b/mcon/man/mxref.SH
@@ -99,6 +99,17 @@ can be found).
.TP
.B \-V
Print version number and exit.
+.TP
+\fB\-X\fI file\fR
+When examining the source files, ignore any symbols listed in the \fIfile\fR.
+This is useful in situations where a particular unit is known not to be needed
+for your package's portability targets, but your source files nevertheless
+contain occurrences of words that look to \fImetaconfig\fR like symbols defined
+in that unit. (For example, you might need the word "index" in a source file,
+but not need the unit that determines whether \fIstrcpy\fR or \fIindex\fR
+should be used.)
+The \fIfile\fR can contain blank lines, comment lines introduced with '#', and
+lines containing a single symbol.
.SH AUTHOR
Harlan Stenn <harlan@mumps.pfcs.com>
.SH FILES
diff --git a/mcon/mxref.SH b/mcon/mxref.SH
index 5c45c1e..6050d3a 100755
--- a/mcon/mxref.SH
+++ b/mcon/mxref.SH
@@ -60,10 +60,12 @@ $spitshell >>mxref <<'!NO!SUBS!'
&profile; # Read ~/.dist_profile
use Getopt::Std;
-&usage unless getopts("df:hkmsVL:");
+&usage unless getopts("df:hkmsVL:X:");
chop($date = `date`);
chop($WD = `pwd`); # Working directory
+my %excluded_symbol;
+read_exclusions($opt_X) if defined $opt_X;
$MC = $opt_L if $opt_L; # May override library path
$MC = &tilda_expand($MC); # ~name expansion
chdir $MC || die "Can't chdir to $MC: $!\n";
@@ -119,7 +121,7 @@ sub init_except {
# Print out metaxref's usage and exits
sub usage {
print STDERR <<EOM;
-Usage: metaxref [-dhkmsV] [-f manifest] [-L dir]
+Usage: metaxref [-dhkmsV] [-f manifest] [-L dir] [-X file]
-d : debug mode.
-f : use that file as manifest instead of MANIFEST.new.
-h : print this help message and exits.
@@ -128,6 +130,7 @@ Usage: metaxref [-dhkmsV] [-f manifest] [-L dir]
-s : silent mode.
-L : specify main units repository.
-V : print version number and exits.
+ -X : read symbol exclusions from FILE
EOM
exit 1;
}
diff --git a/mcon/pl/xref.pl b/mcon/pl/xref.pl
index 02f4164..f077139 100644
--- a/mcon/pl/xref.pl
+++ b/mcon/pl/xref.pl
@@ -55,6 +55,9 @@ sub p_wanted {
$cwanted{$_} = "$fake"; # Attached to this symbol
push(@Master, "?$unit:$fake=''"); # Fake initialization
}
+
+ delete @cmaster{keys %excluded_symbol};
+ delete @cwanted{keys %excluded_symbol};
}
# Ingnore the following: