This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add PL_thr_key to export list under useithreads
[perl5.git] / makedef.pl
1 #
2 # Create the export list for perl.
3 #
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 #
7 # reads global.sym, pp.sym, perlvars.h, intrpvar.h, thrdvar.h, config.h
8 # On OS/2 reads miniperl.map as well
9
10 my $PLATFORM;
11 my $CCTYPE;
12
13 my %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",
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",);
38
39 my $bincompat5005 = join("|", keys %bincompat5005);
40
41 while (@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 }
48
49 my @PLATFORM = qw(aix win32 os2);
50 my %PLATFORM;
51 @PLATFORM{@PLATFORM} = ();
52
53 defined $PLATFORM || die "PLATFORM undefined, must be one of: @PLATFORM\n";
54 exists $PLATFORM{$PLATFORM} || die "PLATFORM must be one of: @PLATFORM\n"; 
55
56 my $config_sh   = "config.sh";
57 my $config_h    = "config.h";
58 my $thrdvar_h   = "thrdvar.h";
59 my $intrpvar_h  = "intrpvar.h";
60 my $perlvars_h  = "perlvars.h";
61 my $global_sym  = "global.sym";
62 my $pp_sym      = "pp.sym";
63 my $globvar_sym = "globvar.sym";
64 my $perlio_sym  = "perlio.sym";
65
66 if ($PLATFORM eq 'aix') { 
67     # Nothing for now.
68 }
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
76 unless ($PLATFORM eq 'win32') {
77     open(CFG,$config_sh) || die "Cannot open $config_sh: $!\n";
78     while (<CFG>) {
79         if (/^(?:ccflags|optimize)='(.+)'$/) {
80             $_ = $1;
81             $define{$1} = 1 while /-D(\w+)/g;
82         }
83         if ($PLATFORM eq 'os2') {
84             $CONFIG_ARGS = $1 if /^(?:config_args)='(.+)'$/;
85             $ARCHNAME = $1 if /^(?:archname)='(.+)'$/;
86         }
87     }
88     close(CFG);
89 }
90
91 open(CFG,$config_h) || die "Cannot open $config_h: $!\n";
92 while (<CFG>) {
93     $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/;
94     $define{$1} = 1 if /^\s*#\s*define\s+(USE_5005THREADS)\b/;
95     $define{$1} = 1 if /^\s*#\s*define\s+(USE_ITHREADS)\b/;
96     $define{$1} = 1 if /^\s*#\s*define\s+(USE_PERLIO)\b/;
97     $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/;
98     $define{$1} = 1 if /^\s*#\s*define\s+(PERL_IMPLICIT_SYS)\b/;
99     $define{$1} = 1 if /^\s*#\s*define\s+(PERL_BINCOMPAT_5005)\b/;
100 }
101 close(CFG);
102
103 # perl.h logic duplication begins
104
105 if ($define{USE_ITHREADS}) {
106     if (!$define{MULTIPLICITY} && !$define{PERL_OBJECT}) {
107         $define{MULTIPLICITY} = 1;
108     }
109 }
110
111 $define{PERL_IMPLICIT_CONTEXT} ||=
112     $define{USE_ITHREADS} ||
113     $define{USE_5005THREADS}  ||
114     $define{MULTIPLICITY} ;
115
116 if ($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
123 if ($define{PERL_OBJECT}) {
124     $define{PERL_IMPLICIT_CONTEXT} = 1;
125     $define{PERL_IMPLICIT_SYS}     = 1;
126 }
127
128 # perl.h logic duplication ends
129
130 if ($PLATFORM eq 'win32') {
131     warn join(' ',keys %define)."\n";
132     print "LIBRARY Perl56\n";
133     print "DESCRIPTION 'Perl interpreter'\n";
134     print "EXPORTS\n";
135     if ($define{PERL_IMPLICIT_SYS}) {
136         output_symbol("perl_get_host_info");
137         output_symbol("perl_alloc_override");
138     }
139 }
140 elsif ($PLATFORM eq 'os2') {
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---";
154 LIBRARY '$dll' INITINSTANCE TERMINSTANCE
155 DESCRIPTION '\@#perl5-porters\@perl.org:$v#\@ Perl interpreter, configured as $CONFIG_ARGS'
156 STACKSIZE 32768
157 CODE LOADONCALL
158 DATA LOADONCALL NONSHARED MULTIPLE
159 EXPORTS
160 ---EOP---
161 }
162 elsif ($PLATFORM eq 'aix') {
163     print "#!\n";
164 }
165
166 my %skip;
167 my %export;
168
169 sub skip_symbols {
170     my $list = shift;
171     foreach my $symbol (@$list) {
172         $skip{$symbol} = 1;
173     }
174 }
175
176 sub emit_symbols {
177     my $list = shift;
178     foreach my $symbol (@$list) {
179         my $skipsym = $symbol;
180         # XXX hack
181         if ($define{PERL_OBJECT} || $define{MULTIPLICITY}) {
182             $skipsym =~ s/^Perl_[GIT](\w+)_ptr$/PL_$1/;
183         }
184         emit_symbol($symbol) unless exists $skip{$skipsym};
185     }
186 }
187
188 if ($PLATFORM eq 'win32') {
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 }
238 elsif ($PLATFORM eq 'aix') {
239     skip_symbols([qw(
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
257                      Perl_sys_intern_dup
258                      PL_cryptseen
259                      PL_opsave
260                      PL_statusvalue_vms
261                      PL_sys_intern
262                      )]);
263 }
264 elsif ($PLATFORM eq 'os2') {
265     emit_symbols([qw(
266                     ctermid
267                     get_sysinfo
268                     Perl_OS2_init
269                     OS2_Perl_data
270                     dlopen
271                     dlsym
272                     dlerror
273                     dlclose
274                     my_tmpfile
275                     my_tmpnam
276                     my_flock
277                     malloc_mutex
278                     threads_mutex
279                     nthreads
280                     nthreads_cond
281                     os2_cond_wait
282                     os2_stat
283                     pthread_join
284                     pthread_create
285                     pthread_detach
286                     XS_Cwd_change_drive
287                     XS_Cwd_current_drive
288                     XS_Cwd_extLibpath
289                     XS_Cwd_extLibpath_set
290                     XS_Cwd_sys_abspath
291                     XS_Cwd_sys_chdir
292                     XS_Cwd_sys_cwd
293                     XS_Cwd_sys_is_absolute
294                     XS_Cwd_sys_is_relative
295                     XS_Cwd_sys_is_rooted
296                     XS_DynaLoader_mod2fname
297                     XS_File__Copy_syscopy
298                     Perl_Register_MQ
299                     Perl_Deregister_MQ
300                     Perl_Serve_Messages
301                     Perl_Process_Messages
302                     init_PMWIN_entries
303                     PMWIN_entries
304                     Perl_hab_GET
305                     )]);
306 }
307
308 unless ($define{'DEBUGGING'}) {
309     skip_symbols [qw(
310                     Perl_deb
311                     Perl_deb_growlevel
312                     Perl_debop
313                     Perl_debprofdump
314                     Perl_debstack
315                     Perl_debstackptrs
316                     Perl_runops_debug
317                     Perl_sv_peek
318                     PL_block_type
319                     PL_watchaddr
320                     PL_watchok
321                     )];
322 }
323
324 if ($define{'PERL_IMPLICIT_SYS'}) {
325     skip_symbols [qw(
326                     Perl_getenv_len
327                     Perl_my_popen
328                     Perl_my_pclose
329                     )];
330 }
331 else {
332     skip_symbols [qw(
333                     PL_Mem
334                     PL_MemShared
335                     PL_MemParse
336                     PL_Env
337                     PL_StdIO
338                     PL_LIO
339                     PL_Dir
340                     PL_Sock
341                     PL_Proc
342                     )];
343 }
344
345 unless ($define{'PERL_FLEXIBLE_EXCEPTIONS'}) {
346     skip_symbols [qw(
347                     PL_protect
348                     Perl_default_protect
349                     Perl_vdefault_protect
350                     )];
351 }
352
353 if ($define{'MYMALLOC'}) {
354     emit_symbols [qw(
355                     Perl_dump_mstats
356                     Perl_get_mstats
357                     Perl_malloc
358                     Perl_mfree
359                     Perl_realloc
360                     Perl_calloc
361                     )];
362     if ($define{'USE_5005THREADS'} || $define{'USE_ITHREADS'}) {
363         emit_symbols [qw(
364                         PL_malloc_mutex
365                         )];
366     }
367     else {
368         skip_symbols [qw(
369                         PL_malloc_mutex
370                         )];
371     }
372 }
373 else {
374     skip_symbols [qw(
375                     PL_malloc_mutex
376                     Perl_dump_mstats
377                     Perl_get_mstats
378                     Perl_malloc
379                     Perl_mfree
380                     Perl_realloc
381                     Perl_calloc
382                     Perl_malloced_size
383                     )];
384 }
385
386 unless ($define{'USE_5005THREADS'} || $define{'USE_ITHREADS'}) {
387     skip_symbols [qw(
388                     PL_thr_key
389                     )];
390 }
391
392 unless ($define{'USE_5005THREADS'}) {
393     skip_symbols [qw(
394                     PL_sv_mutex
395                     PL_strtab_mutex
396                     PL_svref_mutex
397                     PL_cred_mutex
398                     PL_eval_mutex
399                     PL_eval_cond
400                     PL_eval_owner
401                     PL_threads_mutex
402                     PL_nthreads
403                     PL_nthreads_cond
404                     PL_threadnum
405                     PL_threadsv_names
406                     PL_thrsv
407                     PL_vtbl_mutex
408                     Perl_condpair_magic
409                     Perl_new_struct_thread
410                     Perl_per_thread_magicals
411                     Perl_thread_create
412                     Perl_find_threadsv
413                     Perl_unlock_condpair
414                     Perl_magic_mutexfree
415                     )];
416 }
417
418 unless ($define{'USE_ITHREADS'}) {
419     skip_symbols [qw(
420                     PL_ptr_table
421                     PL_op_mutex
422                     Perl_dirp_dup
423                     Perl_cx_dup
424                     Perl_si_dup
425                     Perl_any_dup
426                     Perl_ss_dup
427                     Perl_fp_dup
428                     Perl_gp_dup
429                     Perl_he_dup
430                     Perl_mg_dup
431                     Perl_re_dup
432                     Perl_sv_dup
433                     Perl_sys_intern_dup
434                     Perl_ptr_table_fetch
435                     Perl_ptr_table_new
436                     Perl_ptr_table_split
437                     Perl_ptr_table_store
438                     perl_clone
439                     perl_clone_using
440                     )];
441 }
442
443 unless ($define{'PERL_IMPLICIT_CONTEXT'}) {
444     skip_symbols [qw(
445                     Perl_croak_nocontext
446                     Perl_die_nocontext
447                     Perl_deb_nocontext
448                     Perl_form_nocontext
449                     Perl_load_module_nocontext
450                     Perl_mess_nocontext
451                     Perl_warn_nocontext
452                     Perl_warner_nocontext
453                     Perl_newSVpvf_nocontext
454                     Perl_sv_catpvf_nocontext
455                     Perl_sv_setpvf_nocontext
456                     Perl_sv_catpvf_mg_nocontext
457                     Perl_sv_setpvf_mg_nocontext
458                     )];
459 }
460
461 unless ($define{'PERL_IMPLICIT_SYS'}) {
462     skip_symbols [qw(
463                     perl_alloc_using
464                     perl_clone_using
465                     )];
466 }
467
468 unless ($define{'FAKE_THREADS'}) {
469     skip_symbols [qw(PL_curthr)];
470 }
471
472 sub readvar {
473     my $file = shift;
474     my $proc = shift || sub { "PL_$_[2]" };
475     open(VARS,$file) || die "Cannot open $file: $!\n";
476     my @syms;
477     while (<VARS>) {
478         # All symbols have a Perl_ prefix because that's what embed.h
479         # sticks in front of them.
480         push(@syms, &$proc($1,$2,$3)) if (/\bPERLVAR(A?I?C?)\(([IGT])(\w+)/);
481     } 
482     close(VARS); 
483     return \@syms;
484 }
485
486 if ($define{'USE_5005THREADS'}) {
487     my $thrd = readvar($thrdvar_h);
488     skip_symbols $thrd;
489 }
490
491 if ($define{'PERL_GLOBAL_STRUCT'}) {
492     my $global = readvar($perlvars_h);
493     skip_symbols $global;
494     emit_symbol('Perl_GetVars');
495     emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
496 }
497
498 # functions from *.sym files
499
500 my @syms = ($global_sym, $globvar_sym); # $pp_sym is not part of the API
501
502 if ($define{'USE_PERLIO'}) {
503      push @syms, $perlio_sym;
504 }
505
506 for my $syms (@syms) {
507     open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n";
508     while (<GLOBAL>) {
509         next if (!/^[A-Za-z]/);
510         # Functions have a Perl_ prefix
511         # Variables have a PL_ prefix
512         chomp($_);
513         my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : "");
514         $symbol .= $_;
515         emit_symbol($symbol) unless exists $skip{$symbol};
516     }
517     close(GLOBAL);
518 }
519
520 # variables
521
522 if ($define{'PERL_OBJECT'} || $define{'MULTIPLICITY'}) {
523     for my $f ($perlvars_h, $intrpvar_h, $thrdvar_h) {
524         my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" });
525         emit_symbols $glob;
526     }
527     # XXX AIX seems to want the perlvars.h symbols, for some reason
528     if ($PLATFORM eq 'aix') {
529         my $glob = readvar($perlvars_h);
530         emit_symbols $glob;
531     }
532 }
533 else {
534     unless ($define{'PERL_GLOBAL_STRUCT'}) {
535         my $glob = readvar($perlvars_h);
536         emit_symbols $glob;
537     } 
538     unless ($define{'MULTIPLICITY'}) {
539         my $glob = readvar($intrpvar_h);
540         emit_symbols $glob;
541     } 
542     unless ($define{'MULTIPLICITY'} || $define{'USE_5005THREADS'}) {
543         my $glob = readvar($thrdvar_h);
544         emit_symbols $glob;
545     } 
546 }
547
548 sub try_symbol {
549     my $symbol = shift;
550
551     return if $symbol !~ /^[A-Za-z]/;
552     return if $symbol =~ /^\#/;
553     $symbol =~s/\r//g;
554     chomp($symbol);
555     return if exists $skip{$symbol};
556     emit_symbol($symbol);
557 }
558
559 while (<DATA>) {
560     try_symbol($_);
561 }
562
563 if ($PLATFORM eq 'win32') {
564     foreach my $symbol (qw(
565                             boot_DynaLoader
566                             Perl_init_os_extras
567                             Perl_thread_create
568                             Perl_win32_init
569                             RunPerl
570                             win32_errno
571                             win32_environ
572                             win32_stdin
573                             win32_stdout
574                             win32_stderr
575                             win32_ferror
576                             win32_feof
577                             win32_strerror
578                             win32_fprintf
579                             win32_printf
580                             win32_vfprintf
581                             win32_vprintf
582                             win32_fread
583                             win32_fwrite
584                             win32_fopen
585                             win32_fdopen
586                             win32_freopen
587                             win32_fclose
588                             win32_fputs
589                             win32_fputc
590                             win32_ungetc
591                             win32_getc
592                             win32_fileno
593                             win32_clearerr
594                             win32_fflush
595                             win32_ftell
596                             win32_fseek
597                             win32_fgetpos
598                             win32_fsetpos
599                             win32_rewind
600                             win32_tmpfile
601                             win32_abort
602                             win32_fstat
603                             win32_stat
604                             win32_pipe
605                             win32_popen
606                             win32_pclose
607                             win32_rename
608                             win32_setmode
609                             win32_lseek
610                             win32_tell
611                             win32_dup
612                             win32_dup2
613                             win32_open
614                             win32_close
615                             win32_eof
616                             win32_read
617                             win32_write
618                             win32_spawnvp
619                             win32_mkdir
620                             win32_rmdir
621                             win32_chdir
622                             win32_flock
623                             win32_execv
624                             win32_execvp
625                             win32_htons
626                             win32_ntohs
627                             win32_htonl
628                             win32_ntohl
629                             win32_inet_addr
630                             win32_inet_ntoa
631                             win32_socket
632                             win32_bind
633                             win32_listen
634                             win32_accept
635                             win32_connect
636                             win32_send
637                             win32_sendto
638                             win32_recv
639                             win32_recvfrom
640                             win32_shutdown
641                             win32_closesocket
642                             win32_ioctlsocket
643                             win32_setsockopt
644                             win32_getsockopt
645                             win32_getpeername
646                             win32_getsockname
647                             win32_gethostname
648                             win32_gethostbyname
649                             win32_gethostbyaddr
650                             win32_getprotobyname
651                             win32_getprotobynumber
652                             win32_getservbyname
653                             win32_getservbyport
654                             win32_select
655                             win32_endhostent
656                             win32_endnetent
657                             win32_endprotoent
658                             win32_endservent
659                             win32_getnetent
660                             win32_getnetbyname
661                             win32_getnetbyaddr
662                             win32_getprotoent
663                             win32_getservent
664                             win32_sethostent
665                             win32_setnetent
666                             win32_setprotoent
667                             win32_setservent
668                             win32_getenv
669                             win32_putenv
670                             win32_perror
671                             win32_setbuf
672                             win32_setvbuf
673                             win32_flushall
674                             win32_fcloseall
675                             win32_fgets
676                             win32_gets
677                             win32_fgetc
678                             win32_putc
679                             win32_puts
680                             win32_getchar
681                             win32_putchar
682                             win32_malloc
683                             win32_calloc
684                             win32_realloc
685                             win32_free
686                             win32_sleep
687                             win32_times
688                             win32_access
689                             win32_alarm
690                             win32_chmod
691                             win32_open_osfhandle
692                             win32_get_osfhandle
693                             win32_ioctl
694                             win32_link
695                             win32_unlink
696                             win32_utime
697                             win32_uname
698                             win32_wait
699                             win32_waitpid
700                             win32_kill
701                             win32_str_os_error
702                             win32_opendir
703                             win32_readdir
704                             win32_telldir
705                             win32_seekdir
706                             win32_rewinddir
707                             win32_closedir
708                             win32_longpath
709                             win32_os_id
710                             win32_getpid
711                             win32_crypt
712                             win32_dynaload
713                            ))
714     {
715         try_symbol($symbol);
716     }
717 }
718 elsif ($PLATFORM eq 'os2') {
719     open MAP, 'miniperl.map' or die 'Cannot read miniperl.map';
720     /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>;
721     close MAP or die 'Cannot close miniperl.map';
722
723     @missing = grep { !exists $mapped{$_} and !exists $bincompat5005{$_} }
724                     keys %export;
725     delete $export{$_} foreach @missing;
726 }
727
728 # Now all symbols should be defined because
729 # next we are going to output them.
730
731 foreach my $symbol (sort keys %export) {
732     output_symbol($symbol);
733 }
734
735 sub emit_symbol {
736     my $symbol = shift;
737     chomp($symbol); 
738     $export{$symbol} = 1;
739 }
740
741 sub output_symbol {
742     my $symbol = shift;
743     $symbol = $bincompat5005{$symbol}
744         if $define{PERL_BINCOMPAT_5005} and $symbol =~ /^($bincompat5005)$/;
745     if ($PLATFORM eq 'win32') {
746         $symbol = "_$symbol" if $CCTYPE eq 'BORLAND';
747         print "\t$symbol\n";
748 # XXX: binary compatibility between compilers is an exercise
749 # in frustration :-(
750 #        if ($CCTYPE eq "BORLAND") {
751 #           # workaround Borland quirk by exporting both the straight
752 #           # name and a name with leading underscore.  Note the
753 #           # alias *must* come after the symbol itself, if both
754 #           # are to be exported. (Linker bug?)
755 #           print "\t_$symbol\n";
756 #           print "\t$symbol = _$symbol\n";
757 #       }
758 #       elsif ($CCTYPE eq 'GCC') {
759 #           # Symbols have leading _ whole process is $%@"% slow
760 #           # so skip aliases for now
761 #           nprint "\t$symbol\n";
762 #       }
763 #       else {
764 #           # for binary coexistence, export both the symbol and
765 #           # alias with leading underscore
766 #           print "\t$symbol\n";
767 #           print "\t_$symbol = $symbol\n";
768 #       }
769     }
770     elsif ($PLATFORM eq 'os2') {
771         print qq(    "$symbol"\n);
772     }
773     elsif ($PLATFORM eq 'aix') {
774         print "$symbol\n";
775     }
776 }
777
778 1;
779 __DATA__
780 # extra globals not included above.
781 perl_alloc
782 perl_alloc_using
783 perl_clone
784 perl_clone_using
785 perl_construct
786 perl_destruct
787 perl_free
788 perl_parse
789 perl_run