3 # Written: 10 April 1996 Gary Ng (71564.1743@compuserve.com)
5 # Create the export list for perl.
6 # Needed by WIN32 for creating perl.dll
7 # based on perl_exp.SH in the main perl distribution directory
9 # This simple program relys on 'global.sym' being up to date
10 # with all of the global symbols that a dynamicly link library
11 # might want to access.
13 # There is some symbol defined in global.sym and interp.sym
14 # that does not present in the WIN32 port but there is no easy
15 # way to find them so I just put a exception list here
17 my $CCTYPE = "MSVC"; # default
22 $define{$1} = 1 if ($flag =~ /^-D(\w+)$/);
23 $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/);
26 open(CFG,'config.h') || die "Cannot open config.h:$!";
29 $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/;
30 $define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/;
34 warn join(' ',keys %define)."\n";
36 if ($define{PERL_OBJECT}) {
37 print "LIBRARY PerlCore\n";
38 print "DESCRIPTION 'Perl interpreter'\n";
40 output_symbol("perl_alloc");
46 print "LIBRARY Perl\n";
47 print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
51 $define{'PERL_GLOBAL_STRUCT'} = 1;
52 $define{'MULTIPLICITY'} = 1;
63 foreach my $symbol (@$list)
72 foreach my $symbol (@$list)
74 emit_symbol($symbol) unless exists $skip{$symbol};
125 Perl_init_thread_intern
153 Perl_scan_inputsymbol
167 Perl_too_few_arguments
168 Perl_too_many_arguments
193 if ($define{'MYMALLOC'})
209 Perl_malloced_size)];
212 unless ($define{'USE_THREADS'})
234 Perl_new_struct_thread
235 Perl_per_thread_magicals
243 unless ($define{'FAKE_THREADS'})
245 skip_symbols [qw(PL_curthr)];
251 open(VARS,$file) || die "Cannot open $file:$!";
255 # All symbols have a Perl_ prefix because that's what embed.h
256 # sticks in front of them.
257 push(@syms,"PL_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/);
263 if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
265 my $thrd = readvar("../thrdvar.h");
269 if ($define{'MULTIPLICITY'})
271 my $interp = readvar("../intrpvar.h");
272 skip_symbols $interp;
275 if ($define{'PERL_GLOBAL_STRUCT'})
277 my $global = readvar("../perlvars.h");
278 skip_symbols $global;
279 emit_symbols [qw(Perl_GetVars)];
280 emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
283 unless ($define{'DEBUGGING'})
298 if ($define{'HAVE_DES_FCRYPT'})
300 emit_symbols [qw(win32_crypt)];
303 open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!;
306 next if (!/^[A-Za-z]/);
307 next if (/_amg[ \t]*$/);
308 # All symbols have a Perl_ prefix because that's what embed.h
309 # sticks in front of them.
311 my $symbol = "Perl_$_";
312 emit_symbol($symbol) unless exists $skip{$symbol};
316 # also add symbols from interp.sym
317 # They are only needed if -DMULTIPLICITY is not set but it
318 # doesn't hurt to include them anyway.
319 # these don't have Perl prefix
321 unless ($define{'PERL_GLOBAL_STRUCT'})
323 my $glob = readvar("../perlvars.h");
327 unless ($define{'MULTIPLICITY'})
329 my $glob = readvar("../intrpvar.h");
333 unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'})
335 my $glob = readvar("../thrdvar.h");
341 next if (!/^[A-Za-z]/);
346 next if exists $skip{$symbol};
347 emit_symbol($symbol);
350 foreach my $symbol (sort keys %export)
352 output_symbol($symbol);
358 $export{$symbol} = 1;
363 if ($CCTYPE eq "BORLAND") {
364 # workaround Borland quirk by exporting both the straight
365 # name and a name with leading underscore. Note the
366 # alias *must* come after the symbol itself, if both
367 # are to be exported. (Linker bug?)
368 print "\t_$symbol\n";
369 print "\t$symbol = _$symbol\n";
371 elsif ($CCTYPE eq 'GCC') {
372 # Symbols have leading _ whole process is $%£"% slow
373 # so skip aliases for now
377 # for binary coexistence, export both the symbol and
378 # alias with leading underscore
380 print "\t_$symbol = $symbol\n";
386 # extra globals not included above.
410 perl_set_numeric_standard
411 perl_set_numeric_local
495 win32_getprotobynumber