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