Commit | Line | Data |
549a6b10 |
1 | # |
2 | # Create the export list for perl. |
3 | # |
3cfae81b |
4 | # Needed by WIN32 and OS/2 for creating perl.dll |
5 | # and by AIX for creating libperl.a when -Dusershrplib is in effect. |
549a6b10 |
6 | # |
22c35a8c |
7 | # reads global.sym, pp.sym, perlvars.h, intrpvar.h, thrdvar.h, config.h |
3cfae81b |
8 | # On OS/2 reads miniperl.map as well |
0a753a76 |
9 | |
549a6b10 |
10 | my $PLATFORM; |
11 | my $CCTYPE; |
910dfcc8 |
12 | |
4cb71bb6 |
13 | my %bincompat5005 = |
14 | (Perl_call_argv => "perl_call_argv", |
15 | Perl_call_method => "perl_call_method", |
16 | Perl_call_pv => "perl_call_pv", |
17 | Perl_call_sv => "perl_call_sv", |
18 | Perl_get_av => "perl_get_av", |
19 | Perl_get_cv => "perl_get_cv", |
20 | Perl_get_hv => "perl_get_hv", |
21 | Perl_get_sv => "perl_get_sv", |
22 | Perl_init_i18nl10n => "perl_init_i18nl10n", |
23 | Perl_init_i18nl14n => "perl_init_i18nl14n", |
24 | Perl_new_collate => "perl_new_collate", |
25 | Perl_new_ctype => "perl_new_ctype", |
26 | Perl_new_numeric => "perl_new_numeric", |
27 | Perl_require_pv => "perl_require_pv", |
28 | Perl_safesyscalloc => "Perl_safecalloc", |
29 | Perl_safesysfree => "Perl_safefree", |
30 | Perl_safesysmalloc => "Perl_safemalloc", |
31 | Perl_safesysrealloc => "Perl_saferealloc", |
32 | Perl_set_numeric_local => "perl_set_numeric_local", |
62457c2b |
33 | Perl_set_numeric_standard => "perl_set_numeric_standard", |
34 | Perl_malloc => "malloc", |
35 | Perl_mfree => "free", |
36 | Perl_realloc => "realloc", |
37 | Perl_calloc => "calloc",); |
4cb71bb6 |
38 | |
39 | my $bincompat5005 = join("|", keys %bincompat5005); |
40 | |
910dfcc8 |
41 | while (@ARGV) |
d55594ae |
42 | { |
43 | my $flag = shift; |
44 | $define{$1} = 1 if ($flag =~ /^-D(\w+)$/); |
3cfae81b |
45 | $define{$1} = $2 if ($flag =~ /^-D(\w+)=(.+)$/); |
549a6b10 |
46 | $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/); |
47 | $PLATFORM = $1 if ($flag =~ /^PLATFORM=(\w+)$/); |
d55594ae |
48 | } |
49 | |
3cfae81b |
50 | my @PLATFORM = qw(aix win32 os2); |
549a6b10 |
51 | my %PLATFORM; |
52 | @PLATFORM{@PLATFORM} = (); |
53 | |
54 | defined $PLATFORM || die "PLATFORM undefined, must be one of: @PLATFORM\n"; |
55 | exists $PLATFORM{$PLATFORM} || die "PLATFORM must be one of: @PLATFORM\n"; |
56 | |
57 | my $config_sh = "config.sh"; |
58 | my $config_h = "config.h"; |
59 | my $thrdvar_h = "thrdvar.h"; |
60 | my $intrpvar_h = "intrpvar.h"; |
61 | my $perlvars_h = "perlvars.h"; |
62 | my $global_sym = "global.sym"; |
63 | my $pp_sym = "pp.sym"; |
64 | my $globvar_sym = "globvar.sym"; |
65 | my $perlio_sym = "perlio.sym"; |
66 | |
67 | if ($PLATFORM eq 'aix') { |
68 | # Nothing for now. |
69 | } elsif ($PLATFORM eq 'win32') { |
70 | $CCTYPE = "MSVC" unless defined $CCTYPE; |
71 | foreach ($thrdvar_h, $intrpvar_h, $perlvars_h, $global_sym, $pp_sym, $globvar_sym) { |
72 | s!^!..\\!; |
73 | } |
74 | } |
75 | |
76 | unless ($PLATFORM eq 'win32') { |
77 | open(CFG,$config_sh) || die "Cannot open $config_sh: $!\n"; |
78 | while (<CFG>) |
79 | { |
80 | if (/^(?:ccflags|optimize)='(.+)'$/) { |
81 | $_ = $1; |
82 | $define{$1} = 1 while /-D(\w+)/g; |
83 | } |
3cfae81b |
84 | if ($PLATFORM eq 'os2') { |
85 | $CONFIG_ARGS = $1 if /^(?:config_args)='(.+)'$/; |
86 | $ARCHNAME = $1 if /^(?:archname)='(.+)'$/; |
87 | } |
549a6b10 |
88 | } |
89 | close(CFG); |
90 | } |
91 | |
92 | open(CFG,$config_h) || die "Cannot open $config_h: $!\n"; |
bbc8f9de |
93 | while (<CFG>) |
94 | { |
95 | $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/; |
924b3ec4 |
96 | $define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/; |
549a6b10 |
97 | $define{$1} = 1 if /^\s*#\s*define\s+(USE_PERLIO)\b/; |
b86a2fa7 |
98 | $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/; |
4cb71bb6 |
99 | $define{$1} = 1 if /^\s*#\s*define\s+(PERL_BINCOMPAT_5005)\b/; |
bbc8f9de |
100 | } |
101 | close(CFG); |
102 | |
549a6b10 |
103 | if ($PLATFORM eq 'win32') { |
104 | warn join(' ',keys %define)."\n"; |
105 | if ($define{PERL_OBJECT}) { |
3075ddba |
106 | print "LIBRARY Perl56\n"; |
549a6b10 |
107 | print "DESCRIPTION 'Perl interpreter'\n"; |
108 | print "EXPORTS\n"; |
51371543 |
109 | # output_symbol("perl_alloc"); |
549a6b10 |
110 | output_symbol("perl_get_host_info"); |
111 | output_symbol("perl_alloc_using"); |
51371543 |
112 | # output_symbol("perl_construct"); |
113 | # output_symbol("perl_destruct"); |
114 | # output_symbol("perl_free"); |
115 | # output_symbol("perl_parse"); |
116 | # output_symbol("perl_run"); |
117 | # output_symbol("RunPerl"); |
51371543 |
118 | # exit(0); |
51371543 |
119 | } |
120 | else { |
549a6b10 |
121 | if ($CCTYPE ne 'GCC') { |
122 | print "LIBRARY Perl\n"; |
123 | print "DESCRIPTION 'Perl interpreter, export autogenerated'\n"; |
124 | } |
125 | else { |
126 | $define{'PERL_GLOBAL_STRUCT'} = 1; |
127 | $define{'MULTIPLICITY'} = 1; |
128 | } |
129 | print "EXPORTS\n"; |
130 | } |
3cfae81b |
131 | } elsif ($PLATFORM eq 'os2') { |
132 | ($v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/; |
133 | $v .= '-thread' if $ARCHNAME =~ /-thread/; |
134 | #$sum = 0; |
135 | #for (split //, $v) { |
136 | # $sum = ($sum * 33) + ord; |
137 | # $sum &= 0xffffff; |
138 | #} |
139 | #$sum += $sum >> 5; |
140 | #$sum &= 0xffff; |
141 | #$sum = printf '%X', $sum; |
142 | ($dll = $define{PERL_DLL}) =~ s/\.dll$//i; |
143 | # print STDERR "'$dll' <= '$define{PERL_DLL}'\n"; |
144 | print <<"---EOP---"; |
145 | LIBRARY '$dll' INITINSTANCE TERMINSTANCE |
146 | DESCRIPTION '\@#perl5-porters\@perl.org:$v#\@ Perl interpreter, configured as $CONFIG_ARGS' |
147 | STACKSIZE 32768 |
148 | CODE LOADONCALL |
149 | DATA LOADONCALL NONSHARED MULTIPLE |
150 | EXPORTS |
151 | ---EOP--- |
549a6b10 |
152 | } elsif ($PLATFORM eq 'aix') { |
153 | print "#!\n"; |
ac4c12e7 |
154 | } |
bbc8f9de |
155 | |
22239a37 |
156 | my %skip; |
157 | my %export; |
158 | |
51371543 |
159 | sub skip_symbols { |
160 | my $list = shift; |
161 | foreach my $symbol (@$list) { |
162 | $skip{$symbol} = 1; |
163 | } |
22239a37 |
164 | } |
165 | |
51371543 |
166 | sub emit_symbols { |
167 | my $list = shift; |
168 | foreach my $symbol (@$list) { |
169 | my $skipsym = $symbol; |
170 | # XXX hack |
171 | if ($define{PERL_OBJECT}) { |
172 | $skipsym =~ s/^Perl_[GIT](\w+)_ptr$/PL_$1/; |
173 | } |
174 | emit_symbol($symbol) unless exists $skip{$skipsym}; |
175 | } |
22239a37 |
176 | } |
177 | |
549a6b10 |
178 | if ($PLATFORM eq 'win32') { |
22239a37 |
179 | skip_symbols [qw( |
db15561c |
180 | PL_statusvalue_vms |
181 | PL_archpat_auto |
182 | PL_cryptseen |
183 | PL_DBcv |
184 | PL_generation |
db15561c |
185 | PL_lastgotoprobe |
186 | PL_linestart |
187 | PL_modcount |
188 | PL_pending_ident |
189 | PL_sortcxix |
190 | PL_sublex_info |
191 | PL_timesbuf |
4f63d024 |
192 | main |
193 | Perl_ErrorNo |
194 | Perl_GetVars |
a6c40364 |
195 | Perl_do_exec3 |
0a753a76 |
196 | Perl_do_ipcctl |
197 | Perl_do_ipcget |
198 | Perl_do_msgrcv |
199 | Perl_do_msgsnd |
200 | Perl_do_semop |
201 | Perl_do_shmio |
0a753a76 |
202 | Perl_dump_fds |
d55594ae |
203 | Perl_init_thread_intern |
0a753a76 |
204 | Perl_my_bzero |
205 | Perl_my_htonl |
206 | Perl_my_ntohl |
207 | Perl_my_swap |
208 | Perl_my_chsize |
0a753a76 |
209 | Perl_same_dirent |
68dc0745 |
210 | Perl_setenv_getix |
0a753a76 |
211 | Perl_unlnk |
0a753a76 |
212 | Perl_watch |
0a753a76 |
213 | Perl_safexcalloc |
214 | Perl_safexmalloc |
215 | Perl_safexfree |
216 | Perl_safexrealloc |
68dc0745 |
217 | Perl_my_memcmp |
8b10511d |
218 | Perl_my_memset |
db15561c |
219 | PL_cshlen |
220 | PL_cshname |
221 | PL_opsave |
32e30700 |
222 | |
223 | Perl_do_exec |
224 | Perl_getenv_len |
225 | Perl_my_pclose |
226 | Perl_my_popen |
22239a37 |
227 | )]; |
549a6b10 |
228 | } elsif ($PLATFORM eq 'aix') { |
229 | skip_symbols([qw( |
230 | Perl_dump_fds |
231 | Perl_ErrorNo |
232 | Perl_GetVars |
233 | Perl_my_bcopy |
234 | Perl_my_bzero |
235 | Perl_my_chsize |
236 | Perl_my_htonl |
237 | Perl_my_memcmp |
238 | Perl_my_memset |
239 | Perl_my_ntohl |
240 | Perl_my_swap |
241 | Perl_safexcalloc |
242 | Perl_safexfree |
243 | Perl_safexmalloc |
244 | Perl_safexrealloc |
245 | Perl_same_dirent |
246 | Perl_unlnk |
247 | PL_cryptseen |
248 | PL_opsave |
249 | PL_statusvalue_vms |
250 | PL_sys_intern |
251 | )]); |
252 | } |
0a753a76 |
253 | |
3cfae81b |
254 | if ($PLATFORM eq 'os2') { |
255 | emit_symbols([qw( |
256 | ctermid |
257 | get_sysinfo |
258 | Perl_OS2_init |
259 | OS2_Perl_data |
260 | dlopen |
261 | dlsym |
262 | dlerror |
263 | my_tmpfile |
264 | my_tmpnam |
265 | my_flock |
266 | malloc_mutex |
267 | threads_mutex |
268 | nthreads |
269 | nthreads_cond |
270 | os2_cond_wait |
0eb4ebd7 |
271 | os2_stat |
3cfae81b |
272 | pthread_join |
273 | pthread_create |
274 | pthread_detach |
275 | XS_Cwd_change_drive |
276 | XS_Cwd_current_drive |
277 | XS_Cwd_extLibpath |
278 | XS_Cwd_extLibpath_set |
279 | XS_Cwd_sys_abspath |
280 | XS_Cwd_sys_chdir |
281 | XS_Cwd_sys_cwd |
282 | XS_Cwd_sys_is_absolute |
283 | XS_Cwd_sys_is_relative |
284 | XS_Cwd_sys_is_rooted |
285 | XS_DynaLoader_mod2fname |
286 | XS_File__Copy_syscopy |
287 | Perl_Register_MQ |
288 | Perl_Deregister_MQ |
289 | Perl_Serve_Messages |
290 | Perl_Process_Messages |
291 | init_PMWIN_entries |
292 | PMWIN_entries |
293 | Perl_hab_GET |
294 | )]); |
295 | } |
296 | |
51371543 |
297 | if ($define{'PERL_OBJECT'}) { |
298 | skip_symbols [qw( |
299 | Perl_getenv_len |
300 | Perl_my_popen |
301 | Perl_my_pclose |
302 | )]; |
303 | } |
304 | else { |
305 | skip_symbols [qw( |
306 | PL_Dir |
307 | PL_Env |
308 | PL_LIO |
309 | PL_Mem |
310 | PL_Proc |
311 | PL_Sock |
312 | PL_StdIO |
313 | )]; |
314 | } |
c69f112c |
315 | |
bbc8f9de |
316 | if ($define{'MYMALLOC'}) |
317 | { |
22239a37 |
318 | emit_symbols [qw( |
9423c6fc |
319 | Perl_dump_mstats |
22239a37 |
320 | Perl_malloc |
f2517201 |
321 | Perl_mfree |
22239a37 |
322 | Perl_realloc |
323 | Perl_calloc)]; |
bbc8f9de |
324 | } |
32fcaa0b |
325 | else |
326 | { |
327 | skip_symbols [qw( |
df31f264 |
328 | Perl_dump_mstats |
4f63d024 |
329 | Perl_malloc |
330 | Perl_mfree |
331 | Perl_realloc |
332 | Perl_calloc |
32fcaa0b |
333 | Perl_malloced_size)]; |
334 | } |
bbc8f9de |
335 | |
d55594ae |
336 | unless ($define{'USE_THREADS'}) |
337 | { |
22239a37 |
338 | skip_symbols [qw( |
db15561c |
339 | PL_thr_key |
340 | PL_sv_mutex |
46124e9e |
341 | PL_strtab_mutex |
db15561c |
342 | PL_svref_mutex |
343 | PL_malloc_mutex |
5ff3f7a4 |
344 | PL_cred_mutex |
db15561c |
345 | PL_eval_mutex |
346 | PL_eval_cond |
347 | PL_eval_owner |
348 | PL_threads_mutex |
349 | PL_nthreads |
350 | PL_nthreads_cond |
351 | PL_threadnum |
352 | PL_threadsv_names |
353 | PL_thrsv |
22c35a8c |
354 | PL_vtbl_mutex |
eb480a0b |
355 | Perl_getTHR |
356 | Perl_setTHR |
d55594ae |
357 | Perl_condpair_magic |
32f822de |
358 | Perl_new_struct_thread |
32f822de |
359 | Perl_per_thread_magicals |
d4cce5f1 |
360 | Perl_thread_create |
361 | Perl_find_threadsv |
d55594ae |
362 | Perl_unlock_condpair |
d55594ae |
363 | Perl_magic_mutexfree |
95906810 |
364 | )]; |
910dfcc8 |
365 | } |
d18c6117 |
366 | |
367 | unless ($define{'USE_ITHREADS'}) |
368 | { |
369 | skip_symbols [qw( |
5f7fde29 |
370 | PL_ptr_table |
d18c6117 |
371 | Perl_dirp_dup |
8d563012 |
372 | Perl_cx_dup |
373 | Perl_si_dup |
374 | Perl_ss_dup |
d18c6117 |
375 | Perl_fp_dup |
376 | Perl_gp_dup |
377 | Perl_he_dup |
378 | Perl_mg_dup |
379 | Perl_re_dup |
380 | Perl_sv_dup |
381 | Perl_sys_intern_dup |
5f7fde29 |
382 | Perl_ptr_table_fetch |
383 | Perl_ptr_table_new |
384 | Perl_ptr_table_split |
385 | Perl_ptr_table_store |
386 | perl_clone |
387 | perl_clone_using |
d18c6117 |
388 | )]; |
389 | } |
390 | |
c5be433b |
391 | unless ($define{'USE_THREADS'} or $define{'PERL_IMPLICIT_CONTEXT'} |
392 | or $define{'PERL_OBJECT'}) |
393 | { |
4f63d024 |
394 | skip_symbols [qw( |
395 | Perl_croak_nocontext |
396 | Perl_die_nocontext |
c5be433b |
397 | Perl_deb_nocontext |
4f63d024 |
398 | Perl_form_nocontext |
9c1db463 |
399 | Perl_mess_nocontext |
4f63d024 |
400 | Perl_warn_nocontext |
c5be433b |
401 | Perl_warner_nocontext |
4f63d024 |
402 | Perl_newSVpvf_nocontext |
403 | Perl_sv_catpvf_nocontext |
404 | Perl_sv_setpvf_nocontext |
405 | Perl_sv_catpvf_mg_nocontext |
406 | Perl_sv_setpvf_mg_nocontext |
407 | )]; |
408 | } |
d4cce5f1 |
409 | |
910dfcc8 |
410 | unless ($define{'FAKE_THREADS'}) |
411 | { |
db15561c |
412 | skip_symbols [qw(PL_curthr)]; |
d55594ae |
413 | } |
414 | |
22239a37 |
415 | sub readvar |
416 | { |
417 | my $file = shift; |
51371543 |
418 | my $proc = shift || sub { "PL_$_[2]" }; |
549a6b10 |
419 | open(VARS,$file) || die "Cannot open $file: $!\n"; |
22239a37 |
420 | my @syms; |
421 | while (<VARS>) |
422 | { |
423 | # All symbols have a Perl_ prefix because that's what embed.h |
424 | # sticks in front of them. |
51371543 |
425 | push(@syms, &$proc($1,$2,$3)) if (/\bPERLVAR(A?I?C?)\(([IGT])(\w+)/); |
22239a37 |
426 | } |
427 | close(VARS); |
428 | return \@syms; |
429 | } |
430 | |
d4cce5f1 |
431 | if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'}) |
d55594ae |
432 | { |
549a6b10 |
433 | my $thrd = readvar($thrdvar_h); |
22239a37 |
434 | skip_symbols $thrd; |
d55594ae |
435 | } |
436 | |
d4cce5f1 |
437 | if ($define{'MULTIPLICITY'}) |
d55594ae |
438 | { |
549a6b10 |
439 | my $interp = readvar($intrpvar_h); |
22239a37 |
440 | skip_symbols $interp; |
441 | } |
442 | |
443 | if ($define{'PERL_GLOBAL_STRUCT'}) |
444 | { |
549a6b10 |
445 | my $global = readvar($perlvars_h); |
22239a37 |
446 | skip_symbols $global; |
d543acb6 |
447 | emit_symbol('Perl_GetVars'); |
db15561c |
448 | emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC'; |
d4cce5f1 |
449 | } |
d55594ae |
450 | |
36c15d3f |
451 | unless ($define{'DEBUGGING'}) |
452 | { |
22239a37 |
453 | skip_symbols [qw( |
fea7140c |
454 | Perl_deb |
455 | Perl_deb_growlevel |
456 | Perl_debop |
457 | Perl_debprofdump |
458 | Perl_debstack |
459 | Perl_debstackptrs |
22239a37 |
460 | Perl_runops_debug |
461 | Perl_sv_peek |
3836fe67 |
462 | PL_block_type |
22c35a8c |
463 | PL_watchaddr |
464 | PL_watchok)]; |
36c15d3f |
465 | } |
466 | |
22c35a8c |
467 | # functions from *.sym files |
468 | |
549a6b10 |
469 | my @syms = ($global_sym, $pp_sym, $globvar_sym); |
470 | |
471 | if ($define{'USE_PERLIO'}) |
22239a37 |
472 | { |
549a6b10 |
473 | push @syms, $perlio_sym; |
474 | } |
475 | |
476 | for my $syms (@syms) |
477 | { |
478 | open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n"; |
22c35a8c |
479 | while (<GLOBAL>) |
480 | { |
481 | next if (!/^[A-Za-z]/); |
482 | # Functions have a Perl_ prefix |
483 | # Variables have a PL_ prefix |
484 | chomp($_); |
4f63d024 |
485 | my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : ""); |
22c35a8c |
486 | $symbol .= $_; |
487 | emit_symbol($symbol) unless exists $skip{$symbol}; |
488 | } |
489 | close(GLOBAL); |
22239a37 |
490 | } |
0a753a76 |
491 | |
22c35a8c |
492 | # variables |
0a753a76 |
493 | |
51371543 |
494 | if ($define{'PERL_OBJECT'}) { |
43cd9f80 |
495 | for my $f ($perlvars_h, $intrpvar_h, $thrdvar_h) { |
51371543 |
496 | my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" }); |
497 | emit_symbols $glob; |
498 | } |
499 | } |
500 | else { |
501 | unless ($define{'PERL_GLOBAL_STRUCT'}) { |
549a6b10 |
502 | my $glob = readvar($perlvars_h); |
51371543 |
503 | emit_symbols $glob; |
504 | } |
505 | unless ($define{'MULTIPLICITY'}) { |
549a6b10 |
506 | my $glob = readvar($intrpvar_h); |
51371543 |
507 | emit_symbols $glob; |
508 | } |
509 | |
510 | unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'}) { |
549a6b10 |
511 | my $glob = readvar($thrdvar_h); |
51371543 |
512 | emit_symbols $glob; |
513 | } |
514 | } |
0a753a76 |
515 | |
549a6b10 |
516 | sub try_symbol { |
517 | my $symbol = shift; |
22239a37 |
518 | |
549a6b10 |
519 | return if $symbol !~ /^[A-Za-z]/; |
520 | return if $symbol =~ /^\#/; |
521 | $symbol =~s/\r//g; |
522 | chomp($symbol); |
43cd9f80 |
523 | return if exists $skip{$symbol}; |
549a6b10 |
524 | emit_symbol($symbol); |
3e3baf6d |
525 | } |
0a753a76 |
526 | |
549a6b10 |
527 | while (<DATA>) { |
528 | try_symbol($_); |
ac4c12e7 |
529 | } |
530 | |
549a6b10 |
531 | if ($PLATFORM eq 'win32') { |
532 | foreach my $symbol (qw( |
d28b3ca3 |
533 | boot_DynaLoader |
549a6b10 |
534 | Perl_getTHR |
535 | Perl_init_os_extras |
536 | Perl_setTHR |
d55594ae |
537 | Perl_thread_create |
549a6b10 |
538 | Perl_win32_init |
539 | RunPerl |
43cd9f80 |
540 | GetPerlInterpreter |
541 | SetPerlInterpreter |
68dc0745 |
542 | win32_errno |
96e4d5b1 |
543 | win32_environ |
68dc0745 |
544 | win32_stdin |
545 | win32_stdout |
96e4d5b1 |
546 | win32_stderr |
68dc0745 |
547 | win32_ferror |
548 | win32_feof |
549 | win32_strerror |
550 | win32_fprintf |
551 | win32_printf |
552 | win32_vfprintf |
96e4d5b1 |
553 | win32_vprintf |
68dc0745 |
554 | win32_fread |
555 | win32_fwrite |
556 | win32_fopen |
557 | win32_fdopen |
558 | win32_freopen |
559 | win32_fclose |
560 | win32_fputs |
561 | win32_fputc |
562 | win32_ungetc |
563 | win32_getc |
564 | win32_fileno |
565 | win32_clearerr |
566 | win32_fflush |
567 | win32_ftell |
568 | win32_fseek |
569 | win32_fgetpos |
570 | win32_fsetpos |
571 | win32_rewind |
572 | win32_tmpfile |
573 | win32_abort |
574 | win32_fstat |
96e4d5b1 |
575 | win32_stat |
68dc0745 |
576 | win32_pipe |
577 | win32_popen |
578 | win32_pclose |
e24c7c18 |
579 | win32_rename |
68dc0745 |
580 | win32_setmode |
96e4d5b1 |
581 | win32_lseek |
582 | win32_tell |
68dc0745 |
583 | win32_dup |
584 | win32_dup2 |
96e4d5b1 |
585 | win32_open |
586 | win32_close |
587 | win32_eof |
68dc0745 |
588 | win32_read |
589 | win32_write |
3e3baf6d |
590 | win32_spawnvp |
5aabfad6 |
591 | win32_mkdir |
592 | win32_rmdir |
593 | win32_chdir |
c90c0ff4 |
594 | win32_flock |
eb62e965 |
595 | win32_execv |
6890e559 |
596 | win32_execvp |
54310121 |
597 | win32_htons |
598 | win32_ntohs |
599 | win32_htonl |
600 | win32_ntohl |
601 | win32_inet_addr |
602 | win32_inet_ntoa |
603 | win32_socket |
604 | win32_bind |
605 | win32_listen |
606 | win32_accept |
607 | win32_connect |
608 | win32_send |
609 | win32_sendto |
610 | win32_recv |
611 | win32_recvfrom |
612 | win32_shutdown |
3a25acb4 |
613 | win32_closesocket |
54310121 |
614 | win32_ioctlsocket |
615 | win32_setsockopt |
616 | win32_getsockopt |
617 | win32_getpeername |
618 | win32_getsockname |
619 | win32_gethostname |
620 | win32_gethostbyname |
621 | win32_gethostbyaddr |
622 | win32_getprotobyname |
623 | win32_getprotobynumber |
624 | win32_getservbyname |
625 | win32_getservbyport |
626 | win32_select |
627 | win32_endhostent |
628 | win32_endnetent |
629 | win32_endprotoent |
630 | win32_endservent |
631 | win32_getnetent |
632 | win32_getnetbyname |
633 | win32_getnetbyaddr |
634 | win32_getprotoent |
635 | win32_getservent |
636 | win32_sethostent |
637 | win32_setnetent |
638 | win32_setprotoent |
639 | win32_setservent |
ad2e33dc |
640 | win32_getenv |
ac5c734f |
641 | win32_putenv |
84902520 |
642 | win32_perror |
643 | win32_setbuf |
644 | win32_setvbuf |
645 | win32_flushall |
646 | win32_fcloseall |
647 | win32_fgets |
648 | win32_gets |
649 | win32_fgetc |
650 | win32_putc |
651 | win32_puts |
652 | win32_getchar |
653 | win32_putchar |
654 | win32_malloc |
655 | win32_calloc |
656 | win32_realloc |
657 | win32_free |
f3986ebb |
658 | win32_sleep |
659 | win32_times |
660 | win32_alarm |
65e48ea9 |
661 | win32_open_osfhandle |
662 | win32_get_osfhandle |
f998180f |
663 | win32_ioctl |
ad0751ec |
664 | win32_utime |
b2af26b1 |
665 | win32_uname |
22fae026 |
666 | win32_wait |
f55ee38a |
667 | win32_waitpid |
668 | win32_kill |
22fae026 |
669 | win32_str_os_error |
ce2e26e5 |
670 | win32_opendir |
671 | win32_readdir |
672 | win32_telldir |
673 | win32_seekdir |
674 | win32_rewinddir |
675 | win32_closedir |
8ac9c18d |
676 | win32_longpath |
0cb96387 |
677 | win32_os_id |
25dbdbbc |
678 | win32_crypt |
549a6b10 |
679 | )) { |
680 | try_symbol($symbol); |
681 | } |
682 | } |
3cfae81b |
683 | elsif ($PLATFORM eq 'os2') { |
684 | open MAP, 'miniperl.map' or die 'Cannot read miniperl.map'; |
685 | /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>; |
686 | close MAP or die 'Cannot close miniperl.map'; |
687 | |
0eb4ebd7 |
688 | @missing = grep { !exists $mapped{$_} and !exists $bincompat5005{$_} } |
689 | keys %export; |
3cfae81b |
690 | delete $export{$_} foreach @missing; |
691 | } |
22239a37 |
692 | |
549a6b10 |
693 | # Now all symbols should be defined because |
694 | # next we are going to output them. |
695 | |
696 | foreach my $symbol (sort keys %export) |
697 | { |
698 | output_symbol($symbol); |
699 | } |
700 | |
701 | sub emit_symbol { |
702 | my $symbol = shift; |
703 | chomp($symbol); |
704 | $export{$symbol} = 1; |
705 | } |
706 | |
707 | sub output_symbol { |
708 | my $symbol = shift; |
4cb71bb6 |
709 | $symbol = $bincompat5005{$symbol} |
710 | if $define{PERL_BINCOMPAT_5005} and $symbol =~ /^($bincompat5005)$/; |
549a6b10 |
711 | if ($PLATFORM eq 'win32') { |
549a6b10 |
712 | $symbol = "_$symbol" if $CCTYPE eq 'BORLAND'; |
520c758a |
713 | print "\t$symbol\n"; |
549a6b10 |
714 | # XXX: binary compatibility between compilers is an exercise |
715 | # in frustration :-( |
716 | # if ($CCTYPE eq "BORLAND") { |
717 | # # workaround Borland quirk by exporting both the straight |
718 | # # name and a name with leading underscore. Note the |
719 | # # alias *must* come after the symbol itself, if both |
720 | # # are to be exported. (Linker bug?) |
721 | # print "\t_$symbol\n"; |
722 | # print "\t$symbol = _$symbol\n"; |
723 | # } |
724 | # elsif ($CCTYPE eq 'GCC') { |
725 | # # Symbols have leading _ whole process is $%@"% slow |
726 | # # so skip aliases for now |
727 | # nprint "\t$symbol\n"; |
728 | # } |
729 | # else { |
730 | # # for binary coexistence, export both the symbol and |
731 | # # alias with leading underscore |
732 | # print "\t$symbol\n"; |
733 | # print "\t_$symbol = $symbol\n"; |
734 | # } |
3cfae81b |
735 | } elsif ($PLATFORM eq 'os2') { |
736 | print qq( "$symbol"\n); |
549a6b10 |
737 | } elsif ($PLATFORM eq 'aix') { |
738 | print "$symbol\n"; |
739 | } |
740 | } |
741 | |
742 | 1; |
743 | __DATA__ |
744 | # extra globals not included above. |
745 | perl_alloc |
746 | perl_construct |
747 | perl_destruct |
748 | perl_free |
749 | perl_parse |
750 | perl_run |