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 | |
7766f137 |
41 | while (@ARGV) { |
42 | my $flag = shift; |
43 | $define{$1} = 1 if ($flag =~ /^-D(\w+)$/); |
44 | $define{$1} = $2 if ($flag =~ /^-D(\w+)=(.+)$/); |
45 | $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/); |
46 | $PLATFORM = $1 if ($flag =~ /^PLATFORM=(\w+)$/); |
47 | } |
d55594ae |
48 | |
3cfae81b |
49 | my @PLATFORM = qw(aix win32 os2); |
549a6b10 |
50 | my %PLATFORM; |
51 | @PLATFORM{@PLATFORM} = (); |
52 | |
53 | defined $PLATFORM || die "PLATFORM undefined, must be one of: @PLATFORM\n"; |
54 | exists $PLATFORM{$PLATFORM} || die "PLATFORM must be one of: @PLATFORM\n"; |
55 | |
56 | my $config_sh = "config.sh"; |
57 | my $config_h = "config.h"; |
58 | my $thrdvar_h = "thrdvar.h"; |
59 | my $intrpvar_h = "intrpvar.h"; |
60 | my $perlvars_h = "perlvars.h"; |
61 | my $global_sym = "global.sym"; |
62 | my $pp_sym = "pp.sym"; |
63 | my $globvar_sym = "globvar.sym"; |
64 | my $perlio_sym = "perlio.sym"; |
65 | |
66 | if ($PLATFORM eq 'aix') { |
67 | # Nothing for now. |
7766f137 |
68 | } |
69 | elsif ($PLATFORM eq 'win32') { |
549a6b10 |
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"; |
7766f137 |
78 | while (<CFG>) { |
549a6b10 |
79 | if (/^(?:ccflags|optimize)='(.+)'$/) { |
80 | $_ = $1; |
81 | $define{$1} = 1 while /-D(\w+)/g; |
82 | } |
3cfae81b |
83 | if ($PLATFORM eq 'os2') { |
84 | $CONFIG_ARGS = $1 if /^(?:config_args)='(.+)'$/; |
85 | $ARCHNAME = $1 if /^(?:archname)='(.+)'$/; |
86 | } |
549a6b10 |
87 | } |
88 | close(CFG); |
89 | } |
90 | |
91 | open(CFG,$config_h) || die "Cannot open $config_h: $!\n"; |
7766f137 |
92 | while (<CFG>) { |
93 | $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/; |
94 | $define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/; |
95 | $define{$1} = 1 if /^\s*#\s*define\s+(USE_PERLIO)\b/; |
96 | $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/; |
97 | $define{$1} = 1 if /^\s*#\s*define\s+(PERL_BINCOMPAT_5005)\b/; |
98 | } |
bbc8f9de |
99 | close(CFG); |
100 | |
549a6b10 |
101 | if ($PLATFORM eq 'win32') { |
102 | warn join(' ',keys %define)."\n"; |
103 | if ($define{PERL_OBJECT}) { |
3075ddba |
104 | print "LIBRARY Perl56\n"; |
549a6b10 |
105 | print "DESCRIPTION 'Perl interpreter'\n"; |
106 | print "EXPORTS\n"; |
51371543 |
107 | # output_symbol("perl_alloc"); |
549a6b10 |
108 | output_symbol("perl_get_host_info"); |
7766f137 |
109 | output_symbol("perl_alloc_override"); |
51371543 |
110 | # output_symbol("perl_construct"); |
111 | # output_symbol("perl_destruct"); |
112 | # output_symbol("perl_free"); |
113 | # output_symbol("perl_parse"); |
114 | # output_symbol("perl_run"); |
115 | # output_symbol("RunPerl"); |
51371543 |
116 | # exit(0); |
51371543 |
117 | } |
118 | else { |
549a6b10 |
119 | if ($CCTYPE ne 'GCC') { |
120 | print "LIBRARY Perl\n"; |
121 | print "DESCRIPTION 'Perl interpreter, export autogenerated'\n"; |
122 | } |
123 | else { |
124 | $define{'PERL_GLOBAL_STRUCT'} = 1; |
125 | $define{'MULTIPLICITY'} = 1; |
126 | } |
127 | print "EXPORTS\n"; |
128 | } |
7766f137 |
129 | } |
130 | elsif ($PLATFORM eq 'os2') { |
3cfae81b |
131 | ($v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/; |
132 | $v .= '-thread' if $ARCHNAME =~ /-thread/; |
133 | #$sum = 0; |
134 | #for (split //, $v) { |
135 | # $sum = ($sum * 33) + ord; |
136 | # $sum &= 0xffffff; |
137 | #} |
138 | #$sum += $sum >> 5; |
139 | #$sum &= 0xffff; |
140 | #$sum = printf '%X', $sum; |
141 | ($dll = $define{PERL_DLL}) =~ s/\.dll$//i; |
142 | # print STDERR "'$dll' <= '$define{PERL_DLL}'\n"; |
143 | print <<"---EOP---"; |
144 | LIBRARY '$dll' INITINSTANCE TERMINSTANCE |
145 | DESCRIPTION '\@#perl5-porters\@perl.org:$v#\@ Perl interpreter, configured as $CONFIG_ARGS' |
146 | STACKSIZE 32768 |
147 | CODE LOADONCALL |
148 | DATA LOADONCALL NONSHARED MULTIPLE |
149 | EXPORTS |
150 | ---EOP--- |
7766f137 |
151 | } |
152 | elsif ($PLATFORM eq 'aix') { |
549a6b10 |
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') { |
7766f137 |
179 | skip_symbols [qw( |
180 | PL_statusvalue_vms |
181 | PL_archpat_auto |
182 | PL_cryptseen |
183 | PL_DBcv |
184 | PL_generation |
185 | PL_lastgotoprobe |
186 | PL_linestart |
187 | PL_modcount |
188 | PL_pending_ident |
189 | PL_sortcxix |
190 | PL_sublex_info |
191 | PL_timesbuf |
192 | main |
193 | Perl_ErrorNo |
194 | Perl_GetVars |
195 | Perl_do_exec3 |
196 | Perl_do_ipcctl |
197 | Perl_do_ipcget |
198 | Perl_do_msgrcv |
199 | Perl_do_msgsnd |
200 | Perl_do_semop |
201 | Perl_do_shmio |
202 | Perl_dump_fds |
203 | Perl_init_thread_intern |
204 | Perl_my_bzero |
205 | Perl_my_htonl |
206 | Perl_my_ntohl |
207 | Perl_my_swap |
208 | Perl_my_chsize |
209 | Perl_same_dirent |
210 | Perl_setenv_getix |
211 | Perl_unlnk |
212 | Perl_watch |
213 | Perl_safexcalloc |
214 | Perl_safexmalloc |
215 | Perl_safexfree |
216 | Perl_safexrealloc |
217 | Perl_my_memcmp |
218 | Perl_my_memset |
219 | PL_cshlen |
220 | PL_cshname |
221 | PL_opsave |
222 | Perl_do_exec |
223 | Perl_getenv_len |
224 | Perl_my_pclose |
225 | Perl_my_popen |
226 | )]; |
227 | } |
228 | elsif ($PLATFORM eq 'aix') { |
549a6b10 |
229 | skip_symbols([qw( |
7766f137 |
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 | } |
253 | elsif ($PLATFORM eq 'os2') { |
3cfae81b |
254 | emit_symbols([qw( |
7766f137 |
255 | ctermid |
256 | get_sysinfo |
257 | Perl_OS2_init |
258 | OS2_Perl_data |
259 | dlopen |
260 | dlsym |
261 | dlerror |
262 | my_tmpfile |
263 | my_tmpnam |
264 | my_flock |
265 | malloc_mutex |
266 | threads_mutex |
267 | nthreads |
268 | nthreads_cond |
269 | os2_cond_wait |
270 | os2_stat |
271 | pthread_join |
272 | pthread_create |
273 | pthread_detach |
274 | XS_Cwd_change_drive |
275 | XS_Cwd_current_drive |
276 | XS_Cwd_extLibpath |
277 | XS_Cwd_extLibpath_set |
278 | XS_Cwd_sys_abspath |
279 | XS_Cwd_sys_chdir |
280 | XS_Cwd_sys_cwd |
281 | XS_Cwd_sys_is_absolute |
282 | XS_Cwd_sys_is_relative |
283 | XS_Cwd_sys_is_rooted |
284 | XS_DynaLoader_mod2fname |
285 | XS_File__Copy_syscopy |
286 | Perl_Register_MQ |
287 | Perl_Deregister_MQ |
288 | Perl_Serve_Messages |
289 | Perl_Process_Messages |
290 | init_PMWIN_entries |
291 | PMWIN_entries |
292 | Perl_hab_GET |
293 | )]); |
3cfae81b |
294 | } |
295 | |
7766f137 |
296 | unless ($define{'DEBUGGING'}) { |
297 | skip_symbols [qw( |
298 | Perl_deb |
299 | Perl_deb_growlevel |
300 | Perl_debop |
301 | Perl_debprofdump |
302 | Perl_debstack |
303 | Perl_debstackptrs |
304 | Perl_runops_debug |
305 | Perl_sv_peek |
306 | PL_block_type |
307 | PL_watchaddr |
308 | PL_watchok |
309 | )]; |
310 | } |
311 | |
312 | if ($define{'PERL_IMPLICIT_SYS'}) { |
313 | skip_symbols [qw( |
314 | Perl_getenv_len |
315 | Perl_my_popen |
316 | Perl_my_pclose |
317 | )]; |
318 | } |
319 | else { |
320 | skip_symbols [qw( |
321 | PL_Mem |
322 | PL_MemShared |
323 | PL_MemParse |
324 | PL_Env |
325 | PL_StdIO |
326 | PL_LIO |
327 | PL_Dir |
328 | PL_Sock |
329 | PL_Proc |
330 | )]; |
331 | } |
332 | |
333 | if ($define{'MYMALLOC'}) { |
334 | emit_symbols [qw( |
335 | Perl_dump_mstats |
336 | Perl_malloc |
337 | Perl_mfree |
338 | Perl_realloc |
339 | Perl_calloc |
340 | )]; |
1feb2720 |
341 | if ($define{'USE_THREADS'} || $define{'USE_ITHREADS'}) { |
342 | emit_symbols [qw( |
343 | PL_malloc_mutex |
344 | )]; |
345 | } |
51371543 |
346 | } |
347 | else { |
7766f137 |
348 | skip_symbols [qw( |
349 | PL_malloc_mutex |
350 | Perl_dump_mstats |
351 | Perl_malloc |
352 | Perl_mfree |
353 | Perl_realloc |
354 | Perl_calloc |
355 | Perl_malloced_size |
356 | )]; |
357 | } |
358 | |
359 | unless ($define{'USE_THREADS'}) { |
360 | skip_symbols [qw( |
361 | PL_thr_key |
362 | PL_sv_mutex |
363 | PL_strtab_mutex |
364 | PL_svref_mutex |
7766f137 |
365 | PL_cred_mutex |
366 | PL_eval_mutex |
367 | PL_eval_cond |
368 | PL_eval_owner |
369 | PL_threads_mutex |
370 | PL_nthreads |
371 | PL_nthreads_cond |
372 | PL_threadnum |
373 | PL_threadsv_names |
374 | PL_thrsv |
375 | PL_vtbl_mutex |
376 | Perl_getTHR |
377 | Perl_setTHR |
378 | Perl_condpair_magic |
379 | Perl_new_struct_thread |
380 | Perl_per_thread_magicals |
381 | Perl_thread_create |
382 | Perl_find_threadsv |
383 | Perl_unlock_condpair |
384 | Perl_magic_mutexfree |
385 | )]; |
386 | } |
387 | |
388 | unless ($define{'USE_ITHREADS'}) { |
389 | skip_symbols [qw( |
390 | PL_ptr_table |
391 | Perl_dirp_dup |
392 | Perl_cx_dup |
393 | Perl_si_dup |
394 | Perl_any_dup |
395 | Perl_ss_dup |
396 | Perl_fp_dup |
397 | Perl_gp_dup |
398 | Perl_he_dup |
399 | Perl_mg_dup |
400 | Perl_re_dup |
401 | Perl_sv_dup |
402 | Perl_sys_intern_dup |
403 | Perl_ptr_table_fetch |
404 | Perl_ptr_table_new |
405 | Perl_ptr_table_split |
406 | Perl_ptr_table_store |
407 | perl_clone |
408 | perl_clone_using |
409 | )]; |
410 | } |
411 | |
412 | unless ($define{'PERL_IMPLICIT_CONTEXT'}) { |
413 | skip_symbols [qw( |
414 | Perl_croak_nocontext |
415 | Perl_die_nocontext |
416 | Perl_deb_nocontext |
417 | Perl_form_nocontext |
418 | Perl_mess_nocontext |
419 | Perl_warn_nocontext |
420 | Perl_warner_nocontext |
421 | Perl_newSVpvf_nocontext |
422 | Perl_sv_catpvf_nocontext |
423 | Perl_sv_setpvf_nocontext |
424 | Perl_sv_catpvf_mg_nocontext |
425 | Perl_sv_setpvf_mg_nocontext |
426 | )]; |
427 | } |
428 | |
429 | unless ($define{'PERL_IMPLICIT_SYS'}) { |
430 | skip_symbols [qw( |
431 | perl_alloc_using |
014822e4 |
432 | perl_clone_using |
7766f137 |
433 | )]; |
434 | } |
435 | |
436 | unless ($define{'FAKE_THREADS'}) { |
437 | skip_symbols [qw(PL_curthr)]; |
438 | } |
439 | |
440 | sub readvar { |
441 | my $file = shift; |
442 | my $proc = shift || sub { "PL_$_[2]" }; |
443 | open(VARS,$file) || die "Cannot open $file: $!\n"; |
444 | my @syms; |
445 | while (<VARS>) { |
446 | # All symbols have a Perl_ prefix because that's what embed.h |
447 | # sticks in front of them. |
448 | push(@syms, &$proc($1,$2,$3)) if (/\bPERLVAR(A?I?C?)\(([IGT])(\w+)/); |
449 | } |
450 | close(VARS); |
451 | return \@syms; |
452 | } |
453 | |
454 | if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'}) { |
455 | my $thrd = readvar($thrdvar_h); |
456 | skip_symbols $thrd; |
457 | } |
458 | |
459 | if ($define{'MULTIPLICITY'}) { |
460 | my $interp = readvar($intrpvar_h); |
461 | skip_symbols $interp; |
462 | } |
463 | |
464 | if ($define{'PERL_GLOBAL_STRUCT'}) { |
465 | my $global = readvar($perlvars_h); |
466 | skip_symbols $global; |
467 | emit_symbol('Perl_GetVars'); |
468 | emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC'; |
469 | } |
36c15d3f |
470 | |
22c35a8c |
471 | # functions from *.sym files |
472 | |
549a6b10 |
473 | my @syms = ($global_sym, $pp_sym, $globvar_sym); |
474 | |
7766f137 |
475 | if ($define{'USE_PERLIO'}) { |
549a6b10 |
476 | push @syms, $perlio_sym; |
7766f137 |
477 | } |
478 | |
479 | for my $syms (@syms) { |
480 | open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n"; |
481 | while (<GLOBAL>) { |
482 | next if (!/^[A-Za-z]/); |
483 | # Functions have a Perl_ prefix |
484 | # Variables have a PL_ prefix |
485 | chomp($_); |
486 | my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : ""); |
487 | $symbol .= $_; |
488 | emit_symbol($symbol) unless exists $skip{$symbol}; |
489 | } |
490 | close(GLOBAL); |
491 | } |
0a753a76 |
492 | |
22c35a8c |
493 | # variables |
0a753a76 |
494 | |
51371543 |
495 | if ($define{'PERL_OBJECT'}) { |
43cd9f80 |
496 | for my $f ($perlvars_h, $intrpvar_h, $thrdvar_h) { |
51371543 |
497 | my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" }); |
498 | emit_symbols $glob; |
499 | } |
500 | } |
501 | else { |
502 | unless ($define{'PERL_GLOBAL_STRUCT'}) { |
549a6b10 |
503 | my $glob = readvar($perlvars_h); |
51371543 |
504 | emit_symbols $glob; |
505 | } |
506 | unless ($define{'MULTIPLICITY'}) { |
549a6b10 |
507 | my $glob = readvar($intrpvar_h); |
51371543 |
508 | emit_symbols $glob; |
509 | } |
51371543 |
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( |
7766f137 |
533 | boot_DynaLoader |
534 | Perl_getTHR |
535 | Perl_init_os_extras |
536 | Perl_setTHR |
537 | Perl_thread_create |
538 | Perl_win32_init |
539 | RunPerl |
540 | GetPerlInterpreter |
541 | SetPerlInterpreter |
542 | win32_errno |
543 | win32_environ |
544 | win32_stdin |
545 | win32_stdout |
546 | win32_stderr |
547 | win32_ferror |
548 | win32_feof |
549 | win32_strerror |
550 | win32_fprintf |
551 | win32_printf |
552 | win32_vfprintf |
553 | win32_vprintf |
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 |
575 | win32_stat |
576 | win32_pipe |
577 | win32_popen |
578 | win32_pclose |
579 | win32_rename |
580 | win32_setmode |
581 | win32_lseek |
582 | win32_tell |
583 | win32_dup |
584 | win32_dup2 |
585 | win32_open |
586 | win32_close |
587 | win32_eof |
588 | win32_read |
589 | win32_write |
590 | win32_spawnvp |
591 | win32_mkdir |
592 | win32_rmdir |
593 | win32_chdir |
594 | win32_flock |
595 | win32_execv |
596 | win32_execvp |
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 |
613 | win32_closesocket |
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 |
640 | win32_getenv |
641 | win32_putenv |
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 |
658 | win32_sleep |
659 | win32_times |
660 | win32_access |
661 | win32_alarm |
662 | win32_chmod |
663 | win32_open_osfhandle |
664 | win32_get_osfhandle |
665 | win32_ioctl |
666 | win32_link |
667 | win32_unlink |
668 | win32_utime |
669 | win32_uname |
670 | win32_wait |
671 | win32_waitpid |
672 | win32_kill |
673 | win32_str_os_error |
674 | win32_opendir |
675 | win32_readdir |
676 | win32_telldir |
677 | win32_seekdir |
678 | win32_rewinddir |
679 | win32_closedir |
680 | win32_longpath |
681 | win32_os_id |
682 | win32_getpid |
683 | win32_crypt |
684 | win32_dynaload |
685 | )) |
686 | { |
549a6b10 |
687 | try_symbol($symbol); |
688 | } |
689 | } |
3cfae81b |
690 | elsif ($PLATFORM eq 'os2') { |
7766f137 |
691 | open MAP, 'miniperl.map' or die 'Cannot read miniperl.map'; |
692 | /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>; |
693 | close MAP or die 'Cannot close miniperl.map'; |
694 | |
695 | @missing = grep { !exists $mapped{$_} and !exists $bincompat5005{$_} } |
696 | keys %export; |
697 | delete $export{$_} foreach @missing; |
3cfae81b |
698 | } |
22239a37 |
699 | |
549a6b10 |
700 | # Now all symbols should be defined because |
701 | # next we are going to output them. |
702 | |
7766f137 |
703 | foreach my $symbol (sort keys %export) { |
704 | output_symbol($symbol); |
705 | } |
549a6b10 |
706 | |
707 | sub emit_symbol { |
7766f137 |
708 | my $symbol = shift; |
709 | chomp($symbol); |
710 | $export{$symbol} = 1; |
549a6b10 |
711 | } |
712 | |
713 | sub output_symbol { |
714 | my $symbol = shift; |
4cb71bb6 |
715 | $symbol = $bincompat5005{$symbol} |
716 | if $define{PERL_BINCOMPAT_5005} and $symbol =~ /^($bincompat5005)$/; |
549a6b10 |
717 | if ($PLATFORM eq 'win32') { |
549a6b10 |
718 | $symbol = "_$symbol" if $CCTYPE eq 'BORLAND'; |
520c758a |
719 | print "\t$symbol\n"; |
549a6b10 |
720 | # XXX: binary compatibility between compilers is an exercise |
721 | # in frustration :-( |
722 | # if ($CCTYPE eq "BORLAND") { |
723 | # # workaround Borland quirk by exporting both the straight |
724 | # # name and a name with leading underscore. Note the |
725 | # # alias *must* come after the symbol itself, if both |
726 | # # are to be exported. (Linker bug?) |
727 | # print "\t_$symbol\n"; |
728 | # print "\t$symbol = _$symbol\n"; |
729 | # } |
730 | # elsif ($CCTYPE eq 'GCC') { |
731 | # # Symbols have leading _ whole process is $%@"% slow |
732 | # # so skip aliases for now |
733 | # nprint "\t$symbol\n"; |
734 | # } |
735 | # else { |
736 | # # for binary coexistence, export both the symbol and |
737 | # # alias with leading underscore |
738 | # print "\t$symbol\n"; |
739 | # print "\t_$symbol = $symbol\n"; |
740 | # } |
7766f137 |
741 | } |
742 | elsif ($PLATFORM eq 'os2') { |
3cfae81b |
743 | print qq( "$symbol"\n); |
7766f137 |
744 | } |
745 | elsif ($PLATFORM eq 'aix') { |
549a6b10 |
746 | print "$symbol\n"; |
747 | } |
748 | } |
749 | |
750 | 1; |
751 | __DATA__ |
752 | # extra globals not included above. |
753 | perl_alloc |
7766f137 |
754 | perl_alloc_using |
014822e4 |
755 | perl_clone |
756 | perl_clone_using |
549a6b10 |
757 | perl_construct |
758 | perl_destruct |
759 | perl_free |
760 | perl_parse |
761 | perl_run |