This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
bin/mconfig: pull more changes from rmanfredi/dist#14
authorAaron Crane <arc@cpan.org>
Thu, 19 Apr 2018 15:32:49 +0000 (17:32 +0200)
committerAaron Crane <arc@cpan.org>
Thu, 19 Apr 2018 15:38:15 +0000 (17:38 +0200)
In particular, this allows the -X option to be named in the .package file
(which would have saved some confusion for Tux).

This also reduces the amount of divergence from upstream dist, which goes
a small way to addressing #43.

bin/mconfig
bin/packinit

index 698d118..453235c 100755 (executable)
@@ -60,7 +60,7 @@ chop($date = `date`);
 &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
@@ -142,7 +142,7 @@ sub init_except {
 # 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.
@@ -156,7 +156,7 @@ Usage: metaconfig [-dhkmostvwGMV] [-L dir]
   -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;
 }
@@ -815,6 +815,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 $_;
index 6eb04e6..365eda3 100755 (executable)
@@ -171,6 +171,19 @@ EOM
 $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';
 
@@ -406,6 +419,8 @@ changercs=$changercs
 : 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'