&usage unless getopts("dhkmoOstvwGMVL: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
# Print out metaconfig's usage and exits
sub usage {
print STDERR <<'EOH';
-Usage: metaconfig [-dhkmostvwGMV] [-L dir]
+Usage: metaconfig [-dhkmostvwGMV] [-L dir] [-X file]
-d : debug mode.
-h : print this help message and exits.
-k : keep temporary directory.
-L : specify main units repository.
-M : activate production of confmagic.h.
-V : print version number and exits.
- -X FILE : read symbol exclusions from FILE
+ -X : read symbol exclusions from file (overriding .package)
EOH
exit 1;
}
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 $_;
$shext = &myread('Additional file extensions to identify SH files?', $dflt);
$shext = '' if $shext eq 'none';
+$dflt = 'none';
+print <<'EOM';
+
+If your package sources contains symbols that metaconfig will mistake for the
+names of symbols defined by its units, you can list them in an exclusions file.
+(See the documentation of "metaconfig -X".) What file would you like metaconfig
+to consult for those symbols? Say "none" if you don't need to exclude any
+symbols.
+
+EOM
+$exclusions_file = &myread('File to consult for excluded symbols?', $dflt);
+$exclusions_file = '' if $exclusions_file eq 'none';
+
$dflt = $copyright eq ' ' ? 'n' : 'y';
print <<'EOM';
: File lookup extensions
cext='$cext'
shext='$shext'
+: File to consult for symbol exclusions
+exclusions_file='$exclusions_file'
: Mailing list variables
list_users='$list_users'
list_name='$list_name'