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