This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[win32] add AS patch#26 (rename THIS to PERL_OBJEC_THIS to avoid clash
[perl5.git] / win32 / makemain.pl
1 open (MINIMAIN, "<../miniperlmain.c") || die "failed to open miniperlmain.c" . $!;
2
3 while (<MINIMAIN>) {
4         if (/Do not delete this line--writemain depends on it/) {
5                 last;
6                 }
7         else {
8                 print $_;
9                 }
10         };
11
12 close(MINIMAIN);
13
14 print "char *staticlinkmodules[]={\n";
15 foreach (@ARGV) {
16         print "\t\"".$_."\",\n";
17         }
18 print "\tNULL,\n";
19 print "\t};\n";
20 print "\n";
21 foreach (@ARGV) {
22         print "EXTERN_C void boot_$_ _((CV* cv));\n"
23         }
24
25 print <<EOP;
26
27 static void
28 xs_init()
29 {
30         dXSUB_SYS;
31         char *file = __FILE__;
32 EOP
33
34 foreach (@ARGV) {
35         if (/DynaLoader/) {
36             print "\tnewXS(\"$_\:\:boot_$_\", boot_$_, file);\n";
37                 }
38         else {
39             print "\tnewXS(\"$_\:\:bootstrap\", boot_$_, file);\n";
40                 };
41         }
42
43 print <<EOP;
44 }
45 EOP