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