MM patches from Ilya Zakharevich
[p5sagit/p5-mst-13.2.git] / embed.pl
index ca489c5..52c93ab 100755 (executable)
--- a/embed.pl
+++ b/embed.pl
@@ -2,6 +2,25 @@
 
 require 5.003;
 
+# XXX others that may need adding
+#       warnhook
+#       hints
+#       copline
+my @extvars = qw(sv_undef sv_yes sv_no na dowarn
+                 curcop compiling 
+                 tainting tainted stack_base stack_sp sv_arenaroot
+                 curstash DBsub DBsingle debstash
+                 rsfp 
+                 stdingv
+                defgv
+                errgv
+                rsfp_filters
+                perldb
+                diehook
+                dirty
+                perl_destruct_level
+                );
+
 sub readsyms (\%$) {
     my ($syms, $file) = @_;
     %$syms = ();
@@ -18,7 +37,6 @@ sub readsyms (\%$) {
 }
 
 readsyms %global, 'global.sym';
-readsyms %interp, 'interp.sym';
 
 sub readvars(\%$$) {
     my ($syms, $file,$pre) = @_;
@@ -44,11 +62,10 @@ readvars %globvar, 'perlvars.h','G';
 
 foreach my $sym (sort keys %intrp)
  {
-  warn "$sym not in interp.sym\n" unless exists $interp{$sym};
   if (exists $global{$sym})
    {
     delete $global{$sym};
-    warn "$sym in global.sym as well as interp\n";
+    warn "$sym in global.sym as well as intrpvar.h\n";
    }
  }
 
@@ -61,19 +78,13 @@ foreach my $sym (sort keys %globvar)
    }
  }
 
-foreach my $sym (keys %interp)
- {
-  warn "extra $sym in interp.sym\n" 
-   unless exists $intrp{$sym} || exists $thread{$sym};
- }
-
 foreach my $sym (sort keys %thread)
  {
-  warn "$sym in intrpvar.h\n" if exists $intrp{$sym};
+  warn "$sym in intrpvar.h as well as thrdvar.h\n" if exists $intrp{$sym};
   if (exists $global{$sym})
    {
     delete $global{$sym};
-    warn "$sym in global.sym as well as thread\n";
+    warn "$sym in global.sym as well as thrdvar.h\n";
    }
  }
 
@@ -98,8 +109,7 @@ sub multon ($$$) {
 }
 sub multoff ($$) {
     my ($sym,$pre) = @_;
-#   hide("$pre$sym", "PL_$sym");
-    return '';
+    return hide("PL_$pre$sym", "PL_$sym");
 }
 
 unlink 'embed.h';
@@ -256,7 +266,7 @@ print EM <<'END';
 END
 
 for $sym (sort keys %globvar) {
-    print EM multon($sym,'G','Perl_Vars.');
+    print EM multon($sym,'G','PL_Vars.');
 }
 
 print EM <<'END';
@@ -286,4 +296,20 @@ print EM <<'END';
 
 END
 
+print EM <<'END';
+
+#if 0 /* ndef MIN_PERL_DEFINE */       /* unsupported in 5.006 */
+
+END
+
+for $sym (sort @extvars) {
+    print EM hide($sym,"PL_$sym");
+}
+
+print EM <<'END';
+
+#endif /* MIN_PERL_DEFINE */
+END
+
+
 close(EM);