This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In makedef.pl, remove PL_csh{len,name} from 3 skip lists.
[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 )];
270}
271
549a6b10 272if ($PLATFORM eq 'win32') {
7766f137
GS
273 skip_symbols [qw(
274 PL_statusvalue_vms
7766f137
GS
275 PL_DBcv
276 PL_generation
277 PL_lastgotoprobe
7766f137 278 PL_modcount
7766f137
GS
279 PL_timesbuf
280 main
7766f137
GS
281 )];
282}
93ea32b8 283elsif ($PLATFORM ne 'vms') {
54725af6
GS
284 skip_symbols [qw(
285 Perl_do_spawn
286 Perl_do_spawn_nowait
287 Perl_do_aspawn
288 )];
289}
290if ($PLATFORM eq 'wince') {
18f68570
VK
291 skip_symbols [qw(
292 PL_statusvalue_vms
18f68570
VK
293 PL_DBcv
294 PL_generation
295 PL_lastgotoprobe
18f68570 296 PL_modcount
18f68570 297 PL_timesbuf
18f68570
VK
298 setgid
299 setuid
18f68570
VK
300 win32_free_childdir
301 win32_free_childenv
302 win32_get_childdir
303 win32_get_childenv
304 win32_spawnvp
305 main
18f68570
VK
306 )];
307}
7766f137 308elsif ($PLATFORM eq 'aix') {
549a6b10 309 skip_symbols([qw(
7766f137 310 PL_statusvalue_vms
7766f137 311 )]);
5cdbb95e
RT
312 skip_symbols([qw(
313 Perl_signbit
314 )])
315 if $define{'HAS_SIGNBIT'};
7766f137
GS
316}
317elsif ($PLATFORM eq 'os2') {
3cfae81b 318 emit_symbols([qw(
7766f137
GS
319 ctermid
320 get_sysinfo
321 Perl_OS2_init
764df951
IZ
322 Perl_OS2_init3
323 Perl_OS2_term
7766f137
GS
324 OS2_Perl_data
325 dlopen
326 dlsym
327 dlerror
403d6f8e 328 dlclose
59ad941d
IZ
329 dup2
330 dup
7766f137
GS
331 my_tmpfile
332 my_tmpnam
333 my_flock
9c130f5b
NIS
334 my_rmdir
335 my_mkdir
f72c975a
IZ
336 my_getpwuid
337 my_getpwnam
338 my_getpwent
339 my_setpwent
340 my_endpwent
622913ab
IZ
341 fork_with_resources
342 croak_with_os2error
f72c975a
IZ
343 setgrent
344 endgrent
345 getgrent
7766f137
GS
346 malloc_mutex
347 threads_mutex
348 nthreads
349 nthreads_cond
350 os2_cond_wait
351 os2_stat
1933e12c
IZ
352 os2_execname
353 async_mssleep
354 msCounter
355 InfoTable
7766f137
GS
356 pthread_join
357 pthread_create
358 pthread_detach
359 XS_Cwd_change_drive
360 XS_Cwd_current_drive
361 XS_Cwd_extLibpath
362 XS_Cwd_extLibpath_set
363 XS_Cwd_sys_abspath
364 XS_Cwd_sys_chdir
365 XS_Cwd_sys_cwd
366 XS_Cwd_sys_is_absolute
367 XS_Cwd_sys_is_relative
368 XS_Cwd_sys_is_rooted
369 XS_DynaLoader_mod2fname
370 XS_File__Copy_syscopy
371 Perl_Register_MQ
372 Perl_Deregister_MQ
373 Perl_Serve_Messages
374 Perl_Process_Messages
375 init_PMWIN_entries
376 PMWIN_entries
377 Perl_hab_GET
35bc1fdc
IZ
378 loadByOrdinal
379 pExtFCN
30500b05
IZ
380 os2error
381 ResetWinError
382 CroakWinError
5c728af0 383 PL_do_undump
7766f137 384 )]);
5c728af0
IZ
385 emit_symbols([qw(os2_cond_wait
386 pthread_join
387 pthread_create
388 pthread_detach
389 )])
390 if $define{'USE_5005THREADS'} or $define{'USE_ITHREADS'};
3cfae81b 391}
2986a63f
JH
392elsif ($PLATFORM eq 'netware') {
393 skip_symbols [qw(
394 PL_statusvalue_vms
2986a63f
JH
395 PL_DBcv
396 PL_generation
397 PL_lastgotoprobe
2986a63f 398 PL_modcount
2986a63f
JH
399 PL_timesbuf
400 main
2986a63f
JH
401 )];
402}
93ea32b8
CB
403elsif ($PLATFORM eq 'vms') {
404 emit_symbols([qw(
93ea32b8
CB
405 Perl_cando
406 Perl_cando_by_name
407 Perl_closedir
408 Perl_csighandler_init
409 Perl_do_rmdir
410 Perl_fileify_dirspec
411 Perl_fileify_dirspec_ts
412 Perl_fileify_dirspec_utf8
413 Perl_fileify_dirspec_utf8_ts
414 Perl_flex_fstat
415 Perl_flex_lstat
416 Perl_flex_stat
417 Perl_kill_file
418 Perl_my_chdir
419 Perl_my_chmod
420 Perl_my_crypt
421 Perl_my_endpwent
422 Perl_my_fclose
423 Perl_my_fdopen
424 Perl_my_fgetname
425 Perl_my_flush
426 Perl_my_fwrite
427 Perl_my_gconvert
428 Perl_my_getenv
429 Perl_my_getenv_len
430 Perl_my_getlogin
431 Perl_my_getpwnam
432 Perl_my_getpwuid
433 Perl_my_gmtime
434 Perl_my_kill
435 Perl_my_localtime
436 Perl_my_mkdir
437 Perl_my_sigaction
438 Perl_my_symlink
439 Perl_my_time
440 Perl_my_tmpfile
441 Perl_my_trnlnm
442 Perl_my_utime
443 Perl_my_waitpid
444 Perl_opendir
445 Perl_pathify_dirspec
446 Perl_pathify_dirspec_ts
447 Perl_pathify_dirspec_utf8
448 Perl_pathify_dirspec_utf8_ts
449 Perl_readdir
450 Perl_readdir_r
451 Perl_rename
452 Perl_rmscopy
453 Perl_rmsexpand
454 Perl_rmsexpand_ts
455 Perl_rmsexpand_utf8
456 Perl_rmsexpand_utf8_ts
457 Perl_seekdir
458 Perl_sig_to_vmscondition
459 Perl_telldir
460 Perl_tounixpath
461 Perl_tounixpath_ts
462 Perl_tounixpath_utf8
463 Perl_tounixpath_utf8_ts
464 Perl_tounixspec
465 Perl_tounixspec_ts
466 Perl_tounixspec_utf8
467 Perl_tounixspec_utf8_ts
468 Perl_tovmspath
469 Perl_tovmspath_ts
470 Perl_tovmspath_utf8
471 Perl_tovmspath_utf8_ts
472 Perl_tovmsspec
473 Perl_tovmsspec_ts
474 Perl_tovmsspec_utf8
475 Perl_tovmsspec_utf8_ts
476 Perl_trim_unixpath
477 Perl_vms_case_tolerant
478 Perl_vms_do_aexec
479 Perl_vms_do_exec
480 Perl_vms_image_init
481 Perl_vms_realpath
482 Perl_vmssetenv
483 Perl_vmssetuserlnm
484 Perl_vmstrnenv
485 PerlIO_openn
486 )]);
487 skip_symbols([qw(
488 PL_statusvalue_posix
93ea32b8
CB
489 )]);
490 skip_symbols([qw(
491 Perl_signbit
492 )])
493 if $define{'HAS_SIGNBIT'};
df39eaa8
NC
494}
495
496unless ($define{UNLINK_ALL_VERSIONS}) {
93ea32b8
CB
497 skip_symbols([qw(
498 Perl_unlnk
499 )])
93ea32b8 500}
3cfae81b 501
7766f137
GS
502unless ($define{'DEBUGGING'}) {
503 skip_symbols [qw(
7766f137
GS
504 Perl_deb_growlevel
505 Perl_debop
506 Perl_debprofdump
507 Perl_debstack
508 Perl_debstackptrs
5cbf7fcf 509 Perl_pad_sv
b65222da 510 Perl_pad_setsv
943795c2 511 Perl_hv_assert
7766f137
GS
512 PL_block_type
513 PL_watchaddr
514 PL_watchok
e0cde265 515 PL_watch_pvx
7766f137
GS
516 )];
517}
518
605881df
SH
519if ($define{'PERL_IMPLICIT_CONTEXT'}) {
520 skip_symbols [qw(
521 PL_sig_sv
522 )];
523}
524
7766f137
GS
525if ($define{'PERL_IMPLICIT_SYS'}) {
526 skip_symbols [qw(
7766f137
GS
527 Perl_my_popen
528 Perl_my_pclose
529 )];
530}
531else {
532 skip_symbols [qw(
533 PL_Mem
534 PL_MemShared
535 PL_MemParse
536 PL_Env
537 PL_StdIO
538 PL_LIO
539 PL_Dir
540 PL_Sock
541 PL_Proc
542 )];
543}
544
f8c7b90f 545unless ($define{'PERL_OLD_COPY_ON_WRITE'}) {
0190f6ec
AT
546 skip_symbols [qw(
547 Perl_sv_setsv_cow
548 )];
549}
550
5bcb3f6c
NIS
551unless ($define{'USE_REENTRANT_API'}) {
552 skip_symbols [qw(
553 PL_reentrant_buffer
554 )];
555}
556
7766f137
GS
557if ($define{'MYMALLOC'}) {
558 emit_symbols [qw(
559 Perl_dump_mstats
827e134a 560 Perl_get_mstats
9c130f5b
NIS
561 Perl_strdup
562 Perl_putenv
6af660ee
IZ
563 MallocCfg_ptr
564 MallocCfgP_ptr
7766f137 565 )];
3db8f154 566 if ($define{'USE_ITHREADS'}) {
1feb2720
GS
567 emit_symbols [qw(
568 PL_malloc_mutex
569 )];
570 }
80fc1a6e
GS
571 else {
572 skip_symbols [qw(
573 PL_malloc_mutex
574 )];
575 }
51371543
GS
576}
577else {
7766f137
GS
578 skip_symbols [qw(
579 PL_malloc_mutex
580 Perl_dump_mstats
6ecd3fcb 581 Perl_get_mstats
7766f137 582 Perl_malloced_size
64107180 583 Perl_malloc_good_size
6af660ee
IZ
584 MallocCfg_ptr
585 MallocCfgP_ptr
7766f137
GS
586 )];
587}
588
8852afe9
MB
589if ($define{'PERL_USE_SAFE_PUTENV'}) {
590 skip_symbols [qw(
591 PL_use_safe_putenv
592 )];
593}
594
3db8f154 595unless ($define{'USE_ITHREADS'}) {
7766f137
GS
596 skip_symbols [qw(
597 PL_thr_key
f433d095
GS
598 )];
599}
600
3db8f154 601# USE_5005THREADS symbols. Kept as reference for easier removal
f433d095 602 skip_symbols [qw(
7766f137
GS
603 PL_sv_mutex
604 PL_strtab_mutex
605 PL_svref_mutex
7766f137
GS
606 PL_cred_mutex
607 PL_eval_mutex
6940069f
GS
608 PL_fdpid_mutex
609 PL_sv_lock_mutex
7766f137
GS
610 PL_eval_cond
611 PL_eval_owner
612 PL_threads_mutex
613 PL_nthreads
614 PL_nthreads_cond
615 PL_threadnum
616 PL_threadsv_names
617 PL_thrsv
618 PL_vtbl_mutex
7766f137
GS
619 Perl_condpair_magic
620 Perl_new_struct_thread
621 Perl_per_thread_magicals
622 Perl_thread_create
623 Perl_find_threadsv
624 Perl_unlock_condpair
625 Perl_magic_mutexfree
4755096e 626 Perl_sv_lock
7766f137 627 )];
7766f137
GS
628
629unless ($define{'USE_ITHREADS'}) {
630 skip_symbols [qw(
534825c4 631 PL_op_mutex
7e95b20d
JH
632 PL_regex_pad
633 PL_regex_padav
f2f7cecd
MB
634 PL_sharedsv_space
635 PL_sharedsv_space_mutex
e2975953 636 PL_dollarzero_mutex
b60bf3b9 637 PL_hints_mutex
8703a9a4 638 PL_my_ctx_mutex
f1791e53 639 PL_perlio_mutex
517dbd53 640 PL_regdupe
7c425e3c
NC
641 Perl_clone_params_del
642 Perl_clone_params_new
b0bb49b6 643 Perl_parser_dup
7766f137
GS
644 Perl_dirp_dup
645 Perl_cx_dup
646 Perl_si_dup
647 Perl_any_dup
648 Perl_ss_dup
649 Perl_fp_dup
650 Perl_gp_dup
651 Perl_he_dup
652 Perl_mg_dup
81621b66 653 Perl_mro_meta_dup
7f605079 654 Perl_re_dup_guts
7766f137 655 Perl_sv_dup
7c425e3c 656 Perl_sv_dup_inc
aeef2723 657 Perl_rvpv_dup
88daff13 658 Perl_hek_dup
7766f137 659 Perl_sys_intern_dup
7766f137
GS
660 perl_clone
661 perl_clone_using
038f0558
JH
662 Perl_sharedsv_find
663 Perl_sharedsv_init
664 Perl_sharedsv_lock
665 Perl_sharedsv_new
666 Perl_sharedsv_thrcnt_dec
667 Perl_sharedsv_thrcnt_inc
668 Perl_sharedsv_unlock
dc1061dc 669 Perl_stashpv_hvname_match
1fa600a7 670 Perl_regdupe_internal
392d04bb 671 Perl_newPADOP
7766f137
GS
672 )];
673}
674
675unless ($define{'PERL_IMPLICIT_CONTEXT'}) {
676 skip_symbols [qw(
1f9ecdc6
SH
677 PL_my_cxt_index
678 PL_my_cxt_list
679 PL_my_cxt_size
ecb9cc66 680 PL_my_cxt_keys
7766f137
GS
681 Perl_croak_nocontext
682 Perl_die_nocontext
683 Perl_deb_nocontext
684 Perl_form_nocontext
e0f4245d 685 Perl_load_module_nocontext
7766f137
GS
686 Perl_mess_nocontext
687 Perl_warn_nocontext
688 Perl_warner_nocontext
689 Perl_newSVpvf_nocontext
690 Perl_sv_catpvf_nocontext
691 Perl_sv_setpvf_nocontext
692 Perl_sv_catpvf_mg_nocontext
693 Perl_sv_setpvf_mg_nocontext
484eff17 694 Perl_my_cxt_init
ecb9cc66 695 Perl_my_cxt_index
7766f137
GS
696 )];
697}
698
699unless ($define{'PERL_IMPLICIT_SYS'}) {
700 skip_symbols [qw(
701 perl_alloc_using
014822e4 702 perl_clone_using
7766f137
GS
703 )];
704}
705
706unless ($define{'FAKE_THREADS'}) {
707 skip_symbols [qw(PL_curthr)];
708}
709
aadb217d 710unless ($define{'PL_OP_SLAB_ALLOC'}) {
e0cde265 711 skip_symbols [qw(
aadb217d
JH
712 PL_OpPtr
713 PL_OpSlab
714 PL_OpSpace
715 Perl_Slab_Alloc
716 Perl_Slab_Free
717 )];
8d2d9fd7
RGS
718}
719
720unless ($define{'PERL_DEBUG_READONLY_OPS'}) {
721 skip_symbols [qw(
722 PL_slab_count
723 PL_slabs
724 )];
aadb217d
JH
725}
726
727unless ($define{'THREADS_HAVE_PIDS'}) {
728 skip_symbols [qw(PL_ppid)];
e0cde265
SH
729}
730
aadb217d 731unless ($define{'PERL_NEED_APPCTX'}) {
e0cde265 732 skip_symbols [qw(
aadb217d 733 PL_appctx
e0cde265
SH
734 )];
735}
736
aadb217d 737unless ($define{'PERL_NEED_TIMESBASE'}) {
e0cde265 738 skip_symbols [qw(
aadb217d 739 PL_timesbase
e0cde265
SH
740 )];
741}
742
dfc72f41
NC
743unless ($define{'DEBUG_LEAKING_SCALARS'}) {
744 skip_symbols [qw(
745 PL_sv_serial
746 )];
747}
748
808e2276
NC
749unless ($define{'DEBUG_LEAKING_SCALARS_FORK_DUMP'}) {
750 skip_symbols [qw(
751 PL_dumper_fd
752 )];
753}
c69033f2
NC
754unless ($define{'PERL_DONT_CREATE_GVSV'}) {
755 skip_symbols [qw(
756 Perl_gv_SVadd
757 )];
758}
ce582cee
NC
759if ($define{'SPRINTF_RETURNS_STRLEN'}) {
760 skip_symbols [qw(
761 Perl_my_sprintf
762 )];
763}
ca0c25f6
NC
764unless ($define{'PERL_USES_PL_PIDSTATUS'}) {
765 skip_symbols [qw(
766 Perl_pidgone
767 PL_pidstatus
768 )];
769}
808e2276 770
02ca4724
SP
771unless ($define{'PERL_TRACK_MEMPOOL'}) {
772 skip_symbols [qw(
773 PL_memory_debug_header
774 )];
775}
776
f8565a66
NC
777if ($define{'PERL_MAD'}) {
778 skip_symbols [qw(
779 PL_nextval
780 PL_nexttype
781 )];
782} else {
e3e31fab
SH
783 skip_symbols [qw(
784 PL_madskills
785 PL_xmlfp
f8565a66 786 PL_lasttoke
5336380d
NC
787 PL_realtokenstart
788 PL_faketokens
789 PL_thismad
790 PL_thistoken
791 PL_thisopen
792 PL_thisstuff
793 PL_thisclose
794 PL_thiswhite
795 PL_nextwhite
796 PL_skipwhite
797 PL_endwhite
798 PL_curforce
1dba731d 799 Perl_pad_peg
3b721df9
NC
800 Perl_xmldump_indent
801 Perl_xmldump_vindent
802 Perl_xmldump_all
803 Perl_xmldump_packsubs
804 Perl_xmldump_sub
805 Perl_xmldump_form
806 Perl_xmldump_eval
807 Perl_sv_catxmlsv
808 Perl_sv_catxmlpvn
809 Perl_sv_xmlpeek
810 Perl_do_pmop_xmldump
811 Perl_pmop_xmldump
812 Perl_do_op_xmldump
813 Perl_op_xmldump
e3e31fab
SH
814 )];
815}
816
2a5adacc
JD
817unless ($define{'MULTIPLICITY'}) {
818 skip_symbols [qw(
01523419 819 PL_interp_size
9e08d3a4 820 PL_interp_size_5_16_0
2a5adacc
JD
821 )];
822}
823
824unless ($define{'PERL_GLOBAL_STRUCT'}) {
825 skip_symbols [qw(
826 PL_global_struct_size
827 )];
828}
829
436dbe32
SH
830unless ($define{'PERL_GLOBAL_STRUCT_PRIVATE'}) {
831 skip_symbols [qw(
832 PL_my_cxt_keys
833 Perl_my_cxt_index
834 )];
835}
836
bd1ae5d2 837unless ($define{HAS_MMAP}) {
ac6bedea 838 skip_symbols [qw(
aadb217d
JH
839 PL_mmap_page_size
840 )];
ac6bedea
JH
841}
842
bd1ae5d2 843if ($define{HAS_SIGACTION}) {
aadb217d
JH
844 skip_symbols [qw(
845 PL_sig_trapped
846 )];
d97afc04
AT
847}
848
bdcba273
NC
849unless ($define{USE_LOCALE_COLLATE}) {
850 skip_symbols [qw(
851 PL_collation_ix
852 PL_collation_name
853 PL_collation_standard
854 PL_collxfrm_base
855 PL_collxfrm_mult
856 Perl_sv_collxfrm
857 Perl_sv_collxfrm_flags
858 )];
859}
860
1f1ade4f
NC
861unless ($define{USE_LOCALE_NUMERIC}) {
862 skip_symbols [qw(
863 PL_numeric_local
864 PL_numeric_name
865 PL_numeric_radix_sv
866 PL_numeric_standard
867 )];
868}
869
1ab20eaa
NC
870unless ($define{HAVE_INTERP_INTERN}) {
871 skip_symbols [qw(
872 Perl_sys_intern_clear
873 Perl_sys_intern_dup
874 Perl_sys_intern_init
875 PL_sys_intern
876 )];
877}
878
aadb217d
JH
879if ($^O ne 'vms') {
880 # VMS does its own thing for these symbols.
881 skip_symbols [qw(PL_sig_handlers_initted
882 PL_sig_ignoring
883 PL_sig_defaulting)];
884}
885
7766f137
GS
886sub readvar {
887 my $file = shift;
888 my $proc = shift || sub { "PL_$_[2]" };
889 open(VARS,$file) || die "Cannot open $file: $!\n";
890 my @syms;
891 while (<VARS>) {
892 # All symbols have a Perl_ prefix because that's what embed.h
aadb217d
JH
893 # sticks in front of them. The A?I?S?C? is strictly speaking
894 # wrong.
313fe300 895 push(@syms, &$proc($1,$2,$3)) if (/\bPERLVAR(A?I?S?C?)\(([IGT])(\w+)/);
9df9a5cd
NIS
896 }
897 close(VARS);
7766f137
GS
898 return \@syms;
899}
900
7766f137
GS
901if ($define{'PERL_GLOBAL_STRUCT'}) {
902 my $global = readvar($perlvars_h);
903 skip_symbols $global;
904 emit_symbol('Perl_GetVars');
905 emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
aadb217d
JH
906} else {
907 skip_symbols [qw(Perl_init_global_struct Perl_free_global_struct)];
7766f137 908}
36c15d3f 909
22c35a8c
GS
910# functions from *.sym files
911
7697f15a 912my @syms = ($global_sym, $globvar_sym);
549a6b10 913
d892637e
NIS
914# Symbols that are the public face of the PerlIO layers implementation
915# These are in _addition to_ the public face of the abstraction
916# and need to be exported to allow XS modules to implement layers
9df9a5cd 917my @layer_syms = qw(
db76e01e
JH
918 PerlIOBase_binmode
919 PerlIOBase_clearerr
920 PerlIOBase_close
921 PerlIOBase_dup
922 PerlIOBase_eof
923 PerlIOBase_error
924 PerlIOBase_fileno
925 PerlIOBase_noop_fail
926 PerlIOBase_noop_ok
927 PerlIOBase_popped
7e700b9a 928 PerlIOBase_pushed
db76e01e
JH
929 PerlIOBase_read
930 PerlIOBase_setlinebuf
931 PerlIOBase_unread
932 PerlIOBuf_bufsiz
933 PerlIOBuf_close
934 PerlIOBuf_dup
935 PerlIOBuf_fill
936 PerlIOBuf_flush
937 PerlIOBuf_get_base
938 PerlIOBuf_get_cnt
939 PerlIOBuf_get_ptr
940 PerlIOBuf_open
941 PerlIOBuf_popped
942 PerlIOBuf_pushed
943 PerlIOBuf_read
944 PerlIOBuf_seek
945 PerlIOBuf_set_ptrcnt
946 PerlIOBuf_tell
947 PerlIOBuf_unread
948 PerlIOBuf_write
949 PerlIO_allocate
8ffeedc3 950 PerlIO_apply_layera
db76e01e
JH
951 PerlIO_apply_layers
952 PerlIO_arg_fetch
953 PerlIO_debug
954 PerlIO_define_layer
4dcdb34a 955 PerlIO_find_layer
51d05609 956 PerlIO_isutf8
db76e01e 957 PerlIO_layer_fetch
4dcdb34a 958 PerlIO_list_alloc
db76e01e
JH
959 PerlIO_list_free
960 PerlIO_modestr
961 PerlIO_parse_layers
962 PerlIO_pending
963 PerlIO_perlio
964 PerlIO_pop
965 PerlIO_push
966 PerlIO_sv_dup
967 Perl_PerlIO_clearerr
968 Perl_PerlIO_close
188f0c84 969 Perl_PerlIO_context_layers
db76e01e
JH
970 Perl_PerlIO_eof
971 Perl_PerlIO_error
972 Perl_PerlIO_fileno
973 Perl_PerlIO_fill
974 Perl_PerlIO_flush
975 Perl_PerlIO_get_base
976 Perl_PerlIO_get_bufsiz
977 Perl_PerlIO_get_cnt
978 Perl_PerlIO_get_ptr
979 Perl_PerlIO_read
980 Perl_PerlIO_seek
981 Perl_PerlIO_set_cnt
982 Perl_PerlIO_set_ptrcnt
983 Perl_PerlIO_setlinebuf
984 Perl_PerlIO_stderr
985 Perl_PerlIO_stdin
986 Perl_PerlIO_stdout
987 Perl_PerlIO_tell
988 Perl_PerlIO_unread
989 Perl_PerlIO_write
9df9a5cd 990);
a5564b91
JH
991if ($PLATFORM eq 'netware') {
992 push(@layer_syms,'PL_def_layerlist','PL_known_layers','PL_perlio');
993}
d892637e 994
7766f137 995if ($define{'USE_PERLIO'}) {
d892637e
NIS
996 # Export the symols that make up the PerlIO abstraction, regardless
997 # of its implementation - read from a file
084592ab 998 push @syms, $perlio_sym;
d892637e
NIS
999
1000 # This part is then dependent on how the abstraction is implemented
084592ab 1001 if ($define{'USE_SFIO'}) {
d892637e 1002 # Old legacy non-stdio "PerlIO"
9df9a5cd 1003 skip_symbols \@layer_syms;
954fb84e 1004 skip_symbols [qw(perlsio_binmode)];
084592ab 1005 # SFIO defines most of the PerlIO routines as macros
d892637e
NIS
1006 # So undo most of what $perlio_sym has just done - d'oh !
1007 # Perhaps it would be better to list the ones which do exist
1008 # And emit them
084592ab
CN
1009 skip_symbols [qw(
1010 PerlIO_canset_cnt
1011 PerlIO_clearerr
1012 PerlIO_close
1013 PerlIO_eof
1014 PerlIO_error
1015 PerlIO_exportFILE
1016 PerlIO_fast_gets
1017 PerlIO_fdopen
1018 PerlIO_fileno
1019 PerlIO_findFILE
1020 PerlIO_flush
1021 PerlIO_get_base
1022 PerlIO_get_bufsiz
1023 PerlIO_get_cnt
1024 PerlIO_get_ptr
1025 PerlIO_getc
1026 PerlIO_getname
1027 PerlIO_has_base
1028 PerlIO_has_cntptr
1029 PerlIO_importFILE
1030 PerlIO_open
1031 PerlIO_printf
1032 PerlIO_putc
1033 PerlIO_puts
1034 PerlIO_read
1035 PerlIO_releaseFILE
1036 PerlIO_reopen
1037 PerlIO_rewind
1038 PerlIO_seek
1039 PerlIO_set_cnt
1040 PerlIO_set_ptrcnt
1041 PerlIO_setlinebuf
1042 PerlIO_sprintf
1043 PerlIO_stderr
1044 PerlIO_stdin
1045 PerlIO_stdout
1046 PerlIO_stdoutf
1047 PerlIO_tell
1048 PerlIO_ungetc
1049 PerlIO_vprintf
1050 PerlIO_write
bcdb689b
JH
1051 PerlIO_perlio
1052 Perl_PerlIO_clearerr
1053 Perl_PerlIO_close
1054 Perl_PerlIO_eof
1055 Perl_PerlIO_error
1056 Perl_PerlIO_fileno
1057 Perl_PerlIO_fill
1058 Perl_PerlIO_flush
1059 Perl_PerlIO_get_base
1060 Perl_PerlIO_get_bufsiz
1061 Perl_PerlIO_get_cnt
1062 Perl_PerlIO_get_ptr
1063 Perl_PerlIO_read
1064 Perl_PerlIO_seek
1065 Perl_PerlIO_set_cnt
1066 Perl_PerlIO_set_ptrcnt
1067 Perl_PerlIO_setlinebuf
1068 Perl_PerlIO_stderr
1069 Perl_PerlIO_stdin
1070 Perl_PerlIO_stdout
1071 Perl_PerlIO_tell
1072 Perl_PerlIO_unread
1073 Perl_PerlIO_write
ffcf5686
JH
1074 PL_def_layerlist
1075 PL_known_layers
1076 PL_perlio
084592ab
CN
1077 )];
1078 }
d892637e
NIS
1079 else {
1080 # PerlIO with layers - export implementation
1081 emit_symbols \@layer_syms;
954fb84e 1082 emit_symbols [qw(perlsio_binmode)];
d892637e 1083 }
f1791e53
RGS
1084 if ($define{'USE_ITHREADS'}) {
1085 emit_symbols [qw(
1086 PL_perlio_mutex
1087 )];
1088 }
1089 else {
1090 skip_symbols [qw(
1091 PL_perlio_mutex
1092 )];
1093 }
5138f914 1094} else {
d892637e
NIS
1095 # -Uuseperlio
1096 # Skip the PerlIO layer symbols - although
aadb217d 1097 # nothing should have exported them anyway.
9df9a5cd 1098 skip_symbols \@layer_syms;
a6272963
SH
1099 skip_symbols [qw(
1100 perlsio_binmode
1101 PL_def_layerlist
1102 PL_known_layers
1103 PL_perlio
1104 PL_perlio_debug_fd
1105 PL_perlio_fd_refcnt
1106 PL_perlio_fd_refcnt_size
1107 )];
1e8a8f59 1108
d892637e
NIS
1109 # Also do NOT add abstraction symbols from $perlio_sym
1110 # abstraction is done as #define to stdio
1111 # Remaining remnants that _may_ be functions
1112 # are handled in <DATA>
9df9a5cd 1113}
7766f137
GS
1114
1115for my $syms (@syms) {
1116 open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n";
1117 while (<GLOBAL>) {
1118 next if (!/^[A-Za-z]/);
1119 # Functions have a Perl_ prefix
1120 # Variables have a PL_ prefix
1121 chomp($_);
1122 my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : "");
1123 $symbol .= $_;
1124 emit_symbol($symbol) unless exists $skip{$symbol};
1125 }
1126 close(GLOBAL);
1127}
0a753a76 1128
22c35a8c 1129# variables
0a753a76 1130
87b9e160
NC
1131if ($define{'MULTIPLICITY'} && $define{PERL_GLOBAL_STRUCT}) {
1132 for my $f ($perlvars_h) {
18c4b137
JH
1133 my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" });
1134 emit_symbols $glob;
18c4b137 1135 }
1acb48c9 1136 # XXX AIX seems to want the perlvars.h symbols, for some reason
5c728af0 1137 if ($PLATFORM eq 'aix' or $PLATFORM eq 'os2') { # OS/2 needs PL_thr_key
1acb48c9 1138 my $glob = readvar($perlvars_h);
51371543
GS
1139 emit_symbols $glob;
1140 }
1141}
1142else {
1143 unless ($define{'PERL_GLOBAL_STRUCT'}) {
549a6b10 1144 my $glob = readvar($perlvars_h);
51371543 1145 emit_symbols $glob;
9df9a5cd 1146 }
87b9e160
NC
1147 unless ($define{MULTIPLICITY}) {
1148 my $glob = readvar($intrpvar_h);
1149 emit_symbols $glob;
1150 }
51371543 1151}
0a753a76 1152
549a6b10
JH
1153sub try_symbol {
1154 my $symbol = shift;
22239a37 1155
4d6b4052 1156 return if $symbol !~ /^[A-Za-z_]/;
549a6b10
JH
1157 return if $symbol =~ /^\#/;
1158 $symbol =~s/\r//g;
1159 chomp($symbol);
43cd9f80 1160 return if exists $skip{$symbol};
549a6b10 1161 emit_symbol($symbol);
3e3baf6d 1162}
0a753a76 1163
549a6b10
JH
1164while (<DATA>) {
1165 try_symbol($_);
ac4c12e7
GS
1166}
1167
18f68570 1168if ($PLATFORM =~ /^win(?:32|ce)$/) {
549a6b10 1169 foreach my $symbol (qw(
00b02797
JH
1170 setuid
1171 setgid
7766f137 1172 Perl_init_os_extras
c44d3fdb 1173 Perl_thread_create
7766f137 1174 Perl_win32_init
23f519f0 1175 Perl_win32_term
7766f137 1176 RunPerl
5290524f 1177 win32_async_check
7766f137
GS
1178 win32_errno
1179 win32_environ
7766f137
GS
1180 win32_abort
1181 win32_fstat
1182 win32_stat
1183 win32_pipe
1184 win32_popen
1185 win32_pclose
1186 win32_rename
1187 win32_setmode
11bb82ff 1188 win32_chsize
7766f137
GS
1189 win32_lseek
1190 win32_tell
1191 win32_dup
1192 win32_dup2
1193 win32_open
1194 win32_close
1195 win32_eof
4342f4d6 1196 win32_isatty
7766f137
GS
1197 win32_read
1198 win32_write
1199 win32_spawnvp
1200 win32_mkdir
1201 win32_rmdir
1202 win32_chdir
1203 win32_flock
1204 win32_execv
1205 win32_execvp
1206 win32_htons
1207 win32_ntohs
1208 win32_htonl
1209 win32_ntohl
1210 win32_inet_addr
1211 win32_inet_ntoa
1212 win32_socket
1213 win32_bind
1214 win32_listen
1215 win32_accept
1216 win32_connect
1217 win32_send
1218 win32_sendto
1219 win32_recv
1220 win32_recvfrom
1221 win32_shutdown
1222 win32_closesocket
1223 win32_ioctlsocket
1224 win32_setsockopt
1225 win32_getsockopt
1226 win32_getpeername
1227 win32_getsockname
1228 win32_gethostname
1229 win32_gethostbyname
1230 win32_gethostbyaddr
1231 win32_getprotobyname
1232 win32_getprotobynumber
1233 win32_getservbyname
1234 win32_getservbyport
1235 win32_select
1236 win32_endhostent
1237 win32_endnetent
1238 win32_endprotoent
1239 win32_endservent
1240 win32_getnetent
1241 win32_getnetbyname
1242 win32_getnetbyaddr
1243 win32_getprotoent
1244 win32_getservent
1245 win32_sethostent
1246 win32_setnetent
1247 win32_setprotoent
1248 win32_setservent
1249 win32_getenv
1250 win32_putenv
1251 win32_perror
7766f137
GS
1252 win32_malloc
1253 win32_calloc
1254 win32_realloc
1255 win32_free
1256 win32_sleep
1257 win32_times
1258 win32_access
1259 win32_alarm
1260 win32_chmod
1261 win32_open_osfhandle
1262 win32_get_osfhandle
1263 win32_ioctl
1264 win32_link
1265 win32_unlink
1266 win32_utime
57ab3dfe 1267 win32_gettimeofday
7766f137
GS
1268 win32_uname
1269 win32_wait
1270 win32_waitpid
1271 win32_kill
1272 win32_str_os_error
1273 win32_opendir
1274 win32_readdir
1275 win32_telldir
1276 win32_seekdir
1277 win32_rewinddir
1278 win32_closedir
1279 win32_longpath
aa2b96ec 1280 win32_ansipath
7766f137
GS
1281 win32_os_id
1282 win32_getpid
1283 win32_crypt
1284 win32_dynaload
df3728a2
JH
1285 win32_get_childenv
1286 win32_free_childenv
1287 win32_clearenv
1288 win32_get_childdir
1289 win32_free_childdir
00b02797
JH
1290 win32_stdin
1291 win32_stdout
1292 win32_stderr
1293 win32_ferror
1294 win32_feof
1295 win32_strerror
1296 win32_fprintf
1297 win32_printf
1298 win32_vfprintf
1299 win32_vprintf
1300 win32_fread
1301 win32_fwrite
1302 win32_fopen
1303 win32_fdopen
1304 win32_freopen
1305 win32_fclose
1306 win32_fputs
1307 win32_fputc
1308 win32_ungetc
1309 win32_getc
1310 win32_fileno
1311 win32_clearerr
1312 win32_fflush
1313 win32_ftell
1314 win32_fseek
1315 win32_fgetpos
1316 win32_fsetpos
1317 win32_rewind
1318 win32_tmpfile
1319 win32_setbuf
1320 win32_setvbuf
1321 win32_flushall
1322 win32_fcloseall
1323 win32_fgets
1324 win32_gets
1325 win32_fgetc
1326 win32_putc
1327 win32_puts
1328 win32_getchar
1329 win32_putchar
7766f137
GS
1330 ))
1331 {
549a6b10
JH
1332 try_symbol($symbol);
1333 }
3a00b83e
SH
1334 if ($CCTYPE eq "BORLAND") {
1335 try_symbol('_matherr');
1336 }
549a6b10 1337}
3cfae81b 1338elsif ($PLATFORM eq 'os2') {
3df97b6d 1339 my (%mapped, @missing);
7766f137
GS
1340 open MAP, 'miniperl.map' or die 'Cannot read miniperl.map';
1341 /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>;
1342 close MAP or die 'Cannot close miniperl.map';
1343
ad6971c8 1344 @missing = grep { !exists $mapped{$_} }
7766f137 1345 keys %export;
c6261f3b 1346 @missing = grep { !exists $exportperlmalloc{$_} } @missing;
7766f137 1347 delete $export{$_} foreach @missing;
3cfae81b 1348}
2986a63f
JH
1349elsif ($PLATFORM eq 'netware') {
1350foreach my $symbol (qw(
2986a63f
JH
1351 Perl_init_os_extras
1352 Perl_thread_create
1353 Perl_nw5_init
1354 RunPerl
1355 AllocStdPerl
1356 FreeStdPerl
1357 do_spawn2
1358 do_aspawn
1359 nw_uname
1360 nw_stdin
1361 nw_stdout
1362 nw_stderr
1363 nw_feof
1364 nw_ferror
1365 nw_fopen
1366 nw_fclose
1367 nw_clearerr
1368 nw_getc
1369 nw_fgets
1370 nw_fputc
1371 nw_fputs
1372 nw_fflush
1373 nw_ungetc
1374 nw_fileno
1375 nw_fdopen
1376 nw_freopen
1377 nw_fread
1378 nw_fwrite
1379 nw_setbuf
1380 nw_setvbuf
1381 nw_vfprintf
1382 nw_ftell
1383 nw_fseek
1384 nw_rewind
1385 nw_tmpfile
1386 nw_fgetpos
1387 nw_fsetpos
1388 nw_dup
1389 nw_access
1390 nw_chmod
1391 nw_chsize
1392 nw_close
1393 nw_dup2
1394 nw_flock
1395 nw_isatty
1396 nw_link
1397 nw_lseek
1398 nw_stat
1399 nw_mktemp
1400 nw_open
1401 nw_read
1402 nw_rename
1403 nw_setmode
1404 nw_unlink
1405 nw_utime
1406 nw_write
1407 nw_chdir
1408 nw_rmdir
1409 nw_closedir
1410 nw_opendir
1411 nw_readdir
1412 nw_rewinddir
1413 nw_seekdir
1414 nw_telldir
1415 nw_htonl
1416 nw_htons
1417 nw_ntohl
1418 nw_ntohs
1419 nw_accept
1420 nw_bind
1421 nw_connect
1422 nw_endhostent
1423 nw_endnetent
1424 nw_endprotoent
1425 nw_endservent
1426 nw_gethostbyaddr
1427 nw_gethostbyname
1428 nw_gethostent
1429 nw_gethostname
1430 nw_getnetbyaddr
1431 nw_getnetbyname
1432 nw_getnetent
1433 nw_getpeername
1434 nw_getprotobyname
1435 nw_getprotobynumber
1436 nw_getprotoent
1437 nw_getservbyname
1438 nw_getservbyport
1439 nw_getservent
1440 nw_getsockname
1441 nw_getsockopt
1442 nw_inet_addr
1443 nw_listen
1444 nw_socket
1445 nw_recv
1446 nw_recvfrom
1447 nw_select
1448 nw_send
1449 nw_sendto
1450 nw_sethostent
1451 nw_setnetent
1452 nw_setprotoent
1453 nw_setservent
3a0827a6 1454 nw_setsockopt
4d76e4b4 1455 nw_inet_ntoa
2986a63f
JH
1456 nw_shutdown
1457 nw_crypt
1458 nw_execvp
1459 nw_kill
1460 nw_Popen
1461 nw_Pclose
1462 nw_Pipe
1463 nw_times
1464 nw_waitpid
1465 nw_getpid
1466 nw_spawnvp
1467 nw_os_id
1468 nw_open_osfhandle
1469 nw_get_osfhandle
1470 nw_abort
1471 nw_sleep
1472 nw_wait
1473 nw_dynaload
1474 nw_strerror
1475 fnFpSetMode
1476 fnInsertHashListAddrs
1477 fnGetHashListAddrs
1478 Perl_deb
011f1a1a
JH
1479 Perl_sv_setsv
1480 Perl_sv_catsv
1481 Perl_sv_catpvn
1482 Perl_sv_2pv
f355267c
JH
1483 nw_freeenviron
1484 Remove_Thread_Ctx
2986a63f
JH
1485 ))
1486 {
1487 try_symbol($symbol);
1488 }
1489}
22239a37 1490
d2b25974
VK
1491# records of type boot_module for statically linked modules (except Dynaloader)
1492$static_ext =~ s/\//__/g;
1493$static_ext =~ s/\bDynaLoader\b//;
1494my @stat_mods = map {"boot_$_"} grep {/\S/} split /\s+/, $static_ext;
1495foreach my $symbol (@stat_mods)
1496 {
1497 try_symbol($symbol);
1498 }
1499
9fb265f7
JD
1500try_symbol("init_Win32CORE") if $static_ext =~ /\bWin32CORE\b/;
1501
549a6b10
JH
1502# Now all symbols should be defined because
1503# next we are going to output them.
1504
7766f137
GS
1505foreach my $symbol (sort keys %export) {
1506 output_symbol($symbol);
1507}
549a6b10 1508
011f1a1a 1509if ($PLATFORM eq 'os2') {
59ad941d
IZ
1510 print <<EOP;
1511 dll_perlmain=main
1933e12c
IZ
1512 fill_extLibpath
1513 dir_subst
1514 Perl_OS2_handler_install
1515
59ad941d
IZ
1516; LAST_ORDINAL=$sym_ord
1517EOP
2986a63f
JH
1518}
1519
549a6b10 1520sub emit_symbol {
7766f137 1521 my $symbol = shift;
9df9a5cd 1522 chomp($symbol);
7766f137 1523 $export{$symbol} = 1;
549a6b10
JH
1524}
1525
1526sub output_symbol {
1527 my $symbol = shift;
18f68570 1528 if ($PLATFORM =~ /^win(?:32|ce)$/) {
549a6b10 1529 $symbol = "_$symbol" if $CCTYPE eq 'BORLAND';
520c758a 1530 print "\t$symbol\n";
549a6b10
JH
1531# XXX: binary compatibility between compilers is an exercise
1532# in frustration :-(
1533# if ($CCTYPE eq "BORLAND") {
1534# # workaround Borland quirk by exporting both the straight
1535# # name and a name with leading underscore. Note the
1536# # alias *must* come after the symbol itself, if both
1537# # are to be exported. (Linker bug?)
1538# print "\t_$symbol\n";
1539# print "\t$symbol = _$symbol\n";
1540# }
1541# elsif ($CCTYPE eq 'GCC') {
1542# # Symbols have leading _ whole process is $%@"% slow
1543# # so skip aliases for now
1544# nprint "\t$symbol\n";
1545# }
1546# else {
1547# # for binary coexistence, export both the symbol and
1548# # alias with leading underscore
1549# print "\t$symbol\n";
1550# print "\t_$symbol = $symbol\n";
1551# }
7766f137
GS
1552 }
1553 elsif ($PLATFORM eq 'os2') {
52e4c282
IZ
1554 printf qq( %-31s \@%s\n),
1555 qq("$symbol"), $ordinal{$symbol} || ++$sym_ord;
78232bc0
JH
1556 printf qq( %-31s \@%s\n),
1557 qq("$exportperlmalloc{$symbol}" = "$symbol"),
1558 $ordinal{$exportperlmalloc{$symbol}} || ++$sym_ord
1559 if $exportperlmalloc and exists $exportperlmalloc{$symbol};
7766f137 1560 }
93ea32b8 1561 elsif ($PLATFORM eq 'aix' || $PLATFORM eq 'vms') {
549a6b10
JH
1562 print "$symbol\n";
1563 }
2986a63f
JH
1564 elsif ($PLATFORM eq 'netware') {
1565 print "\t$symbol,\n";
1566 }
549a6b10
JH
1567}
1568
15691;
1570__DATA__
44798d05 1571# Oddities from PerlIO
568ad336 1572PerlIO_binmode
8437356b 1573PerlIO_getpos
568ad336 1574PerlIO_init
568ad336 1575PerlIO_setpos
568ad336 1576PerlIO_sprintf
8437356b
MB
1577PerlIO_sv_dup
1578PerlIO_tmpfile
8437356b 1579PerlIO_vsprintf