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