summaryrefslogtreecommitdiff
path: root/mcon
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2017-10-24 19:27:43 +0100
committerAaron Crane <arc@cpan.org>2017-10-24 19:30:53 +0100
commit4db77aeffc4cd0e969c6379e621a6931027976f7 (patch)
tree8b75d3fb70b02e4d7a3eb1a022904ae1cea6b8f2 /mcon
parente66b85ddbd27bb2a83eb28de957a3a0a276b7056 (diff)
Allow exclusions file to be named in .package
Diffstat (limited to 'mcon')
-rwxr-xr-xmcon/man/mconfig.SH2
-rwxr-xr-xmcon/man/mxref.SH2
-rwxr-xr-xmcon/mconfig.SH4
-rwxr-xr-xmcon/mxref.SH4
-rw-r--r--mcon/pl/files.pl7
5 files changed, 15 insertions, 4 deletions
diff --git a/mcon/man/mconfig.SH b/mcon/man/mconfig.SH
index ba415e2..e749330 100755
--- a/mcon/man/mconfig.SH
+++ b/mcon/man/mconfig.SH
@@ -539,6 +539,8 @@ 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.
+If this option is not supplied, any \fI$exclusions_file\fR variable in
+\fI.package\fR is honored instead.
'''
''' T u t o r i a l
'''
diff --git a/mcon/man/mxref.SH b/mcon/man/mxref.SH
index aa4c687..491bf1d 100755
--- a/mcon/man/mxref.SH
+++ b/mcon/man/mxref.SH
@@ -110,6 +110,8 @@ 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.
+If this option is not supplied, any \fI$exclusions_file\fR variable in
+\fI.package\fR is honored instead.
.SH AUTHOR
Harlan Stenn <harlan@mumps.pfcs.com>
.SH FILES
diff --git a/mcon/mconfig.SH b/mcon/mconfig.SH
index 77a2e1e..5d37bc5 100755
--- a/mcon/mconfig.SH
+++ b/mcon/mconfig.SH
@@ -71,7 +71,7 @@ use Getopt::Std;
&usage unless getopts("dhkmostvwGMVL:X:");
my %excluded_symbol;
-read_exclusions($opt_X) if defined $opt_X;
+read_exclusions($opt_X);
$MC = $opt_L if $opt_L; # May override public library path
$MC = &tilda_expand($MC); # ~name expansion
chop($WD = `pwd`); # Working directory
@@ -166,7 +166,7 @@ Usage: metaconfig [-dhkmostvwGMV] [-L dir] [-X file]
-L : specify main units repository.
-M : activate production of confmagic.h.
-V : print version number and exits.
- -X : read symbol exclusions from FILE
+ -X : read symbol exclusions from FILE (overriding .package)
EOH
exit 1;
}
diff --git a/mcon/mxref.SH b/mcon/mxref.SH
index 6050d3a..d2730de 100755
--- a/mcon/mxref.SH
+++ b/mcon/mxref.SH
@@ -65,7 +65,7 @@ use Getopt::Std;
chop($date = `date`);
chop($WD = `pwd`); # Working directory
my %excluded_symbol;
-read_exclusions($opt_X) if defined $opt_X;
+read_exclusions($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";
@@ -130,7 +130,7 @@ Usage: metaxref [-dhkmsV] [-f manifest] [-L dir] [-X file]
-s : silent mode.
-L : specify main units repository.
-V : print version number and exits.
- -X : read symbol exclusions from FILE
+ -X : read symbol exclusions from FILE (overriding .package)
EOM
exit 1;
}
diff --git a/mcon/pl/files.pl b/mcon/pl/files.pl
index b983832..a7d26a6 100644
--- a/mcon/pl/files.pl
+++ b/mcon/pl/files.pl
@@ -29,6 +29,9 @@
;# extensions to their packages. For instance, perl5 adds .xs files holding
;# some C symbols.
;#
+;# The read_exclusions() routine honours the .package $exclusions_file
+;# variable if its argument is undefined.
+;#
# Extract filenames from manifest
sub extract_filenames {
&build_filext; # Construct &is_cfile and &is_shfile
@@ -108,6 +111,10 @@ sub q {
sub read_exclusions {
my ($filename) = @_;
+ if (!defined $filename) {
+ $filename = $exclusions_file; # default to name from .package
+ return if !defined $filename || $filename eq '';
+ }
print "Reading exclusions from $filename...\n" unless $opt_s;
open(EXCLUSIONS, "< $filename\0") || die "Can't read $filename: $!\n";
local $_;