add XS version of Sys::Hostname (from Greg Bacon
[p5sagit/p5-mst-13.2.git] / makedef.pl
CommitLineData
549a6b10 1#
2# Create the export list for perl.
3#
3cfae81b 4# Needed by WIN32 and OS/2 for creating perl.dll
5# and by AIX for creating libperl.a when -Dusershrplib is in effect.
549a6b10 6#
22c35a8c 7# reads global.sym, pp.sym, perlvars.h, intrpvar.h, thrdvar.h, config.h
3cfae81b 8# On OS/2 reads miniperl.map as well
0a753a76 9
549a6b10 10my $PLATFORM;
11my $CCTYPE;
910dfcc8 12
4cb71bb6 13my %bincompat5005 =
14 (Perl_call_argv => "perl_call_argv",
15 Perl_call_method => "perl_call_method",
16 Perl_call_pv => "perl_call_pv",
17 Perl_call_sv => "perl_call_sv",
18 Perl_get_av => "perl_get_av",
19 Perl_get_cv => "perl_get_cv",
20 Perl_get_hv => "perl_get_hv",
21 Perl_get_sv => "perl_get_sv",
22 Perl_init_i18nl10n => "perl_init_i18nl10n",
23 Perl_init_i18nl14n => "perl_init_i18nl14n",
24 Perl_new_collate => "perl_new_collate",
25 Perl_new_ctype => "perl_new_ctype",
26 Perl_new_numeric => "perl_new_numeric",
27 Perl_require_pv => "perl_require_pv",
28 Perl_safesyscalloc => "Perl_safecalloc",
29 Perl_safesysfree => "Perl_safefree",
30 Perl_safesysmalloc => "Perl_safemalloc",
31 Perl_safesysrealloc => "Perl_saferealloc",
32 Perl_set_numeric_local => "perl_set_numeric_local",
62457c2b 33 Perl_set_numeric_standard => "perl_set_numeric_standard",
34 Perl_malloc => "malloc",
35 Perl_mfree => "free",
36 Perl_realloc => "realloc",
37 Perl_calloc => "calloc",);
4cb71bb6 38
39my $bincompat5005 = join("|", keys %bincompat5005);
40
7766f137 41while (@ARGV) {
42 my $flag = shift;
43 $define{$1} = 1 if ($flag =~ /^-D(\w+)$/);
44 $define{$1} = $2 if ($flag =~ /^-D(\w+)=(.+)$/);
45 $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/);
46 $PLATFORM = $1 if ($flag =~ /^PLATFORM=(\w+)$/);
47}
d55594ae 48
3cfae81b 49my @PLATFORM = qw(aix win32 os2);
549a6b10 50my %PLATFORM;
51@PLATFORM{@PLATFORM} = ();
52
53defined $PLATFORM || die "PLATFORM undefined, must be one of: @PLATFORM\n";
54exists $PLATFORM{$PLATFORM} || die "PLATFORM must be one of: @PLATFORM\n";
55
56my $config_sh = "config.sh";
57my $config_h = "config.h";
58my $thrdvar_h = "thrdvar.h";
59my $intrpvar_h = "intrpvar.h";
60my $perlvars_h = "perlvars.h";
61my $global_sym = "global.sym";
62my $pp_sym = "pp.sym";
63my $globvar_sym = "globvar.sym";
64my $perlio_sym = "perlio.sym";
65
66if ($PLATFORM eq 'aix') {
67 # Nothing for now.
7766f137 68}
69elsif ($PLATFORM eq 'win32') {
549a6b10 70 $CCTYPE = "MSVC" unless defined $CCTYPE;
71 foreach ($thrdvar_h, $intrpvar_h, $perlvars_h, $global_sym, $pp_sym, $globvar_sym) {
72 s!^!..\\!;
73 }
74}
75
76unless ($PLATFORM eq 'win32') {
77 open(CFG,$config_sh) || die "Cannot open $config_sh: $!\n";
7766f137 78 while (<CFG>) {
549a6b10 79 if (/^(?:ccflags|optimize)='(.+)'$/) {
80 $_ = $1;
81 $define{$1} = 1 while /-D(\w+)/g;
82 }
3cfae81b 83 if ($PLATFORM eq 'os2') {
84 $CONFIG_ARGS = $1 if /^(?:config_args)='(.+)'$/;
85 $ARCHNAME = $1 if /^(?:archname)='(.+)'$/;
86 }
549a6b10 87 }
88 close(CFG);
89}
90
91open(CFG,$config_h) || die "Cannot open $config_h: $!\n";
7766f137 92while (<CFG>) {
93 $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/;
bbda9c9d 94 $define{$1} = 1 if /^\s*#\s*define\s+(USE_5005THREADS)\b/;
95 $define{$1} = 1 if /^\s*#\s*define\s+(USE_ITHREADS)\b/;
7766f137 96 $define{$1} = 1 if /^\s*#\s*define\s+(USE_PERLIO)\b/;
97 $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/;
dfdd1393 98 $define{$1} = 1 if /^\s*#\s*define\s+(PERL_IMPLICIT_SYS)\b/;
7766f137 99 $define{$1} = 1 if /^\s*#\s*define\s+(PERL_BINCOMPAT_5005)\b/;
100}
bbc8f9de 101close(CFG);
102
18c4b137 103# perl.h logic duplication begins
104
105if ($define{USE_ITHREADS}) {
106 if (!$define{MULTIPLICITY} && !defined{PERL_OBJECT}) {
107 $define{MULTIPLICITY} = 1;
108 }
109}
110
111$define{PERL_IMPLICIT_CONTEXT} ||=
112 $define{USE_ITHREADS} ||
113 $define{USE_THREADS} ||
114 $define{MULTIPLICITY} ;
115
116if ($define{PERL_CAPI}) {
117 delete $define{PERL_OBJECT};
118 $define{MULTIPLICITY} = 1;
119 $define{PERL_IMPLICIT_CONTEXT} = 1;
120 $define{PERL_IMPLICIT_SYS} = 1;
121}
122
123if ($define{PERL_OBJECT}) {
124 $define{PERL_IMPLICIT_CONTEXT} = 1;
125 $define{PERL_IMPLICIT_SYS} = 1;
126}
127
128# perl.h logic duplication ends
129
549a6b10 130if ($PLATFORM eq 'win32') {
131 warn join(' ',keys %define)."\n";
dfdd1393 132 print "LIBRARY Perl56\n";
133 print "DESCRIPTION 'Perl interpreter'\n";
134 print "EXPORTS\n";
135 if ($define{PERL_IMPLICIT_SYS}) {
549a6b10 136 output_symbol("perl_get_host_info");
7766f137 137 output_symbol("perl_alloc_override");
51371543 138 }
7766f137 139}
140elsif ($PLATFORM eq 'os2') {
3cfae81b 141 ($v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/;
142 $v .= '-thread' if $ARCHNAME =~ /-thread/;
143 #$sum = 0;
144 #for (split //, $v) {
145 # $sum = ($sum * 33) + ord;
146 # $sum &= 0xffffff;
147 #}
148 #$sum += $sum >> 5;
149 #$sum &= 0xffff;
150 #$sum = printf '%X', $sum;
151 ($dll = $define{PERL_DLL}) =~ s/\.dll$//i;
152 # print STDERR "'$dll' <= '$define{PERL_DLL}'\n";
153 print <<"---EOP---";
154LIBRARY '$dll' INITINSTANCE TERMINSTANCE
155DESCRIPTION '\@#perl5-porters\@perl.org:$v#\@ Perl interpreter, configured as $CONFIG_ARGS'
156STACKSIZE 32768
157CODE LOADONCALL
158DATA LOADONCALL NONSHARED MULTIPLE
159EXPORTS
160---EOP---
7766f137 161}
162elsif ($PLATFORM eq 'aix') {
549a6b10 163 print "#!\n";
ac4c12e7 164}
bbc8f9de 165
22239a37 166my %skip;
167my %export;
168
51371543 169sub skip_symbols {
170 my $list = shift;
171 foreach my $symbol (@$list) {
172 $skip{$symbol} = 1;
173 }
22239a37 174}
175
51371543 176sub emit_symbols {
177 my $list = shift;
178 foreach my $symbol (@$list) {
179 my $skipsym = $symbol;
180 # XXX hack
6f4183fe 181 if ($define{PERL_OBJECT} || $define{MULTIPLICITY}) {
51371543 182 $skipsym =~ s/^Perl_[GIT](\w+)_ptr$/PL_$1/;
183 }
184 emit_symbol($symbol) unless exists $skip{$skipsym};
185 }
22239a37 186}
187
549a6b10 188if ($PLATFORM eq 'win32') {
7766f137 189 skip_symbols [qw(
190 PL_statusvalue_vms
191 PL_archpat_auto
192 PL_cryptseen
193 PL_DBcv
194 PL_generation
195 PL_lastgotoprobe
196 PL_linestart
197 PL_modcount
198 PL_pending_ident
199 PL_sortcxix
200 PL_sublex_info
201 PL_timesbuf
202 main
203 Perl_ErrorNo
204 Perl_GetVars
205 Perl_do_exec3
206 Perl_do_ipcctl
207 Perl_do_ipcget
208 Perl_do_msgrcv
209 Perl_do_msgsnd
210 Perl_do_semop
211 Perl_do_shmio
212 Perl_dump_fds
213 Perl_init_thread_intern
214 Perl_my_bzero
215 Perl_my_htonl
216 Perl_my_ntohl
217 Perl_my_swap
218 Perl_my_chsize
219 Perl_same_dirent
220 Perl_setenv_getix
221 Perl_unlnk
222 Perl_watch
223 Perl_safexcalloc
224 Perl_safexmalloc
225 Perl_safexfree
226 Perl_safexrealloc
227 Perl_my_memcmp
228 Perl_my_memset
229 PL_cshlen
230 PL_cshname
231 PL_opsave
232 Perl_do_exec
233 Perl_getenv_len
234 Perl_my_pclose
235 Perl_my_popen
236 )];
237}
238elsif ($PLATFORM eq 'aix') {
549a6b10 239 skip_symbols([qw(
7766f137 240 Perl_dump_fds
241 Perl_ErrorNo
242 Perl_GetVars
243 Perl_my_bcopy
244 Perl_my_bzero
245 Perl_my_chsize
246 Perl_my_htonl
247 Perl_my_memcmp
248 Perl_my_memset
249 Perl_my_ntohl
250 Perl_my_swap
251 Perl_safexcalloc
252 Perl_safexfree
253 Perl_safexmalloc
254 Perl_safexrealloc
255 Perl_same_dirent
256 Perl_unlnk
95151ede 257 Perl_sys_intern_dup
7766f137 258 PL_cryptseen
259 PL_opsave
260 PL_statusvalue_vms
261 PL_sys_intern
262 )]);
263}
264elsif ($PLATFORM eq 'os2') {
3cfae81b 265 emit_symbols([qw(
7766f137 266 ctermid
267 get_sysinfo
268 Perl_OS2_init
269 OS2_Perl_data
270 dlopen
271 dlsym
272 dlerror
273 my_tmpfile
274 my_tmpnam
275 my_flock
276 malloc_mutex
277 threads_mutex
278 nthreads
279 nthreads_cond
280 os2_cond_wait
281 os2_stat
282 pthread_join
283 pthread_create
284 pthread_detach
285 XS_Cwd_change_drive
286 XS_Cwd_current_drive
287 XS_Cwd_extLibpath
288 XS_Cwd_extLibpath_set
289 XS_Cwd_sys_abspath
290 XS_Cwd_sys_chdir
291 XS_Cwd_sys_cwd
292 XS_Cwd_sys_is_absolute
293 XS_Cwd_sys_is_relative
294 XS_Cwd_sys_is_rooted
295 XS_DynaLoader_mod2fname
296 XS_File__Copy_syscopy
297 Perl_Register_MQ
298 Perl_Deregister_MQ
299 Perl_Serve_Messages
300 Perl_Process_Messages
301 init_PMWIN_entries
302 PMWIN_entries
303 Perl_hab_GET
304 )]);
3cfae81b 305}
306
7766f137 307unless ($define{'DEBUGGING'}) {
308 skip_symbols [qw(
309 Perl_deb
310 Perl_deb_growlevel
311 Perl_debop
312 Perl_debprofdump
313 Perl_debstack
314 Perl_debstackptrs
315 Perl_runops_debug
316 Perl_sv_peek
317 PL_block_type
318 PL_watchaddr
319 PL_watchok
320 )];
321}
322
323if ($define{'PERL_IMPLICIT_SYS'}) {
324 skip_symbols [qw(
325 Perl_getenv_len
326 Perl_my_popen
327 Perl_my_pclose
328 )];
329}
330else {
331 skip_symbols [qw(
332 PL_Mem
333 PL_MemShared
334 PL_MemParse
335 PL_Env
336 PL_StdIO
337 PL_LIO
338 PL_Dir
339 PL_Sock
340 PL_Proc
341 )];
342}
343
344if ($define{'MYMALLOC'}) {
345 emit_symbols [qw(
346 Perl_dump_mstats
827e134a 347 Perl_get_mstats
7766f137 348 Perl_malloc
349 Perl_mfree
350 Perl_realloc
351 Perl_calloc
352 )];
bbda9c9d 353 if ($define{'USE_5005THREADS'} || $define{'USE_ITHREADS'}) {
1feb2720 354 emit_symbols [qw(
355 PL_malloc_mutex
356 )];
357 }
51371543 358}
359else {
7766f137 360 skip_symbols [qw(
361 PL_malloc_mutex
362 Perl_dump_mstats
363 Perl_malloc
364 Perl_mfree
365 Perl_realloc
366 Perl_calloc
367 Perl_malloced_size
368 )];
369}
370
bbda9c9d 371unless ($define{'USE_5005THREADS'}) {
7766f137 372 skip_symbols [qw(
373 PL_thr_key
374 PL_sv_mutex
375 PL_strtab_mutex
376 PL_svref_mutex
7766f137 377 PL_cred_mutex
378 PL_eval_mutex
379 PL_eval_cond
380 PL_eval_owner
381 PL_threads_mutex
382 PL_nthreads
383 PL_nthreads_cond
384 PL_threadnum
385 PL_threadsv_names
386 PL_thrsv
387 PL_vtbl_mutex
388 Perl_getTHR
389 Perl_setTHR
390 Perl_condpair_magic
391 Perl_new_struct_thread
392 Perl_per_thread_magicals
393 Perl_thread_create
394 Perl_find_threadsv
395 Perl_unlock_condpair
396 Perl_magic_mutexfree
397 )];
398}
399
400unless ($define{'USE_ITHREADS'}) {
401 skip_symbols [qw(
402 PL_ptr_table
403 Perl_dirp_dup
404 Perl_cx_dup
405 Perl_si_dup
406 Perl_any_dup
407 Perl_ss_dup
408 Perl_fp_dup
409 Perl_gp_dup
410 Perl_he_dup
411 Perl_mg_dup
412 Perl_re_dup
413 Perl_sv_dup
414 Perl_sys_intern_dup
415 Perl_ptr_table_fetch
416 Perl_ptr_table_new
417 Perl_ptr_table_split
418 Perl_ptr_table_store
419 perl_clone
420 perl_clone_using
421 )];
422}
423
424unless ($define{'PERL_IMPLICIT_CONTEXT'}) {
425 skip_symbols [qw(
426 Perl_croak_nocontext
427 Perl_die_nocontext
428 Perl_deb_nocontext
429 Perl_form_nocontext
430 Perl_mess_nocontext
431 Perl_warn_nocontext
432 Perl_warner_nocontext
433 Perl_newSVpvf_nocontext
434 Perl_sv_catpvf_nocontext
435 Perl_sv_setpvf_nocontext
436 Perl_sv_catpvf_mg_nocontext
437 Perl_sv_setpvf_mg_nocontext
438 )];
439}
440
441unless ($define{'PERL_IMPLICIT_SYS'}) {
442 skip_symbols [qw(
443 perl_alloc_using
014822e4 444 perl_clone_using
7766f137 445 )];
446}
447
448unless ($define{'FAKE_THREADS'}) {
449 skip_symbols [qw(PL_curthr)];
450}
451
452sub readvar {
453 my $file = shift;
454 my $proc = shift || sub { "PL_$_[2]" };
455 open(VARS,$file) || die "Cannot open $file: $!\n";
456 my @syms;
457 while (<VARS>) {
458 # All symbols have a Perl_ prefix because that's what embed.h
459 # sticks in front of them.
460 push(@syms, &$proc($1,$2,$3)) if (/\bPERLVAR(A?I?C?)\(([IGT])(\w+)/);
461 }
462 close(VARS);
463 return \@syms;
464}
465
6f4183fe 466if ($define{'USE_5005THREADS'}) {
7766f137 467 my $thrd = readvar($thrdvar_h);
468 skip_symbols $thrd;
469}
470
7766f137 471if ($define{'PERL_GLOBAL_STRUCT'}) {
472 my $global = readvar($perlvars_h);
473 skip_symbols $global;
474 emit_symbol('Perl_GetVars');
475 emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
476}
36c15d3f 477
22c35a8c 478# functions from *.sym files
479
954c1994 480my @syms = ($global_sym, $globvar_sym); # $pp_sym is not part of the API
549a6b10 481
7766f137 482if ($define{'USE_PERLIO'}) {
549a6b10 483 push @syms, $perlio_sym;
7766f137 484}
485
486for my $syms (@syms) {
487 open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n";
488 while (<GLOBAL>) {
489 next if (!/^[A-Za-z]/);
490 # Functions have a Perl_ prefix
491 # Variables have a PL_ prefix
492 chomp($_);
493 my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : "");
494 $symbol .= $_;
495 emit_symbol($symbol) unless exists $skip{$symbol};
496 }
497 close(GLOBAL);
498}
0a753a76 499
22c35a8c 500# variables
0a753a76 501
6f4183fe 502if ($define{'PERL_OBJECT'} || $define{'MULTIPLICITY'}) {
1acb48c9 503 for my $f ($perlvars_h, $intrpvar_h, $thrdvar_h) {
18c4b137 504 my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" });
505 emit_symbols $glob;
18c4b137 506 }
1acb48c9 507 # XXX AIX seems to want the perlvars.h symbols, for some reason
508 if ($PLATFORM eq 'aix') {
509 my $glob = readvar($perlvars_h);
51371543 510 emit_symbols $glob;
511 }
512}
513else {
514 unless ($define{'PERL_GLOBAL_STRUCT'}) {
549a6b10 515 my $glob = readvar($perlvars_h);
51371543 516 emit_symbols $glob;
517 }
518 unless ($define{'MULTIPLICITY'}) {
549a6b10 519 my $glob = readvar($intrpvar_h);
51371543 520 emit_symbols $glob;
521 }
bbda9c9d 522 unless ($define{'MULTIPLICITY'} || $define{'USE_5005THREADS'}) {
549a6b10 523 my $glob = readvar($thrdvar_h);
51371543 524 emit_symbols $glob;
525 }
526}
0a753a76 527
549a6b10 528sub try_symbol {
529 my $symbol = shift;
22239a37 530
549a6b10 531 return if $symbol !~ /^[A-Za-z]/;
532 return if $symbol =~ /^\#/;
533 $symbol =~s/\r//g;
534 chomp($symbol);
43cd9f80 535 return if exists $skip{$symbol};
549a6b10 536 emit_symbol($symbol);
3e3baf6d 537}
0a753a76 538
549a6b10 539while (<DATA>) {
540 try_symbol($_);
ac4c12e7 541}
542
549a6b10 543if ($PLATFORM eq 'win32') {
544 foreach my $symbol (qw(
7766f137 545 boot_DynaLoader
546 Perl_getTHR
547 Perl_init_os_extras
548 Perl_setTHR
549 Perl_thread_create
550 Perl_win32_init
551 RunPerl
552 GetPerlInterpreter
553 SetPerlInterpreter
554 win32_errno
555 win32_environ
556 win32_stdin
557 win32_stdout
558 win32_stderr
559 win32_ferror
560 win32_feof
561 win32_strerror
562 win32_fprintf
563 win32_printf
564 win32_vfprintf
565 win32_vprintf
566 win32_fread
567 win32_fwrite
568 win32_fopen
569 win32_fdopen
570 win32_freopen
571 win32_fclose
572 win32_fputs
573 win32_fputc
574 win32_ungetc
575 win32_getc
576 win32_fileno
577 win32_clearerr
578 win32_fflush
579 win32_ftell
580 win32_fseek
581 win32_fgetpos
582 win32_fsetpos
583 win32_rewind
584 win32_tmpfile
585 win32_abort
586 win32_fstat
587 win32_stat
588 win32_pipe
589 win32_popen
590 win32_pclose
591 win32_rename
592 win32_setmode
593 win32_lseek
594 win32_tell
595 win32_dup
596 win32_dup2
597 win32_open
598 win32_close
599 win32_eof
600 win32_read
601 win32_write
602 win32_spawnvp
603 win32_mkdir
604 win32_rmdir
605 win32_chdir
606 win32_flock
607 win32_execv
608 win32_execvp
609 win32_htons
610 win32_ntohs
611 win32_htonl
612 win32_ntohl
613 win32_inet_addr
614 win32_inet_ntoa
615 win32_socket
616 win32_bind
617 win32_listen
618 win32_accept
619 win32_connect
620 win32_send
621 win32_sendto
622 win32_recv
623 win32_recvfrom
624 win32_shutdown
625 win32_closesocket
626 win32_ioctlsocket
627 win32_setsockopt
628 win32_getsockopt
629 win32_getpeername
630 win32_getsockname
631 win32_gethostname
632 win32_gethostbyname
633 win32_gethostbyaddr
634 win32_getprotobyname
635 win32_getprotobynumber
636 win32_getservbyname
637 win32_getservbyport
638 win32_select
639 win32_endhostent
640 win32_endnetent
641 win32_endprotoent
642 win32_endservent
643 win32_getnetent
644 win32_getnetbyname
645 win32_getnetbyaddr
646 win32_getprotoent
647 win32_getservent
648 win32_sethostent
649 win32_setnetent
650 win32_setprotoent
651 win32_setservent
652 win32_getenv
653 win32_putenv
654 win32_perror
655 win32_setbuf
656 win32_setvbuf
657 win32_flushall
658 win32_fcloseall
659 win32_fgets
660 win32_gets
661 win32_fgetc
662 win32_putc
663 win32_puts
664 win32_getchar
665 win32_putchar
666 win32_malloc
667 win32_calloc
668 win32_realloc
669 win32_free
670 win32_sleep
671 win32_times
672 win32_access
673 win32_alarm
674 win32_chmod
675 win32_open_osfhandle
676 win32_get_osfhandle
677 win32_ioctl
678 win32_link
679 win32_unlink
680 win32_utime
681 win32_uname
682 win32_wait
683 win32_waitpid
684 win32_kill
685 win32_str_os_error
686 win32_opendir
687 win32_readdir
688 win32_telldir
689 win32_seekdir
690 win32_rewinddir
691 win32_closedir
692 win32_longpath
693 win32_os_id
694 win32_getpid
695 win32_crypt
696 win32_dynaload
697 ))
698 {
549a6b10 699 try_symbol($symbol);
700 }
701}
3cfae81b 702elsif ($PLATFORM eq 'os2') {
7766f137 703 open MAP, 'miniperl.map' or die 'Cannot read miniperl.map';
704 /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>;
705 close MAP or die 'Cannot close miniperl.map';
706
707 @missing = grep { !exists $mapped{$_} and !exists $bincompat5005{$_} }
708 keys %export;
709 delete $export{$_} foreach @missing;
3cfae81b 710}
22239a37 711
549a6b10 712# Now all symbols should be defined because
713# next we are going to output them.
714
7766f137 715foreach my $symbol (sort keys %export) {
716 output_symbol($symbol);
717}
549a6b10 718
719sub emit_symbol {
7766f137 720 my $symbol = shift;
721 chomp($symbol);
722 $export{$symbol} = 1;
549a6b10 723}
724
725sub output_symbol {
726 my $symbol = shift;
4cb71bb6 727 $symbol = $bincompat5005{$symbol}
728 if $define{PERL_BINCOMPAT_5005} and $symbol =~ /^($bincompat5005)$/;
549a6b10 729 if ($PLATFORM eq 'win32') {
549a6b10 730 $symbol = "_$symbol" if $CCTYPE eq 'BORLAND';
520c758a 731 print "\t$symbol\n";
549a6b10 732# XXX: binary compatibility between compilers is an exercise
733# in frustration :-(
734# if ($CCTYPE eq "BORLAND") {
735# # workaround Borland quirk by exporting both the straight
736# # name and a name with leading underscore. Note the
737# # alias *must* come after the symbol itself, if both
738# # are to be exported. (Linker bug?)
739# print "\t_$symbol\n";
740# print "\t$symbol = _$symbol\n";
741# }
742# elsif ($CCTYPE eq 'GCC') {
743# # Symbols have leading _ whole process is $%@"% slow
744# # so skip aliases for now
745# nprint "\t$symbol\n";
746# }
747# else {
748# # for binary coexistence, export both the symbol and
749# # alias with leading underscore
750# print "\t$symbol\n";
751# print "\t_$symbol = $symbol\n";
752# }
7766f137 753 }
754 elsif ($PLATFORM eq 'os2') {
3cfae81b 755 print qq( "$symbol"\n);
7766f137 756 }
757 elsif ($PLATFORM eq 'aix') {
549a6b10 758 print "$symbol\n";
759 }
760}
761
7621;
763__DATA__
764# extra globals not included above.
765perl_alloc
7766f137 766perl_alloc_using
014822e4 767perl_clone
768perl_clone_using
549a6b10 769perl_construct
770perl_destruct
771perl_free
772perl_parse
773perl_run