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