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};
127 Perl_init_thread_intern
155 Perl_scan_inputsymbol
169 Perl_too_few_arguments
170 Perl_too_many_arguments
195 if ($define{'MYMALLOC'})
211 Perl_malloced_size)];
214 unless ($define{'USE_THREADS'})
234 Perl_new_struct_thread
235 Perl_per_thread_magicals
248 unless ($define{'FAKE_THREADS'})
250 skip_symbols [qw(PL_curthr)];
256 open(VARS,$file) || die "Cannot open $file:$!";
260 # All symbols have a Perl_ prefix because that's what embed.h
261 # sticks in front of them.
262 push(@syms,"PL_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/);
268 if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
270 my $thrd = readvar("../thrdvar.h");
274 if ($define{'MULTIPLICITY'})
276 my $interp = readvar("../intrpvar.h");
277 skip_symbols $interp;
280 if ($define{'PERL_GLOBAL_STRUCT'})
282 my $global = readvar("../perlvars.h");
283 skip_symbols $global;
284 emit_symbols [qw(Perl_GetVars)];
285 emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
288 unless ($define{'DEBUGGING'})
303 if ($define{'HAVE_DES_FCRYPT'})
305 emit_symbols [qw(win32_crypt)];
308 open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!;
311 next if (!/^[A-Za-z]/);
312 next if (/_amg[ \t]*$/);
313 # All symbols have a Perl_ prefix because that's what embed.h
314 # sticks in front of them.
316 my $symbol = "Perl_$_";
317 emit_symbol($symbol) unless exists $skip{$symbol};
321 # also add symbols from interp.sym
322 # They are only needed if -DMULTIPLICITY is not set but it
323 # doesn't hurt to include them anyway.
324 # these don't have Perl prefix
326 unless ($define{'PERL_GLOBAL_STRUCT'})
328 my $glob = readvar("../perlvars.h");
332 unless ($define{'MULTIPLICITY'})
334 my $glob = readvar("../intrpvar.h");
338 unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'})
340 my $glob = readvar("../thrdvar.h");
346 next if (!/^[A-Za-z]/);
351 next if exists $skip{$symbol};
352 emit_symbol($symbol);
355 foreach my $symbol (sort keys %export)
357 output_symbol($symbol);
363 $export{$symbol} = 1;
368 if ($CCTYPE eq "BORLAND") {
369 # workaround Borland quirk by exporting both the straight
370 # name and a name with leading underscore. Note the
371 # alias *must* come after the symbol itself, if both
372 # are to be exported. (Linker bug?)
373 print "\t_$symbol\n";
374 print "\t$symbol = _$symbol\n";
376 elsif ($CCTYPE eq 'GCC') {
377 # Symbols have leading _ whole process is $%£"% slow
378 # so skip aliases for now
382 # for binary coexistence, export both the symbol and
383 # alias with leading underscore
385 print "\t_$symbol = $symbol\n";
391 # extra globals not included above.
415 perl_set_numeric_standard
416 perl_set_numeric_local
500 win32_getprotobynumber