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'})
125 Perl_malloced_size)];
128 unless ($define{'USE_THREADS'})
150 Perl_new_struct_thread
151 Perl_per_thread_magicals
159 unless ($define{'FAKE_THREADS'})
161 skip_symbols [qw(PL_curthr)];
167 open(VARS,$file) || die "Cannot open $file:$!";
171 # All symbols have a Perl_ prefix because that's what embed.h
172 # sticks in front of them.
173 push(@syms,"PL_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/);
179 if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
181 my $thrd = readvar("../thrdvar.h");
185 if ($define{'MULTIPLICITY'})
187 my $interp = readvar("../intrpvar.h");
188 skip_symbols $interp;
191 if ($define{'PERL_GLOBAL_STRUCT'})
193 my $global = readvar("../perlvars.h");
194 skip_symbols $global;
195 emit_symbols [qw(Perl_GetVars)];
196 emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
199 unless ($define{'DEBUGGING'})
215 if ($define{'HAVE_DES_FCRYPT'})
217 emit_symbols [qw(win32_crypt)];
220 # functions from *.sym files
222 for my $syms ('../global.sym','../pp.sym', '../globvar.sym')
224 open (GLOBAL, "<$syms") || die "failed to open $syms" . $!;
227 next if (!/^[A-Za-z]/);
228 # Functions have a Perl_ prefix
229 # Variables have a PL_ prefix
231 my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : "Perl_");
233 emit_symbol($symbol) unless exists $skip{$symbol};
240 unless ($define{'PERL_GLOBAL_STRUCT'})
242 my $glob = readvar("../perlvars.h");
246 unless ($define{'MULTIPLICITY'})
248 my $glob = readvar("../intrpvar.h");
252 unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'})
254 my $glob = readvar("../thrdvar.h");
260 next if (!/^[A-Za-z]/);
265 next if exists $skip{$symbol};
266 emit_symbol($symbol);
269 foreach my $symbol (sort keys %export)
271 output_symbol($symbol);
277 $export{$symbol} = 1;
282 if ($CCTYPE eq "BORLAND") {
283 # workaround Borland quirk by exporting both the straight
284 # name and a name with leading underscore. Note the
285 # alias *must* come after the symbol itself, if both
286 # are to be exported. (Linker bug?)
287 print "\t_$symbol\n";
288 print "\t$symbol = _$symbol\n";
290 elsif ($CCTYPE eq 'GCC') {
291 # Symbols have leading _ whole process is $%£"% slow
292 # so skip aliases for now
296 # for binary coexistence, export both the symbol and
297 # alias with leading underscore
299 print "\t_$symbol = $symbol\n";
305 # extra globals not included above.
328 perl_set_numeric_standard
329 perl_set_numeric_local
413 win32_getprotobynumber