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};
115 Perl_init_thread_intern
151 Perl_scan_inputsymbol
166 Perl_too_few_arguments
167 Perl_too_many_arguments
194 if ($define{'MYMALLOC'})
208 unless ($define{'USE_THREADS'})
219 Perl_new_struct_thread
222 Perl_per_thread_magicals
238 unless ($define{'FAKE_THREADS'})
240 skip_symbols [qw(Perl_curthr)];
246 open(VARS,$file) || die "Cannot open $file:$!";
250 # All symbols have a Perl_ prefix because that's what embed.h
251 # sticks in front of them.
252 push(@syms,"Perl_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/);
258 if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
260 my $thrd = readvar("../thrdvar.h");
264 if ($define{'MULTIPLICITY'})
266 my $interp = readvar("../intrpvar.h");
267 skip_symbols $interp;
270 if ($define{'PERL_GLOBAL_STRUCT'})
272 my $global = readvar("../perlvars.h");
273 skip_symbols $global;
276 unless ($define{'DEBUGGING'})
285 if ($define{'HAVE_DES_FCRYPT'})
287 emit_symbols [qw(win32_crypt)];
290 open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!;
293 next if (!/^[A-Za-z]/);
294 next if (/_amg[ \t]*$/);
295 # All symbols have a Perl_ prefix because that's what embed.h
296 # sticks in front of them.
298 my $symbol = "Perl_$_";
299 emit_symbol($symbol) unless exists $skip{$symbol};
303 # also add symbols from interp.sym
304 # They are only needed if -DMULTIPLICITY is not set but it
305 # doesn't hurt to include them anyway.
306 # these don't have Perl prefix
308 if ($define{'PERL_GLOBAL_STRUCT'})
310 emit_symbol( ($CCTYPE eq 'GCC') ? 'Perl_GetVars' : 'Perl_VarsPtr')
314 my $glob = readvar("../perlvars.h");
318 unless ($define{'MULTIPLICITY'})
320 my $glob = readvar("../intrpvar.h");
324 unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'})
326 my $glob = readvar("../thrdvar.h");
332 next if (!/^[A-Za-z]/);
337 next if exists $skip{$symbol};
338 emit_symbol($symbol);
341 foreach my $symbol (sort keys %export)
343 if ($CCTYPE eq "BORLAND") {
344 # workaround Borland quirk by exporting both the straight
345 # name and a name with leading underscore. Note the
346 # alias *must* come after the symbol itself, if both
347 # are to be exported. (Linker bug?)
348 print "\t_$symbol\n";
349 print "\t$symbol = _$symbol\n";
351 elsif ($CCTYPE eq 'GCC') {
352 # Symbols have leading _ whole process is $%£"% slow
353 # so skip aliases for now
357 # for binary coexistence, export both the symbol and
358 # alias with leading underscore
360 print "\t_$symbol = $symbol\n";
367 $export{$symbol} = 1;
372 # extra globals not included above.
473 win32_getprotobynumber