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