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};
116 Perl_init_thread_intern
143 Perl_scan_inputsymbol
157 Perl_too_few_arguments
158 Perl_too_many_arguments
183 if ($define{'MYMALLOC'})
199 Perl_malloced_size)];
202 unless ($define{'USE_THREADS'})
224 Perl_new_struct_thread
225 Perl_per_thread_magicals
233 unless ($define{'FAKE_THREADS'})
235 skip_symbols [qw(PL_curthr)];
241 open(VARS,$file) || die "Cannot open $file:$!";
245 # All symbols have a Perl_ prefix because that's what embed.h
246 # sticks in front of them.
247 push(@syms,"PL_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/);
253 if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
255 my $thrd = readvar("../thrdvar.h");
259 if ($define{'MULTIPLICITY'})
261 my $interp = readvar("../intrpvar.h");
262 skip_symbols $interp;
265 if ($define{'PERL_GLOBAL_STRUCT'})
267 my $global = readvar("../perlvars.h");
268 skip_symbols $global;
269 emit_symbols [qw(Perl_GetVars)];
270 emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
273 unless ($define{'DEBUGGING'})
288 if ($define{'HAVE_DES_FCRYPT'})
290 emit_symbols [qw(win32_crypt)];
293 # functions from *.sym files
295 for my $syms ('../global.sym','../pp.sym', '../globvar.sym')
297 open (GLOBAL, "<$syms") || die "failed to open $syms" . $!;
300 next if (!/^[A-Za-z]/);
301 # Functions have a Perl_ prefix
302 # Variables have a PL_ prefix
304 my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : "Perl_");
306 emit_symbol($symbol) unless exists $skip{$symbol};
313 unless ($define{'PERL_GLOBAL_STRUCT'})
315 my $glob = readvar("../perlvars.h");
319 unless ($define{'MULTIPLICITY'})
321 my $glob = readvar("../intrpvar.h");
325 unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'})
327 my $glob = readvar("../thrdvar.h");
333 next if (!/^[A-Za-z]/);
338 next if exists $skip{$symbol};
339 emit_symbol($symbol);
342 foreach my $symbol (sort keys %export)
344 output_symbol($symbol);
350 $export{$symbol} = 1;
355 if ($CCTYPE eq "BORLAND") {
356 # workaround Borland quirk by exporting both the straight
357 # name and a name with leading underscore. Note the
358 # alias *must* come after the symbol itself, if both
359 # are to be exported. (Linker bug?)
360 print "\t_$symbol\n";
361 print "\t$symbol = _$symbol\n";
363 elsif ($CCTYPE eq 'GCC') {
364 # Symbols have leading _ whole process is $%£"% slow
365 # so skip aliases for now
369 # for binary coexistence, export both the symbol and
370 # alias with leading underscore
372 print "\t_$symbol = $symbol\n";
378 # extra globals not included above.
402 perl_set_numeric_standard
403 perl_set_numeric_local
487 win32_getprotobynumber