This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlbug (was: Re: [perl #20606] [no subject])
[perl5.git] / utils / perlivp.PL
index bd182a5..fd58e87 100644 (file)
@@ -14,9 +14,9 @@ use Cwd;
 
 # This forces PL files to create target in same directory as PL file.
 # This is so that make depend always knows where to find PL derivatives.
-$origdir = cwd;
+my $origdir = cwd;
 chdir dirname($0);
-$file = basename($0, '.PL');
+my $file = basename($0, '.PL');
 $file .= '.com' if $^O eq 'VMS';
 
 # Create output file.
@@ -37,7 +37,7 @@ $Config{'startperl'}
 
 print OUT <<'!NO!SUBS!';
 
-# perlivp V 0.01
+# perlivp V 0.02
 
 
 sub usage {
@@ -56,7 +56,7 @@ Usage:
     exit;
 }
 
-use vars (%opt); # allow testing with older versions (do not use our)
+use vars qw(%opt); # allow testing with older versions (do not use our)
 
 @opt{ qw/? H h P p V v/ } = qw(0 0 0 0 0 0 0);
 
@@ -88,8 +88,15 @@ if (defined($Config{'perlpath'})) { $perlpath = $Config{'perlpath'}; }
 # Of course some platforms are distinct...
 if ($^O eq 'VMS') { $perlpath = $^X; }
 
+# The useithreads Config variable plays a role in whether or not
+# threads and threads/shared work when C<use>d.  They apparently always
+# get installed on systems that can run Configure.
+my $useithreads = '';
+if (defined($Config{'useithreads'})) { $useithreads = $Config{'useithreads'}; }
+
 print OUT <<"!GROK!THIS!";
 my \$perlpath = '$perlpath';
+my \$useithreads = '$useithreads';
 !GROK!THIS!
 
 print OUT <<'!NO!SUBS!';
@@ -174,7 +181,7 @@ foreach (qw(Config.pm ExtUtils/Installed.pm)) {
         $needed_there++;
     }
     else {
-        print "# Needed module `$_' does not appear to be properly installed ($@).\n";
+        print "# Needed module `$_' does not appear to be properly installed.\n";
     }
     $@ = undef;
 }
@@ -199,6 +206,10 @@ if (defined($Config{'extensions'})) {
     my @extensions = split(/\s+/,$Config{'extensions'});
     foreach (@extensions) {
         next if ($_ eq '');
+        if ( $useithreads !~ /define/i ) {
+            next if ($_ eq 'threads');
+            next if ($_ eq 'threads/shared');
+        }
         next if ($_ eq 'Devel/DProf'); 
            # VMS$ perl  -e "eval ""require \""Devel/DProf.pm\"";"" print $@"
            # \NT> perl  -e "eval \"require 'Devel/DProf.pm'\"; print $@"
@@ -210,7 +221,7 @@ if (defined($Config{'extensions'})) {
             $extensions_there++;
         }
         else {
-            print "# Required module `$_' does not appear to be properly installed ($@).\n";
+            print "# Required module `$_' does not appear to be properly installed.\n";
             $@ = undef;
         }
         $extensions_total++;
@@ -329,7 +340,7 @@ foreach (@ph_files) {
         $ph_there++;
     }
     else {
-        print "# Perl header `$_' does not appear to be properly installed ($@).\n";
+        print "# Perl header `$_' does not appear to be properly installed.\n";
     }
     $@ = undef;
 }