3 # Create the export list for perl. Needed by WIN32 for creating perl.dll.
5 # reads global.sym, pp.sym, perlvars.h, intrpvar.h, thrdvar.h, config.h
7 my $CCTYPE = "MSVC"; # default
12 $define{$1} = 1 if ($flag =~ /^-D(\w+)$/);
13 $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/);
16 open(CFG,'config.h') || die "Cannot open config.h:$!";
19 $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/;
20 $define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/;
21 $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/;
25 warn join(' ',keys %define)."\n";
27 if ($define{PERL_OBJECT}) {
28 print "LIBRARY PerlCore\n";
29 print "DESCRIPTION 'Perl interpreter'\n";
31 output_symbol("perl_alloc");
37 print "LIBRARY Perl\n";
38 print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
42 $define{'PERL_GLOBAL_STRUCT'} = 1;
43 $define{'MULTIPLICITY'} = 1;
54 foreach my $symbol (@$list)
63 foreach my $symbol (@$list)
65 emit_symbol($symbol) unless exists $skip{$symbol};
90 Perl_init_thread_intern
112 if ($define{'MYMALLOC'})
124 Perl_malloced_size)];
127 unless ($define{'USE_THREADS'})
149 Perl_new_struct_thread
150 Perl_per_thread_magicals
158 unless ($define{'FAKE_THREADS'})
160 skip_symbols [qw(PL_curthr)];
166 open(VARS,$file) || die "Cannot open $file:$!";
170 # All symbols have a Perl_ prefix because that's what embed.h
171 # sticks in front of them.
172 push(@syms,"PL_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/);
178 if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
180 my $thrd = readvar("../thrdvar.h");
184 if ($define{'MULTIPLICITY'})
186 my $interp = readvar("../intrpvar.h");
187 skip_symbols $interp;
190 if ($define{'PERL_GLOBAL_STRUCT'})
192 my $global = readvar("../perlvars.h");
193 skip_symbols $global;
194 emit_symbols [qw(Perl_GetVars)];
195 emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
198 unless ($define{'DEBUGGING'})
214 if ($define{'HAVE_DES_FCRYPT'})
216 emit_symbols [qw(win32_crypt)];
219 # functions from *.sym files
221 for my $syms ('../global.sym','../pp.sym', '../globvar.sym')
223 open (GLOBAL, "<$syms") || die "failed to open $syms" . $!;
226 next if (!/^[A-Za-z]/);
227 # Functions have a Perl_ prefix
228 # Variables have a PL_ prefix
230 my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : "Perl_");
232 emit_symbol($symbol) unless exists $skip{$symbol};
239 unless ($define{'PERL_GLOBAL_STRUCT'})
241 my $glob = readvar("../perlvars.h");
245 unless ($define{'MULTIPLICITY'})
247 my $glob = readvar("../intrpvar.h");
251 unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'})
253 my $glob = readvar("../thrdvar.h");
259 next if (!/^[A-Za-z]/);
264 next if exists $skip{$symbol};
265 emit_symbol($symbol);
268 foreach my $symbol (sort keys %export)
270 output_symbol($symbol);
276 $export{$symbol} = 1;
281 if ($CCTYPE eq "BORLAND") {
282 # workaround Borland quirk by exporting both the straight
283 # name and a name with leading underscore. Note the
284 # alias *must* come after the symbol itself, if both
285 # are to be exported. (Linker bug?)
286 print "\t_$symbol\n";
287 print "\t$symbol = _$symbol\n";
289 elsif ($CCTYPE eq 'GCC') {
290 # Symbols have leading _ whole process is $%£"% slow
291 # so skip aliases for now
295 # for binary coexistence, export both the symbol and
296 # alias with leading underscore
298 print "\t_$symbol = $symbol\n";
304 # extra globals not included above.
327 perl_set_numeric_standard
328 perl_set_numeric_local
412 win32_getprotobynumber