Commit | Line | Data |
549a6b10 |
1 | # |
2 | # Create the export list for perl. |
3 | # |
86593e8d |
4 | # Needed by WIN32 and OS/2 for creating perl.dll, |
5 | # and by AIX for creating libperl.a when -Dusershrplib is in effect, |
6 | # and by MacOS Classic. |
549a6b10 |
7 | # |
22c35a8c |
8 | # reads global.sym, pp.sym, perlvars.h, intrpvar.h, thrdvar.h, config.h |
3cfae81b |
9 | # On OS/2 reads miniperl.map as well |
0a753a76 |
10 | |
549a6b10 |
11 | my $PLATFORM; |
12 | my $CCTYPE; |
910dfcc8 |
13 | |
7766f137 |
14 | while (@ARGV) { |
15 | my $flag = shift; |
16 | $define{$1} = 1 if ($flag =~ /^-D(\w+)$/); |
17 | $define{$1} = $2 if ($flag =~ /^-D(\w+)=(.+)$/); |
18 | $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/); |
19 | $PLATFORM = $1 if ($flag =~ /^PLATFORM=(\w+)$/); |
18f68570 |
20 | if ($PLATFORM eq 'netware') { |
21 | $FILETYPE = $1 if ($flag =~ /^FILETYPE=(\w+)$/); |
22 | } |
7766f137 |
23 | } |
d55594ae |
24 | |
18f68570 |
25 | my @PLATFORM = qw(aix win32 wince os2 MacOS netware); |
549a6b10 |
26 | my %PLATFORM; |
27 | @PLATFORM{@PLATFORM} = (); |
28 | |
29 | defined $PLATFORM || die "PLATFORM undefined, must be one of: @PLATFORM\n"; |
9df9a5cd |
30 | exists $PLATFORM{$PLATFORM} || die "PLATFORM must be one of: @PLATFORM\n"; |
549a6b10 |
31 | |
c6261f3b |
32 | my %exportperlmalloc = |
33 | ( |
34 | Perl_malloc => "malloc", |
35 | Perl_mfree => "free", |
36 | Perl_realloc => "realloc", |
37 | Perl_calloc => "calloc", |
38 | ); |
39 | |
40 | my $exportperlmalloc = $PLATFORM eq 'os2'; |
41 | |
549a6b10 |
42 | my $config_sh = "config.sh"; |
43 | my $config_h = "config.h"; |
44 | my $thrdvar_h = "thrdvar.h"; |
45 | my $intrpvar_h = "intrpvar.h"; |
46 | my $perlvars_h = "perlvars.h"; |
47 | my $global_sym = "global.sym"; |
48 | my $pp_sym = "pp.sym"; |
49 | my $globvar_sym = "globvar.sym"; |
50 | my $perlio_sym = "perlio.sym"; |
51 | |
9df9a5cd |
52 | if ($PLATFORM eq 'aix') { |
549a6b10 |
53 | # Nothing for now. |
7766f137 |
54 | } |
18f68570 |
55 | elsif ($PLATFORM =~ /^win(?:32|ce)$/ || $PLATFORM eq 'netware') { |
549a6b10 |
56 | $CCTYPE = "MSVC" unless defined $CCTYPE; |
00b02797 |
57 | foreach ($thrdvar_h, $intrpvar_h, $perlvars_h, $global_sym, |
58 | $pp_sym, $globvar_sym, $perlio_sym) { |
549a6b10 |
59 | s!^!..\\!; |
60 | } |
61 | } |
084592ab |
62 | elsif ($PLATFORM eq 'MacOS') { |
63 | foreach ($thrdvar_h, $intrpvar_h, $perlvars_h, $global_sym, |
64 | $pp_sym, $globvar_sym, $perlio_sym) { |
65 | s!^!::!; |
66 | } |
67 | } |
549a6b10 |
68 | |
18f68570 |
69 | unless ($PLATFORM eq 'win32' || $PLATFORM eq 'wince' || $PLATFORM eq 'MacOS' || $PLATFORM eq 'netware') { |
549a6b10 |
70 | open(CFG,$config_sh) || die "Cannot open $config_sh: $!\n"; |
7766f137 |
71 | while (<CFG>) { |
549a6b10 |
72 | if (/^(?:ccflags|optimize)='(.+)'$/) { |
73 | $_ = $1; |
74 | $define{$1} = 1 while /-D(\w+)/g; |
75 | } |
3cfae81b |
76 | if ($PLATFORM eq 'os2') { |
52e4c282 |
77 | $CONFIG_ARGS = $1 if /^config_args='(.+)'$/; |
78 | $ARCHNAME = $1 if /^archname='(.+)'$/; |
79 | $PATCHLEVEL = $1 if /^perl_patchlevel='(.+)'$/; |
3cfae81b |
80 | } |
549a6b10 |
81 | } |
82 | close(CFG); |
83 | } |
84 | |
85 | open(CFG,$config_h) || die "Cannot open $config_h: $!\n"; |
7766f137 |
86 | while (<CFG>) { |
87 | $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/; |
7766f137 |
88 | $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/; |
0e32cd81 |
89 | $define{$1} = 1 if /^\s*#\s*define\s+(PERL_\w+)\b/; |
90 | $define{$1} = 1 if /^\s*#\s*define\s+(USE_\w+)\b/; |
7766f137 |
91 | } |
bbc8f9de |
92 | close(CFG); |
93 | |
18c4b137 |
94 | # perl.h logic duplication begins |
95 | |
ac6bedea |
96 | if ($define{PERL_IMPLICIT_SYS}) { |
97 | $define{PL_OP_SLAB_ALLOC} = 1; |
98 | } |
99 | |
18c4b137 |
100 | if ($define{USE_ITHREADS}) { |
acfe0abc |
101 | if (!$define{MULTIPLICITY}) { |
18c4b137 |
102 | $define{MULTIPLICITY} = 1; |
103 | } |
104 | } |
105 | |
106 | $define{PERL_IMPLICIT_CONTEXT} ||= |
107 | $define{USE_ITHREADS} || |
66cf6f75 |
108 | $define{USE_5005THREADS} || |
18c4b137 |
109 | $define{MULTIPLICITY} ; |
110 | |
10bc17b6 |
111 | if ($define{USE_ITHREADS} && $PLATFORM ne 'win32' && $^O ne 'darwin') { |
112 | $define{USE_REENTRANT_API} = 1; |
113 | } |
114 | |
18c4b137 |
115 | # perl.h logic duplication ends |
116 | |
ac6bedea |
117 | my $sym_ord = 0; |
118 | |
18f68570 |
119 | if ($PLATFORM =~ /^win(?:32|ce)$/) { |
549a6b10 |
120 | warn join(' ',keys %define)."\n"; |
ed423f7a |
121 | ($dll = ($define{PERL_DLL} || "perl59")) =~ s/\.dll$//i; |
18f68570 |
122 | print "LIBRARY $dll\n"; |
dfdd1393 |
123 | print "DESCRIPTION 'Perl interpreter'\n"; |
124 | print "EXPORTS\n"; |
125 | if ($define{PERL_IMPLICIT_SYS}) { |
549a6b10 |
126 | output_symbol("perl_get_host_info"); |
7766f137 |
127 | output_symbol("perl_alloc_override"); |
0295eab8 |
128 | } |
b54a2e1e |
129 | if ($define{USE_ITHREADS} and $define{PERL_IMPLICIT_SYS}) { |
ac6bedea |
130 | output_symbol("perl_clone_host"); |
51371543 |
131 | } |
7766f137 |
132 | } |
133 | elsif ($PLATFORM eq 'os2') { |
52e4c282 |
134 | if (open my $fh, '<', 'perl5.def') { |
135 | while (<$fh>) { |
136 | last if /^\s*EXPORTS\b/; |
137 | } |
138 | while (<$fh>) { |
78232bc0 |
139 | $ordinal{$1} = $2 if /^\s*"(\w+)"\s*(?:=\s*"\w+"\s*)?\@(\d+)\s*$/; |
52e4c282 |
140 | # This allows skipping ordinals which were used in older versions |
141 | $sym_ord = $1 if /^\s*;\s*LAST_ORDINAL\s*=\s*(\d+)\s*$/; |
142 | } |
143 | $sym_ord < $_ and $sym_ord = $_ for values %ordinal; # Take the max |
144 | } |
3cfae81b |
145 | ($v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/; |
146 | $v .= '-thread' if $ARCHNAME =~ /-thread/; |
3cfae81b |
147 | ($dll = $define{PERL_DLL}) =~ s/\.dll$//i; |
52e4c282 |
148 | $v .= "\@$PATCHLEVEL" if $PATCHLEVEL; |
1102eebe |
149 | $d = "DESCRIPTION '\@#perl5-porters\@perl.org:$v#\@ Perl interpreter, configured as $CONFIG_ARGS'"; |
150 | $d = substr($d, 0, 249) . "...'" if length $d > 253; |
3cfae81b |
151 | print <<"---EOP---"; |
152 | LIBRARY '$dll' INITINSTANCE TERMINSTANCE |
1102eebe |
153 | $d |
3cfae81b |
154 | STACKSIZE 32768 |
155 | CODE LOADONCALL |
156 | DATA LOADONCALL NONSHARED MULTIPLE |
157 | EXPORTS |
158 | ---EOP--- |
7766f137 |
159 | } |
160 | elsif ($PLATFORM eq 'aix') { |
61d42ce4 |
161 | $OSVER = `uname -v`; |
162 | chop $OSVER; |
163 | $OSREL = `uname -r`; |
164 | chop $OSREL; |
165 | if ($OSVER > 4 || ($OSVER == 4 && $OSREL >= 3)) { |
166 | print "#! ..\n"; |
167 | } else { |
168 | print "#!\n"; |
169 | } |
ac4c12e7 |
170 | } |
2986a63f |
171 | elsif ($PLATFORM eq 'netware') { |
172 | if ($FILETYPE eq 'def') { |
ed423f7a |
173 | print "LIBRARY perl59\n"; |
2986a63f |
174 | print "DESCRIPTION 'Perl interpreter for NetWare'\n"; |
175 | print "EXPORTS\n"; |
176 | } |
177 | if ($define{PERL_IMPLICIT_SYS}) { |
ac6bedea |
178 | output_symbol("perl_get_host_info"); |
179 | output_symbol("perl_alloc_override"); |
180 | output_symbol("perl_clone_host"); |
2986a63f |
181 | } |
182 | } |
bbc8f9de |
183 | |
22239a37 |
184 | my %skip; |
185 | my %export; |
186 | |
51371543 |
187 | sub skip_symbols { |
188 | my $list = shift; |
189 | foreach my $symbol (@$list) { |
190 | $skip{$symbol} = 1; |
191 | } |
22239a37 |
192 | } |
193 | |
51371543 |
194 | sub emit_symbols { |
195 | my $list = shift; |
196 | foreach my $symbol (@$list) { |
197 | my $skipsym = $symbol; |
198 | # XXX hack |
acfe0abc |
199 | if ($define{MULTIPLICITY}) { |
51371543 |
200 | $skipsym =~ s/^Perl_[GIT](\w+)_ptr$/PL_$1/; |
201 | } |
202 | emit_symbol($symbol) unless exists $skip{$skipsym}; |
203 | } |
22239a37 |
204 | } |
205 | |
549a6b10 |
206 | if ($PLATFORM eq 'win32') { |
7766f137 |
207 | skip_symbols [qw( |
208 | PL_statusvalue_vms |
209 | PL_archpat_auto |
210 | PL_cryptseen |
211 | PL_DBcv |
212 | PL_generation |
213 | PL_lastgotoprobe |
214 | PL_linestart |
215 | PL_modcount |
216 | PL_pending_ident |
217 | PL_sortcxix |
218 | PL_sublex_info |
219 | PL_timesbuf |
220 | main |
221 | Perl_ErrorNo |
222 | Perl_GetVars |
223 | Perl_do_exec3 |
224 | Perl_do_ipcctl |
225 | Perl_do_ipcget |
226 | Perl_do_msgrcv |
227 | Perl_do_msgsnd |
228 | Perl_do_semop |
229 | Perl_do_shmio |
230 | Perl_dump_fds |
231 | Perl_init_thread_intern |
232 | Perl_my_bzero |
9d50d399 |
233 | Perl_my_bcopy |
7766f137 |
234 | Perl_my_htonl |
235 | Perl_my_ntohl |
236 | Perl_my_swap |
237 | Perl_my_chsize |
238 | Perl_same_dirent |
239 | Perl_setenv_getix |
240 | Perl_unlnk |
241 | Perl_watch |
242 | Perl_safexcalloc |
243 | Perl_safexmalloc |
244 | Perl_safexfree |
245 | Perl_safexrealloc |
246 | Perl_my_memcmp |
247 | Perl_my_memset |
248 | PL_cshlen |
249 | PL_cshname |
250 | PL_opsave |
251 | Perl_do_exec |
252 | Perl_getenv_len |
253 | Perl_my_pclose |
254 | Perl_my_popen |
255 | )]; |
256 | } |
54725af6 |
257 | else { |
258 | skip_symbols [qw( |
259 | Perl_do_spawn |
260 | Perl_do_spawn_nowait |
261 | Perl_do_aspawn |
262 | )]; |
263 | } |
264 | if ($PLATFORM eq 'wince') { |
18f68570 |
265 | skip_symbols [qw( |
266 | PL_statusvalue_vms |
267 | PL_archpat_auto |
268 | PL_cryptseen |
269 | PL_DBcv |
270 | PL_generation |
271 | PL_lastgotoprobe |
272 | PL_linestart |
273 | PL_modcount |
274 | PL_pending_ident |
275 | PL_sortcxix |
276 | PL_sublex_info |
277 | PL_timesbuf |
278 | PL_collation_ix |
279 | PL_collation_name |
280 | PL_collation_standard |
281 | PL_collxfrm_base |
282 | PL_collxfrm_mult |
283 | PL_numeric_compat1 |
284 | PL_numeric_local |
285 | PL_numeric_name |
286 | PL_numeric_radix_sv |
287 | PL_numeric_standard |
288 | PL_vtbl_collxfrm |
289 | Perl_sv_collxfrm |
290 | setgid |
291 | setuid |
292 | win32_async_check |
293 | win32_free_childdir |
294 | win32_free_childenv |
295 | win32_get_childdir |
296 | win32_get_childenv |
297 | win32_spawnvp |
298 | main |
299 | Perl_ErrorNo |
300 | Perl_GetVars |
301 | Perl_do_exec3 |
302 | Perl_do_ipcctl |
303 | Perl_do_ipcget |
304 | Perl_do_msgrcv |
305 | Perl_do_msgsnd |
306 | Perl_do_semop |
307 | Perl_do_shmio |
308 | Perl_dump_fds |
309 | Perl_init_thread_intern |
310 | Perl_my_bzero |
311 | Perl_my_bcopy |
312 | Perl_my_htonl |
313 | Perl_my_ntohl |
314 | Perl_my_swap |
315 | Perl_my_chsize |
316 | Perl_same_dirent |
317 | Perl_setenv_getix |
318 | Perl_unlnk |
319 | Perl_watch |
320 | Perl_safexcalloc |
321 | Perl_safexmalloc |
322 | Perl_safexfree |
323 | Perl_safexrealloc |
324 | Perl_my_memcmp |
325 | Perl_my_memset |
326 | PL_cshlen |
327 | PL_cshname |
328 | PL_opsave |
329 | Perl_do_exec |
330 | Perl_getenv_len |
331 | Perl_my_pclose |
332 | Perl_my_popen |
333 | )]; |
334 | } |
7766f137 |
335 | elsif ($PLATFORM eq 'aix') { |
549a6b10 |
336 | skip_symbols([qw( |
7766f137 |
337 | Perl_dump_fds |
338 | Perl_ErrorNo |
339 | Perl_GetVars |
340 | Perl_my_bcopy |
341 | Perl_my_bzero |
342 | Perl_my_chsize |
343 | Perl_my_htonl |
344 | Perl_my_memcmp |
345 | Perl_my_memset |
346 | Perl_my_ntohl |
347 | Perl_my_swap |
348 | Perl_safexcalloc |
349 | Perl_safexfree |
350 | Perl_safexmalloc |
351 | Perl_safexrealloc |
352 | Perl_same_dirent |
353 | Perl_unlnk |
6c644e78 |
354 | Perl_sys_intern_clear |
95151ede |
355 | Perl_sys_intern_dup |
52853b95 |
356 | Perl_sys_intern_init |
7766f137 |
357 | PL_cryptseen |
358 | PL_opsave |
359 | PL_statusvalue_vms |
360 | PL_sys_intern |
361 | )]); |
362 | } |
363 | elsif ($PLATFORM eq 'os2') { |
3cfae81b |
364 | emit_symbols([qw( |
7766f137 |
365 | ctermid |
366 | get_sysinfo |
367 | Perl_OS2_init |
764df951 |
368 | Perl_OS2_init3 |
369 | Perl_OS2_term |
7766f137 |
370 | OS2_Perl_data |
371 | dlopen |
372 | dlsym |
373 | dlerror |
403d6f8e |
374 | dlclose |
7766f137 |
375 | my_tmpfile |
376 | my_tmpnam |
377 | my_flock |
9c130f5b |
378 | my_rmdir |
379 | my_mkdir |
f72c975a |
380 | my_getpwuid |
381 | my_getpwnam |
382 | my_getpwent |
383 | my_setpwent |
384 | my_endpwent |
385 | setgrent |
386 | endgrent |
387 | getgrent |
7766f137 |
388 | malloc_mutex |
389 | threads_mutex |
390 | nthreads |
391 | nthreads_cond |
392 | os2_cond_wait |
393 | os2_stat |
394 | pthread_join |
395 | pthread_create |
396 | pthread_detach |
397 | XS_Cwd_change_drive |
398 | XS_Cwd_current_drive |
399 | XS_Cwd_extLibpath |
400 | XS_Cwd_extLibpath_set |
401 | XS_Cwd_sys_abspath |
402 | XS_Cwd_sys_chdir |
403 | XS_Cwd_sys_cwd |
404 | XS_Cwd_sys_is_absolute |
405 | XS_Cwd_sys_is_relative |
406 | XS_Cwd_sys_is_rooted |
407 | XS_DynaLoader_mod2fname |
408 | XS_File__Copy_syscopy |
409 | Perl_Register_MQ |
410 | Perl_Deregister_MQ |
411 | Perl_Serve_Messages |
412 | Perl_Process_Messages |
413 | init_PMWIN_entries |
414 | PMWIN_entries |
415 | Perl_hab_GET |
35bc1fdc |
416 | loadByOrdinal |
417 | pExtFCN |
30500b05 |
418 | os2error |
419 | ResetWinError |
420 | CroakWinError |
7766f137 |
421 | )]); |
3cfae81b |
422 | } |
084592ab |
423 | elsif ($PLATFORM eq 'MacOS') { |
424 | skip_symbols [qw( |
425 | Perl_GetVars |
426 | PL_cryptseen |
427 | PL_cshlen |
428 | PL_cshname |
429 | PL_statusvalue_vms |
430 | PL_sys_intern |
431 | PL_opsave |
432 | PL_timesbuf |
433 | Perl_dump_fds |
434 | Perl_my_bcopy |
435 | Perl_my_bzero |
436 | Perl_my_chsize |
437 | Perl_my_htonl |
438 | Perl_my_memcmp |
439 | Perl_my_memset |
440 | Perl_my_ntohl |
441 | Perl_my_swap |
442 | Perl_safexcalloc |
443 | Perl_safexfree |
444 | Perl_safexmalloc |
445 | Perl_safexrealloc |
446 | Perl_unlnk |
fe05f414 |
447 | Perl_sys_intern_clear |
448 | Perl_sys_intern_init |
084592ab |
449 | )]; |
450 | } |
2986a63f |
451 | elsif ($PLATFORM eq 'netware') { |
452 | skip_symbols [qw( |
453 | PL_statusvalue_vms |
454 | PL_archpat_auto |
455 | PL_cryptseen |
456 | PL_DBcv |
457 | PL_generation |
458 | PL_lastgotoprobe |
459 | PL_linestart |
460 | PL_modcount |
461 | PL_pending_ident |
462 | PL_sortcxix |
463 | PL_sublex_info |
464 | PL_timesbuf |
465 | main |
466 | Perl_ErrorNo |
467 | Perl_GetVars |
468 | Perl_do_exec3 |
469 | Perl_do_ipcctl |
470 | Perl_do_ipcget |
471 | Perl_do_msgrcv |
472 | Perl_do_msgsnd |
473 | Perl_do_semop |
474 | Perl_do_shmio |
475 | Perl_dump_fds |
476 | Perl_init_thread_intern |
477 | Perl_my_bzero |
478 | Perl_my_htonl |
479 | Perl_my_ntohl |
480 | Perl_my_swap |
481 | Perl_my_chsize |
482 | Perl_same_dirent |
483 | Perl_setenv_getix |
484 | Perl_unlnk |
485 | Perl_watch |
486 | Perl_safexcalloc |
487 | Perl_safexmalloc |
488 | Perl_safexfree |
489 | Perl_safexrealloc |
490 | Perl_my_memcmp |
491 | Perl_my_memset |
492 | PL_cshlen |
493 | PL_cshname |
494 | PL_opsave |
495 | Perl_do_exec |
496 | Perl_getenv_len |
497 | Perl_my_pclose |
498 | Perl_my_popen |
011f1a1a |
499 | Perl_sys_intern_init |
500 | Perl_sys_intern_dup |
501 | Perl_sys_intern_clear |
502 | Perl_my_bcopy |
503 | Perl_PerlIO_write |
504 | Perl_PerlIO_unread |
505 | Perl_PerlIO_tell |
506 | Perl_PerlIO_stdout |
507 | Perl_PerlIO_stdin |
508 | Perl_PerlIO_stderr |
509 | Perl_PerlIO_setlinebuf |
510 | Perl_PerlIO_set_ptrcnt |
511 | Perl_PerlIO_set_cnt |
512 | Perl_PerlIO_seek |
513 | Perl_PerlIO_read |
514 | Perl_PerlIO_get_ptr |
515 | Perl_PerlIO_get_cnt |
516 | Perl_PerlIO_get_bufsiz |
517 | Perl_PerlIO_get_base |
518 | Perl_PerlIO_flush |
519 | Perl_PerlIO_fill |
520 | Perl_PerlIO_fileno |
521 | Perl_PerlIO_error |
522 | Perl_PerlIO_eof |
523 | Perl_PerlIO_close |
524 | Perl_PerlIO_clearerr |
525 | PerlIO_perlio |
2986a63f |
526 | )]; |
527 | } |
3cfae81b |
528 | |
7766f137 |
529 | unless ($define{'DEBUGGING'}) { |
530 | skip_symbols [qw( |
7766f137 |
531 | Perl_deb_growlevel |
532 | Perl_debop |
533 | Perl_debprofdump |
534 | Perl_debstack |
535 | Perl_debstackptrs |
7766f137 |
536 | Perl_sv_peek |
537 | PL_block_type |
538 | PL_watchaddr |
539 | PL_watchok |
540 | )]; |
541 | } |
542 | |
543 | if ($define{'PERL_IMPLICIT_SYS'}) { |
544 | skip_symbols [qw( |
545 | Perl_getenv_len |
546 | Perl_my_popen |
547 | Perl_my_pclose |
548 | )]; |
549 | } |
550 | else { |
551 | skip_symbols [qw( |
552 | PL_Mem |
553 | PL_MemShared |
554 | PL_MemParse |
555 | PL_Env |
556 | PL_StdIO |
557 | PL_LIO |
558 | PL_Dir |
559 | PL_Sock |
560 | PL_Proc |
561 | )]; |
562 | } |
563 | |
7c128300 |
564 | unless ($define{'PERL_FLEXIBLE_EXCEPTIONS'}) { |
565 | skip_symbols [qw( |
566 | PL_protect |
567 | Perl_default_protect |
568 | Perl_vdefault_protect |
569 | )]; |
570 | } |
571 | |
5bcb3f6c |
572 | unless ($define{'USE_REENTRANT_API'}) { |
573 | skip_symbols [qw( |
574 | PL_reentrant_buffer |
575 | )]; |
576 | } |
577 | |
7766f137 |
578 | if ($define{'MYMALLOC'}) { |
579 | emit_symbols [qw( |
580 | Perl_dump_mstats |
827e134a |
581 | Perl_get_mstats |
9c130f5b |
582 | Perl_strdup |
583 | Perl_putenv |
7766f137 |
584 | )]; |
bbda9c9d |
585 | if ($define{'USE_5005THREADS'} || $define{'USE_ITHREADS'}) { |
1feb2720 |
586 | emit_symbols [qw( |
587 | PL_malloc_mutex |
588 | )]; |
589 | } |
80fc1a6e |
590 | else { |
591 | skip_symbols [qw( |
592 | PL_malloc_mutex |
593 | )]; |
594 | } |
51371543 |
595 | } |
596 | else { |
7766f137 |
597 | skip_symbols [qw( |
598 | PL_malloc_mutex |
599 | Perl_dump_mstats |
6ecd3fcb |
600 | Perl_get_mstats |
7766f137 |
601 | Perl_malloced_size |
602 | )]; |
603 | } |
604 | |
f433d095 |
605 | unless ($define{'USE_5005THREADS'} || $define{'USE_ITHREADS'}) { |
7766f137 |
606 | skip_symbols [qw( |
607 | PL_thr_key |
f433d095 |
608 | )]; |
609 | } |
610 | |
611 | unless ($define{'USE_5005THREADS'}) { |
612 | skip_symbols [qw( |
7766f137 |
613 | PL_sv_mutex |
614 | PL_strtab_mutex |
615 | PL_svref_mutex |
7766f137 |
616 | PL_cred_mutex |
617 | PL_eval_mutex |
6940069f |
618 | PL_fdpid_mutex |
619 | PL_sv_lock_mutex |
7766f137 |
620 | PL_eval_cond |
621 | PL_eval_owner |
622 | PL_threads_mutex |
623 | PL_nthreads |
624 | PL_nthreads_cond |
625 | PL_threadnum |
626 | PL_threadsv_names |
627 | PL_thrsv |
628 | PL_vtbl_mutex |
7766f137 |
629 | Perl_condpair_magic |
630 | Perl_new_struct_thread |
631 | Perl_per_thread_magicals |
632 | Perl_thread_create |
633 | Perl_find_threadsv |
634 | Perl_unlock_condpair |
635 | Perl_magic_mutexfree |
4755096e |
636 | Perl_sv_lock |
7766f137 |
637 | )]; |
638 | } |
639 | |
640 | unless ($define{'USE_ITHREADS'}) { |
641 | skip_symbols [qw( |
642 | PL_ptr_table |
534825c4 |
643 | PL_op_mutex |
7e95b20d |
644 | PL_regex_pad |
645 | PL_regex_padav |
f2f7cecd |
646 | PL_sharedsv_space |
647 | PL_sharedsv_space_mutex |
7766f137 |
648 | Perl_dirp_dup |
649 | Perl_cx_dup |
650 | Perl_si_dup |
651 | Perl_any_dup |
652 | Perl_ss_dup |
653 | Perl_fp_dup |
654 | Perl_gp_dup |
655 | Perl_he_dup |
656 | Perl_mg_dup |
657 | Perl_re_dup |
658 | Perl_sv_dup |
659 | Perl_sys_intern_dup |
86593e8d |
660 | Perl_ptr_table_clear |
7766f137 |
661 | Perl_ptr_table_fetch |
86593e8d |
662 | Perl_ptr_table_free |
7766f137 |
663 | Perl_ptr_table_new |
4ac9195f |
664 | Perl_ptr_table_clear |
665 | Perl_ptr_table_free |
7766f137 |
666 | Perl_ptr_table_split |
667 | Perl_ptr_table_store |
668 | perl_clone |
669 | perl_clone_using |
038f0558 |
670 | Perl_sharedsv_find |
671 | Perl_sharedsv_init |
672 | Perl_sharedsv_lock |
673 | Perl_sharedsv_new |
674 | Perl_sharedsv_thrcnt_dec |
675 | Perl_sharedsv_thrcnt_inc |
676 | Perl_sharedsv_unlock |
7766f137 |
677 | )]; |
678 | } |
679 | |
680 | unless ($define{'PERL_IMPLICIT_CONTEXT'}) { |
681 | skip_symbols [qw( |
682 | Perl_croak_nocontext |
683 | Perl_die_nocontext |
684 | Perl_deb_nocontext |
685 | Perl_form_nocontext |
e0f4245d |
686 | Perl_load_module_nocontext |
7766f137 |
687 | Perl_mess_nocontext |
688 | Perl_warn_nocontext |
689 | Perl_warner_nocontext |
690 | Perl_newSVpvf_nocontext |
691 | Perl_sv_catpvf_nocontext |
692 | Perl_sv_setpvf_nocontext |
693 | Perl_sv_catpvf_mg_nocontext |
694 | Perl_sv_setpvf_mg_nocontext |
695 | )]; |
696 | } |
697 | |
698 | unless ($define{'PERL_IMPLICIT_SYS'}) { |
699 | skip_symbols [qw( |
700 | perl_alloc_using |
014822e4 |
701 | perl_clone_using |
7766f137 |
702 | )]; |
703 | } |
704 | |
705 | unless ($define{'FAKE_THREADS'}) { |
706 | skip_symbols [qw(PL_curthr)]; |
707 | } |
708 | |
ac6bedea |
709 | unless ($define{'PL_OP_SLAB_ALLOC'}) { |
710 | skip_symbols [qw( |
711 | PL_OpPtr |
712 | PL_OpSlab |
713 | PL_OpSpace |
714 | )]; |
715 | } |
716 | |
7766f137 |
717 | sub readvar { |
718 | my $file = shift; |
719 | my $proc = shift || sub { "PL_$_[2]" }; |
720 | open(VARS,$file) || die "Cannot open $file: $!\n"; |
721 | my @syms; |
722 | while (<VARS>) { |
723 | # All symbols have a Perl_ prefix because that's what embed.h |
724 | # sticks in front of them. |
725 | push(@syms, &$proc($1,$2,$3)) if (/\bPERLVAR(A?I?C?)\(([IGT])(\w+)/); |
9df9a5cd |
726 | } |
727 | close(VARS); |
7766f137 |
728 | return \@syms; |
729 | } |
730 | |
6f4183fe |
731 | if ($define{'USE_5005THREADS'}) { |
7766f137 |
732 | my $thrd = readvar($thrdvar_h); |
733 | skip_symbols $thrd; |
734 | } |
735 | |
7766f137 |
736 | if ($define{'PERL_GLOBAL_STRUCT'}) { |
737 | my $global = readvar($perlvars_h); |
738 | skip_symbols $global; |
739 | emit_symbol('Perl_GetVars'); |
740 | emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC'; |
741 | } |
36c15d3f |
742 | |
22c35a8c |
743 | # functions from *.sym files |
744 | |
954c1994 |
745 | my @syms = ($global_sym, $globvar_sym); # $pp_sym is not part of the API |
549a6b10 |
746 | |
d892637e |
747 | # Symbols that are the public face of the PerlIO layers implementation |
748 | # These are in _addition to_ the public face of the abstraction |
749 | # and need to be exported to allow XS modules to implement layers |
9df9a5cd |
750 | my @layer_syms = qw( |
751 | PerlIOBase_clearerr |
752 | PerlIOBase_close |
8437356b |
753 | PerlIOBase_dup |
9df9a5cd |
754 | PerlIOBase_eof |
755 | PerlIOBase_error |
756 | PerlIOBase_fileno |
8c0134a8 |
757 | PerlIOBase_pushed |
86e05cf2 |
758 | PerlIOBase_binmode |
44798d05 |
759 | PerlIOBase_popped |
8c0134a8 |
760 | PerlIOBase_read |
55ac2d47 |
761 | PerlIOBase_setlinebuf |
d892637e |
762 | PerlIOBase_unread |
9df9a5cd |
763 | PerlIOBuf_bufsiz |
9df9a5cd |
764 | PerlIOBuf_fill |
765 | PerlIOBuf_flush |
91939a65 |
766 | PerlIOBuf_get_base |
9df9a5cd |
767 | PerlIOBuf_get_cnt |
768 | PerlIOBuf_get_ptr |
769 | PerlIOBuf_open |
770 | PerlIOBuf_pushed |
44798d05 |
771 | PerlIOBuf_popped |
9df9a5cd |
772 | PerlIOBuf_read |
9df9a5cd |
773 | PerlIOBuf_seek |
774 | PerlIOBuf_set_ptrcnt |
9df9a5cd |
775 | PerlIOBuf_tell |
776 | PerlIOBuf_unread |
777 | PerlIOBuf_write |
d892637e |
778 | PerlIO_debug |
55ac2d47 |
779 | PerlIO_allocate |
d892637e |
780 | PerlIO_apply_layera |
781 | PerlIO_apply_layers |
8c0134a8 |
782 | PerlIO_arg_fetch |
55ac2d47 |
783 | PerlIO_define_layer |
d9dac8cd |
784 | PerlIO_modestr |
785 | PerlIO_parse_layers |
786 | PerlIO_layer_fetch |
787 | PerlIO_list_free |
788 | PerlIO_apply_layera |
9df9a5cd |
789 | PerlIO_pending |
790 | PerlIO_push |
abfa7759 |
791 | PerlIO_pop |
8437356b |
792 | PerlIO_sv_dup |
ad6971c8 |
793 | PerlIO_perlio |
1e8a8f59 |
794 | |
795 | Perl_PerlIO_clearerr |
796 | Perl_PerlIO_close |
797 | Perl_PerlIO_eof |
798 | Perl_PerlIO_error |
799 | Perl_PerlIO_fileno |
800 | Perl_PerlIO_fill |
801 | Perl_PerlIO_flush |
802 | Perl_PerlIO_get_base |
803 | Perl_PerlIO_get_bufsiz |
804 | Perl_PerlIO_get_cnt |
805 | Perl_PerlIO_get_ptr |
806 | Perl_PerlIO_read |
807 | Perl_PerlIO_seek |
808 | Perl_PerlIO_set_cnt |
809 | Perl_PerlIO_set_ptrcnt |
810 | Perl_PerlIO_setlinebuf |
811 | Perl_PerlIO_stderr |
812 | Perl_PerlIO_stdin |
813 | Perl_PerlIO_stdout |
814 | Perl_PerlIO_tell |
815 | Perl_PerlIO_unread |
816 | Perl_PerlIO_write |
817 | |
9df9a5cd |
818 | ); |
a5564b91 |
819 | if ($PLATFORM eq 'netware') { |
820 | push(@layer_syms,'PL_def_layerlist','PL_known_layers','PL_perlio'); |
821 | } |
d892637e |
822 | |
7766f137 |
823 | if ($define{'USE_PERLIO'}) { |
d892637e |
824 | # Export the symols that make up the PerlIO abstraction, regardless |
825 | # of its implementation - read from a file |
084592ab |
826 | push @syms, $perlio_sym; |
d892637e |
827 | |
828 | # This part is then dependent on how the abstraction is implemented |
084592ab |
829 | if ($define{'USE_SFIO'}) { |
d892637e |
830 | # Old legacy non-stdio "PerlIO" |
9df9a5cd |
831 | skip_symbols \@layer_syms; |
084592ab |
832 | # SFIO defines most of the PerlIO routines as macros |
d892637e |
833 | # So undo most of what $perlio_sym has just done - d'oh ! |
834 | # Perhaps it would be better to list the ones which do exist |
835 | # And emit them |
084592ab |
836 | skip_symbols [qw( |
837 | PerlIO_canset_cnt |
838 | PerlIO_clearerr |
839 | PerlIO_close |
840 | PerlIO_eof |
841 | PerlIO_error |
842 | PerlIO_exportFILE |
843 | PerlIO_fast_gets |
844 | PerlIO_fdopen |
845 | PerlIO_fileno |
846 | PerlIO_findFILE |
847 | PerlIO_flush |
848 | PerlIO_get_base |
849 | PerlIO_get_bufsiz |
850 | PerlIO_get_cnt |
851 | PerlIO_get_ptr |
852 | PerlIO_getc |
853 | PerlIO_getname |
854 | PerlIO_has_base |
855 | PerlIO_has_cntptr |
856 | PerlIO_importFILE |
857 | PerlIO_open |
858 | PerlIO_printf |
859 | PerlIO_putc |
860 | PerlIO_puts |
861 | PerlIO_read |
862 | PerlIO_releaseFILE |
863 | PerlIO_reopen |
864 | PerlIO_rewind |
865 | PerlIO_seek |
866 | PerlIO_set_cnt |
867 | PerlIO_set_ptrcnt |
868 | PerlIO_setlinebuf |
869 | PerlIO_sprintf |
870 | PerlIO_stderr |
871 | PerlIO_stdin |
872 | PerlIO_stdout |
873 | PerlIO_stdoutf |
874 | PerlIO_tell |
875 | PerlIO_ungetc |
876 | PerlIO_vprintf |
877 | PerlIO_write |
bcdb689b |
878 | PerlIO_perlio |
879 | Perl_PerlIO_clearerr |
880 | Perl_PerlIO_close |
881 | Perl_PerlIO_eof |
882 | Perl_PerlIO_error |
883 | Perl_PerlIO_fileno |
884 | Perl_PerlIO_fill |
885 | Perl_PerlIO_flush |
886 | Perl_PerlIO_get_base |
887 | Perl_PerlIO_get_bufsiz |
888 | Perl_PerlIO_get_cnt |
889 | Perl_PerlIO_get_ptr |
890 | Perl_PerlIO_read |
891 | Perl_PerlIO_seek |
892 | Perl_PerlIO_set_cnt |
893 | Perl_PerlIO_set_ptrcnt |
894 | Perl_PerlIO_setlinebuf |
895 | Perl_PerlIO_stderr |
896 | Perl_PerlIO_stdin |
897 | Perl_PerlIO_stdout |
898 | Perl_PerlIO_tell |
899 | Perl_PerlIO_unread |
900 | Perl_PerlIO_write |
ffcf5686 |
901 | PL_def_layerlist |
902 | PL_known_layers |
903 | PL_perlio |
084592ab |
904 | )]; |
905 | } |
d892637e |
906 | else { |
907 | # PerlIO with layers - export implementation |
908 | emit_symbols \@layer_syms; |
909 | } |
5138f914 |
910 | } else { |
d892637e |
911 | # -Uuseperlio |
912 | # Skip the PerlIO layer symbols - although |
913 | # nothing should have exported them any way |
9df9a5cd |
914 | skip_symbols \@layer_syms; |
1e8a8f59 |
915 | skip_symbols [qw(PL_def_layerlist PL_known_layers PL_perlio)]; |
916 | |
d892637e |
917 | # Also do NOT add abstraction symbols from $perlio_sym |
918 | # abstraction is done as #define to stdio |
919 | # Remaining remnants that _may_ be functions |
920 | # are handled in <DATA> |
9df9a5cd |
921 | } |
7766f137 |
922 | |
923 | for my $syms (@syms) { |
924 | open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n"; |
925 | while (<GLOBAL>) { |
926 | next if (!/^[A-Za-z]/); |
927 | # Functions have a Perl_ prefix |
928 | # Variables have a PL_ prefix |
929 | chomp($_); |
930 | my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : ""); |
931 | $symbol .= $_; |
932 | emit_symbol($symbol) unless exists $skip{$symbol}; |
933 | } |
934 | close(GLOBAL); |
935 | } |
0a753a76 |
936 | |
22c35a8c |
937 | # variables |
0a753a76 |
938 | |
acfe0abc |
939 | if ($define{'MULTIPLICITY'}) { |
1acb48c9 |
940 | for my $f ($perlvars_h, $intrpvar_h, $thrdvar_h) { |
18c4b137 |
941 | my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" }); |
942 | emit_symbols $glob; |
18c4b137 |
943 | } |
1acb48c9 |
944 | # XXX AIX seems to want the perlvars.h symbols, for some reason |
945 | if ($PLATFORM eq 'aix') { |
946 | my $glob = readvar($perlvars_h); |
51371543 |
947 | emit_symbols $glob; |
948 | } |
949 | } |
950 | else { |
951 | unless ($define{'PERL_GLOBAL_STRUCT'}) { |
549a6b10 |
952 | my $glob = readvar($perlvars_h); |
51371543 |
953 | emit_symbols $glob; |
9df9a5cd |
954 | } |
51371543 |
955 | unless ($define{'MULTIPLICITY'}) { |
549a6b10 |
956 | my $glob = readvar($intrpvar_h); |
51371543 |
957 | emit_symbols $glob; |
9df9a5cd |
958 | } |
bbda9c9d |
959 | unless ($define{'MULTIPLICITY'} || $define{'USE_5005THREADS'}) { |
549a6b10 |
960 | my $glob = readvar($thrdvar_h); |
51371543 |
961 | emit_symbols $glob; |
9df9a5cd |
962 | } |
51371543 |
963 | } |
0a753a76 |
964 | |
549a6b10 |
965 | sub try_symbol { |
966 | my $symbol = shift; |
22239a37 |
967 | |
4d6b4052 |
968 | return if $symbol !~ /^[A-Za-z_]/; |
549a6b10 |
969 | return if $symbol =~ /^\#/; |
970 | $symbol =~s/\r//g; |
971 | chomp($symbol); |
43cd9f80 |
972 | return if exists $skip{$symbol}; |
549a6b10 |
973 | emit_symbol($symbol); |
3e3baf6d |
974 | } |
0a753a76 |
975 | |
549a6b10 |
976 | while (<DATA>) { |
977 | try_symbol($_); |
ac4c12e7 |
978 | } |
979 | |
18f68570 |
980 | if ($PLATFORM =~ /^win(?:32|ce)$/) { |
549a6b10 |
981 | foreach my $symbol (qw( |
00b02797 |
982 | setuid |
983 | setgid |
7766f137 |
984 | boot_DynaLoader |
7766f137 |
985 | Perl_init_os_extras |
c44d3fdb |
986 | Perl_thread_create |
7766f137 |
987 | Perl_win32_init |
988 | RunPerl |
5290524f |
989 | win32_async_check |
7766f137 |
990 | win32_errno |
991 | win32_environ |
7766f137 |
992 | win32_abort |
993 | win32_fstat |
994 | win32_stat |
995 | win32_pipe |
996 | win32_popen |
997 | win32_pclose |
998 | win32_rename |
999 | win32_setmode |
1000 | win32_lseek |
1001 | win32_tell |
1002 | win32_dup |
1003 | win32_dup2 |
1004 | win32_open |
1005 | win32_close |
1006 | win32_eof |
1007 | win32_read |
1008 | win32_write |
1009 | win32_spawnvp |
1010 | win32_mkdir |
1011 | win32_rmdir |
1012 | win32_chdir |
1013 | win32_flock |
1014 | win32_execv |
1015 | win32_execvp |
1016 | win32_htons |
1017 | win32_ntohs |
1018 | win32_htonl |
1019 | win32_ntohl |
1020 | win32_inet_addr |
1021 | win32_inet_ntoa |
1022 | win32_socket |
1023 | win32_bind |
1024 | win32_listen |
1025 | win32_accept |
1026 | win32_connect |
1027 | win32_send |
1028 | win32_sendto |
1029 | win32_recv |
1030 | win32_recvfrom |
1031 | win32_shutdown |
1032 | win32_closesocket |
1033 | win32_ioctlsocket |
1034 | win32_setsockopt |
1035 | win32_getsockopt |
1036 | win32_getpeername |
1037 | win32_getsockname |
1038 | win32_gethostname |
1039 | win32_gethostbyname |
1040 | win32_gethostbyaddr |
1041 | win32_getprotobyname |
1042 | win32_getprotobynumber |
1043 | win32_getservbyname |
1044 | win32_getservbyport |
1045 | win32_select |
1046 | win32_endhostent |
1047 | win32_endnetent |
1048 | win32_endprotoent |
1049 | win32_endservent |
1050 | win32_getnetent |
1051 | win32_getnetbyname |
1052 | win32_getnetbyaddr |
1053 | win32_getprotoent |
1054 | win32_getservent |
1055 | win32_sethostent |
1056 | win32_setnetent |
1057 | win32_setprotoent |
1058 | win32_setservent |
1059 | win32_getenv |
1060 | win32_putenv |
1061 | win32_perror |
7766f137 |
1062 | win32_malloc |
1063 | win32_calloc |
1064 | win32_realloc |
1065 | win32_free |
1066 | win32_sleep |
1067 | win32_times |
1068 | win32_access |
1069 | win32_alarm |
1070 | win32_chmod |
1071 | win32_open_osfhandle |
1072 | win32_get_osfhandle |
1073 | win32_ioctl |
1074 | win32_link |
1075 | win32_unlink |
1076 | win32_utime |
57ab3dfe |
1077 | win32_gettimeofday |
7766f137 |
1078 | win32_uname |
1079 | win32_wait |
1080 | win32_waitpid |
1081 | win32_kill |
1082 | win32_str_os_error |
1083 | win32_opendir |
1084 | win32_readdir |
1085 | win32_telldir |
1086 | win32_seekdir |
1087 | win32_rewinddir |
1088 | win32_closedir |
1089 | win32_longpath |
1090 | win32_os_id |
1091 | win32_getpid |
1092 | win32_crypt |
1093 | win32_dynaload |
df3728a2 |
1094 | win32_get_childenv |
1095 | win32_free_childenv |
1096 | win32_clearenv |
1097 | win32_get_childdir |
1098 | win32_free_childdir |
00b02797 |
1099 | win32_stdin |
1100 | win32_stdout |
1101 | win32_stderr |
1102 | win32_ferror |
1103 | win32_feof |
1104 | win32_strerror |
1105 | win32_fprintf |
1106 | win32_printf |
1107 | win32_vfprintf |
1108 | win32_vprintf |
1109 | win32_fread |
1110 | win32_fwrite |
1111 | win32_fopen |
1112 | win32_fdopen |
1113 | win32_freopen |
1114 | win32_fclose |
1115 | win32_fputs |
1116 | win32_fputc |
1117 | win32_ungetc |
1118 | win32_getc |
1119 | win32_fileno |
1120 | win32_clearerr |
1121 | win32_fflush |
1122 | win32_ftell |
1123 | win32_fseek |
1124 | win32_fgetpos |
1125 | win32_fsetpos |
1126 | win32_rewind |
1127 | win32_tmpfile |
1128 | win32_setbuf |
1129 | win32_setvbuf |
1130 | win32_flushall |
1131 | win32_fcloseall |
1132 | win32_fgets |
1133 | win32_gets |
1134 | win32_fgetc |
1135 | win32_putc |
1136 | win32_puts |
1137 | win32_getchar |
1138 | win32_putchar |
7766f137 |
1139 | )) |
1140 | { |
549a6b10 |
1141 | try_symbol($symbol); |
1142 | } |
1143 | } |
3cfae81b |
1144 | elsif ($PLATFORM eq 'os2') { |
7766f137 |
1145 | open MAP, 'miniperl.map' or die 'Cannot read miniperl.map'; |
1146 | /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>; |
1147 | close MAP or die 'Cannot close miniperl.map'; |
1148 | |
ad6971c8 |
1149 | @missing = grep { !exists $mapped{$_} } |
7766f137 |
1150 | keys %export; |
c6261f3b |
1151 | @missing = grep { !exists $exportperlmalloc{$_} } @missing; |
7766f137 |
1152 | delete $export{$_} foreach @missing; |
3cfae81b |
1153 | } |
084592ab |
1154 | elsif ($PLATFORM eq 'MacOS') { |
1155 | open MACSYMS, 'macperl.sym' or die 'Cannot read macperl.sym'; |
1156 | |
1157 | while (<MACSYMS>) { |
1158 | try_symbol($_); |
1159 | } |
1160 | |
1161 | close MACSYMS; |
1162 | } |
2986a63f |
1163 | elsif ($PLATFORM eq 'netware') { |
1164 | foreach my $symbol (qw( |
1165 | boot_DynaLoader |
1166 | Perl_init_os_extras |
1167 | Perl_thread_create |
1168 | Perl_nw5_init |
1169 | RunPerl |
1170 | AllocStdPerl |
1171 | FreeStdPerl |
1172 | do_spawn2 |
1173 | do_aspawn |
1174 | nw_uname |
1175 | nw_stdin |
1176 | nw_stdout |
1177 | nw_stderr |
1178 | nw_feof |
1179 | nw_ferror |
1180 | nw_fopen |
1181 | nw_fclose |
1182 | nw_clearerr |
1183 | nw_getc |
1184 | nw_fgets |
1185 | nw_fputc |
1186 | nw_fputs |
1187 | nw_fflush |
1188 | nw_ungetc |
1189 | nw_fileno |
1190 | nw_fdopen |
1191 | nw_freopen |
1192 | nw_fread |
1193 | nw_fwrite |
1194 | nw_setbuf |
1195 | nw_setvbuf |
1196 | nw_vfprintf |
1197 | nw_ftell |
1198 | nw_fseek |
1199 | nw_rewind |
1200 | nw_tmpfile |
1201 | nw_fgetpos |
1202 | nw_fsetpos |
1203 | nw_dup |
1204 | nw_access |
1205 | nw_chmod |
1206 | nw_chsize |
1207 | nw_close |
1208 | nw_dup2 |
1209 | nw_flock |
1210 | nw_isatty |
1211 | nw_link |
1212 | nw_lseek |
1213 | nw_stat |
1214 | nw_mktemp |
1215 | nw_open |
1216 | nw_read |
1217 | nw_rename |
1218 | nw_setmode |
1219 | nw_unlink |
1220 | nw_utime |
1221 | nw_write |
1222 | nw_chdir |
1223 | nw_rmdir |
1224 | nw_closedir |
1225 | nw_opendir |
1226 | nw_readdir |
1227 | nw_rewinddir |
1228 | nw_seekdir |
1229 | nw_telldir |
1230 | nw_htonl |
1231 | nw_htons |
1232 | nw_ntohl |
1233 | nw_ntohs |
1234 | nw_accept |
1235 | nw_bind |
1236 | nw_connect |
1237 | nw_endhostent |
1238 | nw_endnetent |
1239 | nw_endprotoent |
1240 | nw_endservent |
1241 | nw_gethostbyaddr |
1242 | nw_gethostbyname |
1243 | nw_gethostent |
1244 | nw_gethostname |
1245 | nw_getnetbyaddr |
1246 | nw_getnetbyname |
1247 | nw_getnetent |
1248 | nw_getpeername |
1249 | nw_getprotobyname |
1250 | nw_getprotobynumber |
1251 | nw_getprotoent |
1252 | nw_getservbyname |
1253 | nw_getservbyport |
1254 | nw_getservent |
1255 | nw_getsockname |
1256 | nw_getsockopt |
1257 | nw_inet_addr |
1258 | nw_listen |
1259 | nw_socket |
1260 | nw_recv |
1261 | nw_recvfrom |
1262 | nw_select |
1263 | nw_send |
1264 | nw_sendto |
1265 | nw_sethostent |
1266 | nw_setnetent |
1267 | nw_setprotoent |
1268 | nw_setservent |
3a0827a6 |
1269 | nw_setsockopt |
4d76e4b4 |
1270 | nw_inet_ntoa |
2986a63f |
1271 | nw_shutdown |
1272 | nw_crypt |
1273 | nw_execvp |
1274 | nw_kill |
1275 | nw_Popen |
1276 | nw_Pclose |
1277 | nw_Pipe |
1278 | nw_times |
1279 | nw_waitpid |
1280 | nw_getpid |
1281 | nw_spawnvp |
1282 | nw_os_id |
1283 | nw_open_osfhandle |
1284 | nw_get_osfhandle |
1285 | nw_abort |
1286 | nw_sleep |
1287 | nw_wait |
1288 | nw_dynaload |
1289 | nw_strerror |
1290 | fnFpSetMode |
1291 | fnInsertHashListAddrs |
1292 | fnGetHashListAddrs |
1293 | Perl_deb |
011f1a1a |
1294 | Perl_sv_setsv |
1295 | Perl_sv_catsv |
1296 | Perl_sv_catpvn |
1297 | Perl_sv_2pv |
f355267c |
1298 | nw_freeenviron |
1299 | Remove_Thread_Ctx |
2986a63f |
1300 | )) |
1301 | { |
1302 | try_symbol($symbol); |
1303 | } |
1304 | } |
22239a37 |
1305 | |
549a6b10 |
1306 | # Now all symbols should be defined because |
1307 | # next we are going to output them. |
1308 | |
7766f137 |
1309 | foreach my $symbol (sort keys %export) { |
1310 | output_symbol($symbol); |
1311 | } |
549a6b10 |
1312 | |
011f1a1a |
1313 | if ($PLATFORM eq 'os2') { |
52e4c282 |
1314 | print "; LAST_ORDINAL=$sym_ord\n"; |
2986a63f |
1315 | } |
1316 | |
549a6b10 |
1317 | sub emit_symbol { |
7766f137 |
1318 | my $symbol = shift; |
9df9a5cd |
1319 | chomp($symbol); |
7766f137 |
1320 | $export{$symbol} = 1; |
549a6b10 |
1321 | } |
1322 | |
1323 | sub output_symbol { |
1324 | my $symbol = shift; |
18f68570 |
1325 | if ($PLATFORM =~ /^win(?:32|ce)$/) { |
549a6b10 |
1326 | $symbol = "_$symbol" if $CCTYPE eq 'BORLAND'; |
520c758a |
1327 | print "\t$symbol\n"; |
549a6b10 |
1328 | # XXX: binary compatibility between compilers is an exercise |
1329 | # in frustration :-( |
1330 | # if ($CCTYPE eq "BORLAND") { |
1331 | # # workaround Borland quirk by exporting both the straight |
1332 | # # name and a name with leading underscore. Note the |
1333 | # # alias *must* come after the symbol itself, if both |
1334 | # # are to be exported. (Linker bug?) |
1335 | # print "\t_$symbol\n"; |
1336 | # print "\t$symbol = _$symbol\n"; |
1337 | # } |
1338 | # elsif ($CCTYPE eq 'GCC') { |
1339 | # # Symbols have leading _ whole process is $%@"% slow |
1340 | # # so skip aliases for now |
1341 | # nprint "\t$symbol\n"; |
1342 | # } |
1343 | # else { |
1344 | # # for binary coexistence, export both the symbol and |
1345 | # # alias with leading underscore |
1346 | # print "\t$symbol\n"; |
1347 | # print "\t_$symbol = $symbol\n"; |
1348 | # } |
7766f137 |
1349 | } |
1350 | elsif ($PLATFORM eq 'os2') { |
52e4c282 |
1351 | printf qq( %-31s \@%s\n), |
1352 | qq("$symbol"), $ordinal{$symbol} || ++$sym_ord; |
78232bc0 |
1353 | printf qq( %-31s \@%s\n), |
1354 | qq("$exportperlmalloc{$symbol}" = "$symbol"), |
1355 | $ordinal{$exportperlmalloc{$symbol}} || ++$sym_ord |
1356 | if $exportperlmalloc and exists $exportperlmalloc{$symbol}; |
7766f137 |
1357 | } |
084592ab |
1358 | elsif ($PLATFORM eq 'aix' || $PLATFORM eq 'MacOS') { |
549a6b10 |
1359 | print "$symbol\n"; |
1360 | } |
2986a63f |
1361 | elsif ($PLATFORM eq 'netware') { |
1362 | print "\t$symbol,\n"; |
1363 | } |
549a6b10 |
1364 | } |
1365 | |
1366 | 1; |
1367 | __DATA__ |
1368 | # extra globals not included above. |
8437356b |
1369 | Perl_cxinc |
549a6b10 |
1370 | perl_alloc |
7766f137 |
1371 | perl_alloc_using |
014822e4 |
1372 | perl_clone |
1373 | perl_clone_using |
549a6b10 |
1374 | perl_construct |
1375 | perl_destruct |
1376 | perl_free |
1377 | perl_parse |
1378 | perl_run |
44798d05 |
1379 | # Oddities from PerlIO |
568ad336 |
1380 | PerlIO_binmode |
8437356b |
1381 | PerlIO_getpos |
568ad336 |
1382 | PerlIO_init |
568ad336 |
1383 | PerlIO_setpos |
568ad336 |
1384 | PerlIO_sprintf |
8437356b |
1385 | PerlIO_sv_dup |
1386 | PerlIO_tmpfile |
8437356b |
1387 | PerlIO_vsprintf |
1388 | perlsio_binmode |