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'})
123 Perl_malloced_size)];
126 unless ($define{'USE_THREADS'})
148 Perl_new_struct_thread
149 Perl_per_thread_magicals
157 unless ($define{'FAKE_THREADS'})
159 skip_symbols [qw(PL_curthr)];
165 open(VARS,$file) || die "Cannot open $file:$!";
169 # All symbols have a Perl_ prefix because that's what embed.h
170 # sticks in front of them.
171 push(@syms,"PL_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/);
177 if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
179 my $thrd = readvar("../thrdvar.h");
183 if ($define{'MULTIPLICITY'})
185 my $interp = readvar("../intrpvar.h");
186 skip_symbols $interp;
189 if ($define{'PERL_GLOBAL_STRUCT'})
191 my $global = readvar("../perlvars.h");
192 skip_symbols $global;
193 emit_symbols [qw(Perl_GetVars)];
194 emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
197 unless ($define{'DEBUGGING'})
213 if ($define{'HAVE_DES_FCRYPT'})
215 emit_symbols [qw(win32_crypt)];
218 # functions from *.sym files
220 for my $syms ('../global.sym','../pp.sym', '../globvar.sym')
222 open (GLOBAL, "<$syms") || die "failed to open $syms" . $!;
225 next if (!/^[A-Za-z]/);
226 # Functions have a Perl_ prefix
227 # Variables have a PL_ prefix
229 my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : "Perl_");
231 emit_symbol($symbol) unless exists $skip{$symbol};
238 unless ($define{'PERL_GLOBAL_STRUCT'})
240 my $glob = readvar("../perlvars.h");
244 unless ($define{'MULTIPLICITY'})
246 my $glob = readvar("../intrpvar.h");
250 unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'})
252 my $glob = readvar("../thrdvar.h");
258 next if (!/^[A-Za-z]/);
263 next if exists $skip{$symbol};
264 emit_symbol($symbol);
267 foreach my $symbol (sort keys %export)
269 output_symbol($symbol);
275 $export{$symbol} = 1;
280 if ($CCTYPE eq "BORLAND") {
281 # workaround Borland quirk by exporting both the straight
282 # name and a name with leading underscore. Note the
283 # alias *must* come after the symbol itself, if both
284 # are to be exported. (Linker bug?)
285 print "\t_$symbol\n";
286 print "\t$symbol = _$symbol\n";
288 elsif ($CCTYPE eq 'GCC') {
289 # Symbols have leading _ whole process is $%£"% slow
290 # so skip aliases for now
294 # for binary coexistence, export both the symbol and
295 # alias with leading underscore
297 print "\t_$symbol = $symbol\n";
303 # extra globals not included above.
327 perl_set_numeric_standard
328 perl_set_numeric_local
412 win32_getprotobynumber