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