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