Re: Pluggable lint patch
[p5sagit/p5-mst-13.2.git] / ext / B / t / debug.t
index 286dac3..0e502ee 100755 (executable)
@@ -1,12 +1,21 @@
 #!./perl
 
 BEGIN {
-    chdir 't' if -d 't';
-    if ($^O eq 'MacOS') {
-       @INC = qw(: ::lib ::macos:lib);
+    if ($ENV{PERL_CORE}){
+       chdir('t') if -d 't';
+       if ($^O eq 'MacOS') {
+           @INC = qw(: ::lib ::macos:lib);
+       } else {
+           @INC = '.';
+           push @INC, '../lib';
+       }
     } else {
-       @INC = '.';
-       push @INC, '../lib';
+       unshift @INC, 't';
+    }
+    require Config;
+    if (($Config::Config{'extensions'} !~ /\bB\b/) ){
+        print "1..0 # Skip -- Perl configured without B module\n";
+        exit 0;
     }
 }
 
@@ -54,13 +63,13 @@ if ($is_thread) {
     $b=<<EOF;
 leave enter nextstate label leaveloop enterloop null and defined null
 threadsv readline gv lineseq nextstate aassign null pushmark split pushre
-threadsv const null pushmark rvav gv nextstate subst const unstack nextstate
+threadsv const null pushmark rvav gv nextstate subst const unstack
 EOF
 } else {
     $b=<<EOF;
 leave enter nextstate label leaveloop enterloop null and defined null
 null gvsv readline gv lineseq nextstate aassign null pushmark split pushre
-null gvsv const null pushmark rvav gv nextstate subst const unstack nextstate
+null gvsv const null pushmark rvav gv nextstate subst const unstack
 EOF
 }
 $b=~s/\n/ /g;$b=~s/\s+/ /g;