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