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/;
33 warn join(' ',keys %define)."\n";
37 print "LIBRARY Perl\n";
38 print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
39 print "CODE LOADONCALL\n";
40 print "DATA LOADONCALL NONSHARED MULTIPLE\n";
44 $define{'PERL_GLOBAL_STRUCT'} = 1;
45 $define{'MULTIPLICITY'} = 1;
56 foreach my $symbol (@$list)
65 foreach my $symbol (@$list)
67 emit_symbol($symbol) unless exists $skip{$symbol};
114 Perl_init_thread_intern
150 Perl_scan_inputsymbol
164 Perl_too_few_arguments
165 Perl_too_many_arguments
192 if ($define{'MYMALLOC'})
206 unless ($define{'USE_THREADS'})
217 Perl_new_struct_thread
220 Perl_per_thread_magicals
237 unless ($define{'FAKE_THREADS'})
239 skip_symbols [qw(Perl_curthr)];
245 open(VARS,$file) || die "Cannot open $file:$!";
249 # All symbols have a Perl_ prefix because that's what embed.h
250 # sticks in front of them.
251 push(@syms,"Perl_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/);
257 if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
259 my $thrd = readvar("../thrdvar.h");
263 if ($define{'MULTIPLICITY'})
265 my $interp = readvar("../intrpvar.h");
266 skip_symbols $interp;
269 if ($define{'PERL_GLOBAL_STRUCT'})
271 my $global = readvar("../perlvars.h");
272 skip_symbols $global;
275 unless ($define{'DEBUGGING'})
284 if ($define{'HAVE_DES_FCRYPT'})
286 emit_symbols [qw(win32_crypt)];
289 open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!;
292 next if (!/^[A-Za-z]/);
293 next if (/_amg[ \t]*$/);
294 # All symbols have a Perl_ prefix because that's what embed.h
295 # sticks in front of them.
297 my $symbol = "Perl_$_";
298 emit_symbol($symbol) unless exists $skip{$symbol};
302 # also add symbols from interp.sym
303 # They are only needed if -DMULTIPLICITY is not set but it
304 # doesn't hurt to include them anyway.
305 # these don't have Perl prefix
307 if ($define{'PERL_GLOBAL_STRUCT'})
309 emit_symbol( ($CCTYPE eq 'GCC') ? 'Perl_GetVars' : 'Perl_VarsPtr')
313 my $glob = readvar("../perlvars.h");
317 unless ($define{'MULTIPLICITY'})
319 my $glob = readvar("../intrpvar.h");
323 unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'})
325 my $glob = readvar("../thrdvar.h");
331 next if (!/^[A-Za-z]/);
336 next if exists $skip{$symbol};
337 emit_symbol($symbol);
340 foreach my $symbol (sort keys %export)
342 if ($CCTYPE eq "BORLAND") {
343 # workaround Borland quirk by exporting both the straight
344 # name and a name with leading underscore. Note the
345 # alias *must* come after the symbol itself, if both
346 # are to be exported. (Linker bug?)
347 print "\t_$symbol\n";
348 print "\t$symbol = _$symbol\n";
350 elsif ($CCTYPE eq 'GCC') {
351 # Symbols have leading _ whole process is $%£"% slow
352 # so skip aliases for now
356 # for binary coexistence, export both the symbol and
357 # alias with leading underscore
359 print "\t_$symbol = $symbol\n";
366 $export{$symbol} = 1;
371 # extra globals not included above.
472 win32_getprotobynumber