Commit | Line | Data |
---|---|---|
3df97b6d | 1 | #./perl -w |
549a6b10 JH |
2 | # |
3 | # Create the export list for perl. | |
4 | # | |
86593e8d JH |
5 | # Needed by WIN32 and OS/2 for creating perl.dll, |
6 | # and by AIX for creating libperl.a when -Dusershrplib is in effect, | |
93ea32b8 | 7 | # and by VMS for creating perlshr.exe. |
549a6b10 | 8 | # |
3523994b DM |
9 | # Reads from information stored in |
10 | # | |
11 | # config.h | |
12 | # config.sh | |
13 | # global.sym | |
14 | # globvar.sym | |
15 | # intrpvar.h | |
3523994b DM |
16 | # miniperl.map (on OS/2) |
17 | # perl5.def (on OS/2; this is the old version of the file being made) | |
18 | # perlio.sym | |
19 | # perlvars.h | |
20 | # | |
bf09e1bd | 21 | # plus long lists of function names hard-coded directly in this script. |
3523994b DM |
22 | # |
23 | # Writes the result to STDOUT. | |
24 | # | |
25 | # Normally this script is invoked from a makefile (e.g. win32/Makefile), | |
26 | # which redirects STDOUT to a suitable file, such as: | |
27 | # | |
28 | # perl5.def OS/2 | |
29 | # perldll.def Windows | |
30 | # perl.exp AIX | |
31 | # perl.imp NetWare | |
93ea32b8 | 32 | # makedef.lis VMS |
c560d966 RGS |
33 | |
34 | BEGIN { unshift @INC, "lib" } | |
9d6c7f2e | 35 | use Config; |
3df97b6d | 36 | use strict; |
0a753a76 | 37 | |
c85dd27b | 38 | use vars qw($PLATFORM $CCTYPE $FILETYPE $TARG_DIR); |
080c3729 | 39 | |
ca51b52d | 40 | $CCTYPE = 'MSVC'; |
080c3729 | 41 | $TARG_DIR = ''; |
3df97b6d | 42 | |
d6035849 | 43 | my %define; |
910dfcc8 | 44 | |
7766f137 GS |
45 | while (@ARGV) { |
46 | my $flag = shift; | |
5c728af0 IZ |
47 | if ($flag =~ s/^CC_FLAGS=/ /) { |
48 | for my $fflag ($flag =~ /(?:^|\s)-D(\S+)/g) { | |
49 | $fflag .= '=1' unless $fflag =~ /^(\w+)=/; | |
50 | $define{$1} = $2 if $fflag =~ /^(\w+)=(.+)$/; | |
51 | } | |
52 | next; | |
53 | } | |
7766f137 GS |
54 | $define{$1} = 1 if ($flag =~ /^-D(\w+)$/); |
55 | $define{$1} = $2 if ($flag =~ /^-D(\w+)=(.+)$/); | |
56 | $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/); | |
57 | $PLATFORM = $1 if ($flag =~ /^PLATFORM=(\w+)$/); | |
3ea85c23 | 58 | $FILETYPE = $1 if ($flag =~ /^FILETYPE=(\w+)$/); |
080c3729 | 59 | $TARG_DIR = $1 if $flag =~ /^TARG_DIR=(.+)$/; |
7766f137 | 60 | } |
d55594ae | 61 | |
93ea32b8 | 62 | my @PLATFORM = qw(aix win32 wince os2 netware vms); |
549a6b10 JH |
63 | my %PLATFORM; |
64 | @PLATFORM{@PLATFORM} = (); | |
65 | ||
66 | defined $PLATFORM || die "PLATFORM undefined, must be one of: @PLATFORM\n"; | |
9df9a5cd | 67 | exists $PLATFORM{$PLATFORM} || die "PLATFORM must be one of: @PLATFORM\n"; |
549a6b10 | 68 | |
c960bcfd NC |
69 | # Add the compile-time options that miniperl was built with to %define. |
70 | # On Win32 these are not the same options as perl itself will be built | |
71 | # with since miniperl is built with a canned config (one of the win32/ | |
72 | # config_H.*) and none of the BUILDOPT's that are set in the makefiles, | |
73 | # but they do include some #define's that are hard-coded in various | |
74 | # source files and header files and don't include any BUILDOPT's that | |
75 | # the user might have chosen to disable because the canned configs are | |
76 | # minimal configs that don't include any of those options. | |
77 | ||
78 | my @options = sort(Config::bincompat_options(), Config::non_bincompat_options()); | |
79 | print STDERR "Options: (@options)\n"; | |
80 | $define{$_} = 1 foreach @options; | |
17bdc114 | 81 | |
c6261f3b JH |
82 | my %exportperlmalloc = |
83 | ( | |
84 | Perl_malloc => "malloc", | |
85 | Perl_mfree => "free", | |
86 | Perl_realloc => "realloc", | |
87 | Perl_calloc => "calloc", | |
88 | ); | |
89 | ||
90 | my $exportperlmalloc = $PLATFORM eq 'os2'; | |
91 | ||
549a6b10 JH |
92 | my $config_sh = "config.sh"; |
93 | my $config_h = "config.h"; | |
549a6b10 JH |
94 | my $intrpvar_h = "intrpvar.h"; |
95 | my $perlvars_h = "perlvars.h"; | |
96 | my $global_sym = "global.sym"; | |
549a6b10 JH |
97 | my $globvar_sym = "globvar.sym"; |
98 | my $perlio_sym = "perlio.sym"; | |
d2b25974 | 99 | my $static_ext = ""; |
549a6b10 | 100 | |
ca51b52d NC |
101 | s/^/$TARG_DIR/ foreach($intrpvar_h, $perlvars_h, $global_sym, $globvar_sym, |
102 | $perlio_sym, $config_sh); | |
549a6b10 | 103 | |
a5d93797 | 104 | unless ($PLATFORM eq 'win32' || $PLATFORM eq 'wince' || $PLATFORM eq 'netware') { |
549a6b10 | 105 | open(CFG,$config_sh) || die "Cannot open $config_sh: $!\n"; |
7766f137 | 106 | while (<CFG>) { |
549a6b10 JH |
107 | if (/^(?:ccflags|optimize)='(.+)'$/) { |
108 | $_ = $1; | |
109 | $define{$1} = 1 while /-D(\w+)/g; | |
110 | } | |
8a7bc875 NC |
111 | $define{$1} = $2 |
112 | if /^(config_args|archname|perl_patchlevel)='(.+)'$/; | |
549a6b10 JH |
113 | } |
114 | close(CFG); | |
115 | } | |
d2b25974 | 116 | if ($PLATFORM eq 'win32' || $PLATFORM eq 'wince') { |
5097d0e7 | 117 | open(CFG, '<', $config_sh) || die "Cannot open $config_sh: $!\n"; |
d2b25974 VK |
118 | if ((join '', <CFG>) =~ /^static_ext='(.*)'$/m) { |
119 | $static_ext = $1; | |
120 | } | |
121 | close(CFG); | |
122 | } | |
549a6b10 JH |
123 | |
124 | open(CFG,$config_h) || die "Cannot open $config_h: $!\n"; | |
7766f137 | 125 | while (<CFG>) { |
1f0041ed | 126 | $define{$1} = 1 if /^\s*\#\s*define\s+(MYMALLOC|MULTIPLICITY |
918a61c7 | 127 | |SPRINTF_RETURNS_STRLEN |
1f0041ed | 128 | |(?:PERL|USE|HAS)_\w+)\b/x; |
7766f137 | 129 | } |
bbc8f9de NIS |
130 | close(CFG); |
131 | ||
18c4b137 JH |
132 | # perl.h logic duplication begins |
133 | ||
894ccb8c JH |
134 | if ($define{PERL_IMPLICIT_SYS}) { |
135 | $define{PL_OP_SLAB_ALLOC} = 1; | |
136 | } | |
ac6bedea | 137 | |
18c4b137 | 138 | if ($define{USE_ITHREADS}) { |
acfe0abc | 139 | if (!$define{MULTIPLICITY}) { |
18c4b137 JH |
140 | $define{MULTIPLICITY} = 1; |
141 | } | |
142 | } | |
143 | ||
144 | $define{PERL_IMPLICIT_CONTEXT} ||= | |
145 | $define{USE_ITHREADS} || | |
18c4b137 JH |
146 | $define{MULTIPLICITY} ; |
147 | ||
10bc17b6 JH |
148 | if ($define{USE_ITHREADS} && $PLATFORM ne 'win32' && $^O ne 'darwin') { |
149 | $define{USE_REENTRANT_API} = 1; | |
150 | } | |
151 | ||
18c4b137 JH |
152 | # perl.h logic duplication ends |
153 | ||
dcddf0a3 SH |
154 | print STDERR "Defines: (" . join(' ', sort keys %define) . ")\n"; |
155 | ||
d6035849 NC |
156 | my $sym_ord = 0; |
157 | my %ordinal; | |
158 | ||
159 | if ($PLATFORM eq 'os2') { | |
52e4c282 IZ |
160 | if (open my $fh, '<', 'perl5.def') { |
161 | while (<$fh>) { | |
162 | last if /^\s*EXPORTS\b/; | |
163 | } | |
164 | while (<$fh>) { | |
78232bc0 | 165 | $ordinal{$1} = $2 if /^\s*"(\w+)"\s*(?:=\s*"\w+"\s*)?\@(\d+)\s*$/; |
52e4c282 IZ |
166 | # This allows skipping ordinals which were used in older versions |
167 | $sym_ord = $1 if /^\s*;\s*LAST_ORDINAL\s*=\s*(\d+)\s*$/; | |
168 | } | |
169 | $sym_ord < $_ and $sym_ord = $_ for values %ordinal; # Take the max | |
170 | } | |
2986a63f | 171 | } |
bbc8f9de | 172 | |
44c17813 NC |
173 | my %skip; |
174 | # All platforms export boot_DynaLoader unconditionally. | |
175 | my %export = ( boot_DynaLoader => 1 ); | |
176 | ||
430d15ed NC |
177 | sub try_symbols { |
178 | foreach my $symbol (@_) { | |
44c17813 NC |
179 | ++$export{$symbol} unless exists $skip{$symbol}; |
180 | } | |
181 | } | |
182 | ||
183 | sub readvar { | |
184 | # $hash is the hash that we're adding to. For one of our callers, it will | |
185 | # actually be the skip hash but that doesn't affect the intent of what | |
186 | # we're doing, as in that case we skip adding something to the skip hash | |
187 | # for the second time. | |
188 | ||
189 | my ($file, $hash, $proc) = @_; | |
190 | open my $vars, '<', $file or die die "Cannot open $file: $!\n"; | |
191 | ||
192 | while (<$vars>) { | |
193 | # All symbols have a Perl_ prefix because that's what embed.h sticks | |
194 | # in front of them. The A?I?S?C? is strictly speaking wrong. | |
195 | next unless /\bPERLVAR(A?I?S?C?)\(([IGT])(\w+)/; | |
196 | ||
197 | my $var = "PL_$3"; | |
198 | my $symbol = $proc ? &$proc($1,$2,$3) : $var; | |
199 | ++$hash->{$symbol} unless exists $skip{$var}; | |
51371543 | 200 | } |
22239a37 NIS |
201 | } |
202 | ||
f2921293 | 203 | if ($PLATFORM ne 'os2') { |
e7c4906b | 204 | ++$skip{$_} foreach qw( |
f2921293 NC |
205 | PL_cryptseen |
206 | PL_opsave | |
207 | Perl_GetVars | |
208 | Perl_dump_fds | |
209 | Perl_my_bcopy | |
210 | Perl_my_bzero | |
211 | Perl_my_chsize | |
212 | Perl_my_htonl | |
213 | Perl_my_memcmp | |
214 | Perl_my_memset | |
215 | Perl_my_ntohl | |
216 | Perl_my_swap | |
e7c4906b | 217 | ); |
c36317f0 | 218 | if ($PLATFORM eq 'vms') { |
e7c4906b | 219 | ++$skip{PL_statusvalue_posix}; |
c36317f0 | 220 | } else { |
e7c4906b | 221 | ++$skip{PL_statusvalue_vms}; |
c36317f0 | 222 | if ($PLATFORM ne 'aix') { |
e7c4906b | 223 | ++$skip{$_} foreach qw( |
c36317f0 NC |
224 | PL_DBcv |
225 | PL_generation | |
226 | PL_lastgotoprobe | |
227 | PL_modcount | |
228 | PL_timesbuf | |
229 | main | |
e7c4906b | 230 | ); |
c36317f0 NC |
231 | } |
232 | } | |
f2921293 NC |
233 | } |
234 | ||
c36317f0 NC |
235 | if ($PLATFORM ne 'vms') { |
236 | # VMS does its own thing for these symbols. | |
e7c4906b | 237 | ++$skip{$_} foreach qw( |
c36317f0 NC |
238 | PL_sig_handlers_initted |
239 | PL_sig_ignoring | |
240 | PL_sig_defaulting | |
e7c4906b | 241 | ); |
c36317f0 | 242 | if ($PLATFORM ne 'win32') { |
e7c4906b | 243 | ++$skip{$_} foreach qw( |
c36317f0 NC |
244 | Perl_do_spawn |
245 | Perl_do_spawn_nowait | |
246 | Perl_do_aspawn | |
e7c4906b | 247 | ); |
c36317f0 | 248 | } |
7766f137 | 249 | } |
c36317f0 | 250 | |
df39eaa8 | 251 | unless ($define{UNLINK_ALL_VERSIONS}) { |
e7c4906b | 252 | ++$skip{Perl_unlnk}; |
93ea32b8 | 253 | } |
3cfae81b | 254 | |
7766f137 | 255 | unless ($define{'DEBUGGING'}) { |
e7c4906b | 256 | ++$skip{$_} foreach qw( |
7766f137 GS |
257 | Perl_debop |
258 | Perl_debprofdump | |
259 | Perl_debstack | |
260 | Perl_debstackptrs | |
5cbf7fcf | 261 | Perl_pad_sv |
b65222da | 262 | Perl_pad_setsv |
943795c2 | 263 | Perl_hv_assert |
7766f137 GS |
264 | PL_block_type |
265 | PL_watchaddr | |
266 | PL_watchok | |
e0cde265 | 267 | PL_watch_pvx |
e7c4906b | 268 | ); |
7766f137 GS |
269 | } |
270 | ||
271 | if ($define{'PERL_IMPLICIT_SYS'}) { | |
e7c4906b | 272 | ++$skip{$_} foreach qw( |
7766f137 GS |
273 | Perl_my_popen |
274 | Perl_my_pclose | |
e7c4906b | 275 | ); |
2c84c919 NC |
276 | ++$export{$_} foreach qw(perl_get_host_info perl_alloc_override); |
277 | ++$export{perl_clone_host} if $define{USE_ITHREADS}; | |
7766f137 GS |
278 | } |
279 | else { | |
e7c4906b | 280 | ++$skip{$_} foreach qw( |
7766f137 GS |
281 | PL_Mem |
282 | PL_MemShared | |
283 | PL_MemParse | |
284 | PL_Env | |
285 | PL_StdIO | |
286 | PL_LIO | |
287 | PL_Dir | |
288 | PL_Sock | |
289 | PL_Proc | |
2c84c919 NC |
290 | perl_alloc_using |
291 | perl_clone_using | |
e7c4906b | 292 | ); |
7766f137 GS |
293 | } |
294 | ||
f8c7b90f | 295 | unless ($define{'PERL_OLD_COPY_ON_WRITE'}) { |
e7c4906b | 296 | ++$skip{Perl_sv_setsv_cow}; |
0190f6ec AT |
297 | } |
298 | ||
5bcb3f6c | 299 | unless ($define{'USE_REENTRANT_API'}) { |
e7c4906b | 300 | ++$skip{PL_reentrant_buffer}; |
5bcb3f6c NIS |
301 | } |
302 | ||
7766f137 | 303 | if ($define{'MYMALLOC'}) { |
430d15ed | 304 | try_symbols(qw( |
7766f137 | 305 | Perl_dump_mstats |
827e134a | 306 | Perl_get_mstats |
9c130f5b NIS |
307 | Perl_strdup |
308 | Perl_putenv | |
6af660ee IZ |
309 | MallocCfg_ptr |
310 | MallocCfgP_ptr | |
430d15ed | 311 | )); |
3cf3941e NC |
312 | unless ($define{USE_ITHREADS}) { |
313 | ++$skip{PL_malloc_mutex} | |
80fc1a6e | 314 | } |
51371543 GS |
315 | } |
316 | else { | |
e7c4906b | 317 | ++$skip{$_} foreach qw( |
7766f137 GS |
318 | PL_malloc_mutex |
319 | Perl_dump_mstats | |
6ecd3fcb | 320 | Perl_get_mstats |
6af660ee IZ |
321 | MallocCfg_ptr |
322 | MallocCfgP_ptr | |
e7c4906b | 323 | ); |
7766f137 GS |
324 | } |
325 | ||
8852afe9 | 326 | if ($define{'PERL_USE_SAFE_PUTENV'}) { |
e7c4906b | 327 | ++$skip{PL_use_safe_putenv}; |
8852afe9 MB |
328 | } |
329 | ||
3db8f154 | 330 | unless ($define{'USE_ITHREADS'}) { |
e7c4906b | 331 | ++$skip{PL_thr_key}; |
f433d095 GS |
332 | } |
333 | ||
3db8f154 | 334 | # USE_5005THREADS symbols. Kept as reference for easier removal |
e7c4906b | 335 | ++$skip{$_} foreach qw( |
7766f137 GS |
336 | PL_sv_mutex |
337 | PL_strtab_mutex | |
338 | PL_svref_mutex | |
7766f137 GS |
339 | PL_cred_mutex |
340 | PL_eval_mutex | |
6940069f GS |
341 | PL_fdpid_mutex |
342 | PL_sv_lock_mutex | |
7766f137 GS |
343 | PL_eval_cond |
344 | PL_eval_owner | |
345 | PL_threads_mutex | |
346 | PL_nthreads | |
347 | PL_nthreads_cond | |
348 | PL_threadnum | |
349 | PL_threadsv_names | |
350 | PL_thrsv | |
351 | PL_vtbl_mutex | |
7766f137 GS |
352 | Perl_condpair_magic |
353 | Perl_new_struct_thread | |
354 | Perl_per_thread_magicals | |
355 | Perl_thread_create | |
356 | Perl_find_threadsv | |
357 | Perl_unlock_condpair | |
358 | Perl_magic_mutexfree | |
4755096e | 359 | Perl_sv_lock |
e7c4906b | 360 | ); |
7766f137 GS |
361 | |
362 | unless ($define{'USE_ITHREADS'}) { | |
e7c4906b | 363 | ++$skip{$_} foreach qw( |
534825c4 | 364 | PL_op_mutex |
7e95b20d JH |
365 | PL_regex_pad |
366 | PL_regex_padav | |
e2975953 | 367 | PL_dollarzero_mutex |
b60bf3b9 | 368 | PL_hints_mutex |
8703a9a4 | 369 | PL_my_ctx_mutex |
f1791e53 | 370 | PL_perlio_mutex |
7c425e3c NC |
371 | Perl_clone_params_del |
372 | Perl_clone_params_new | |
b0bb49b6 | 373 | Perl_parser_dup |
7766f137 GS |
374 | Perl_dirp_dup |
375 | Perl_cx_dup | |
376 | Perl_si_dup | |
377 | Perl_any_dup | |
378 | Perl_ss_dup | |
379 | Perl_fp_dup | |
380 | Perl_gp_dup | |
381 | Perl_he_dup | |
382 | Perl_mg_dup | |
7f605079 | 383 | Perl_re_dup_guts |
7766f137 | 384 | Perl_sv_dup |
7c425e3c | 385 | Perl_sv_dup_inc |
aeef2723 | 386 | Perl_rvpv_dup |
88daff13 | 387 | Perl_hek_dup |
7766f137 | 388 | Perl_sys_intern_dup |
7766f137 GS |
389 | perl_clone |
390 | perl_clone_using | |
dc1061dc | 391 | Perl_stashpv_hvname_match |
1fa600a7 | 392 | Perl_regdupe_internal |
392d04bb | 393 | Perl_newPADOP |
e7c4906b | 394 | ); |
7766f137 GS |
395 | } |
396 | ||
397 | unless ($define{'PERL_IMPLICIT_CONTEXT'}) { | |
e7c4906b | 398 | ++$skip{$_} foreach qw( |
1f9ecdc6 SH |
399 | PL_my_cxt_index |
400 | PL_my_cxt_list | |
401 | PL_my_cxt_size | |
ecb9cc66 | 402 | PL_my_cxt_keys |
7766f137 GS |
403 | Perl_croak_nocontext |
404 | Perl_die_nocontext | |
405 | Perl_deb_nocontext | |
406 | Perl_form_nocontext | |
e0f4245d | 407 | Perl_load_module_nocontext |
7766f137 GS |
408 | Perl_mess_nocontext |
409 | Perl_warn_nocontext | |
410 | Perl_warner_nocontext | |
411 | Perl_newSVpvf_nocontext | |
412 | Perl_sv_catpvf_nocontext | |
413 | Perl_sv_setpvf_nocontext | |
414 | Perl_sv_catpvf_mg_nocontext | |
415 | Perl_sv_setpvf_mg_nocontext | |
484eff17 | 416 | Perl_my_cxt_init |
ecb9cc66 | 417 | Perl_my_cxt_index |
e7c4906b | 418 | ); |
7766f137 GS |
419 | } |
420 | ||
aadb217d | 421 | unless ($define{'PL_OP_SLAB_ALLOC'}) { |
e7c4906b | 422 | ++$skip{$_} foreach qw( |
aadb217d JH |
423 | PL_OpPtr |
424 | PL_OpSlab | |
425 | PL_OpSpace | |
426 | Perl_Slab_Alloc | |
427 | Perl_Slab_Free | |
e7c4906b | 428 | ); |
8d2d9fd7 RGS |
429 | } |
430 | ||
431 | unless ($define{'PERL_DEBUG_READONLY_OPS'}) { | |
e7c4906b | 432 | ++$skip{$_} foreach qw( |
8d2d9fd7 RGS |
433 | PL_slab_count |
434 | PL_slabs | |
e7c4906b | 435 | ); |
aadb217d JH |
436 | } |
437 | ||
438 | unless ($define{'THREADS_HAVE_PIDS'}) { | |
e7c4906b | 439 | ++$skip{PL_ppid}; |
e0cde265 SH |
440 | } |
441 | ||
aadb217d | 442 | unless ($define{'PERL_NEED_APPCTX'}) { |
e7c4906b | 443 | ++$skip{PL_appctx}; |
e0cde265 SH |
444 | } |
445 | ||
aadb217d | 446 | unless ($define{'PERL_NEED_TIMESBASE'}) { |
e7c4906b | 447 | ++$skip{PL_timesbase}; |
e0cde265 SH |
448 | } |
449 | ||
dfc72f41 | 450 | unless ($define{'DEBUG_LEAKING_SCALARS'}) { |
e7c4906b | 451 | ++$skip{PL_sv_serial}; |
dfc72f41 NC |
452 | } |
453 | ||
808e2276 | 454 | unless ($define{'DEBUG_LEAKING_SCALARS_FORK_DUMP'}) { |
e7c4906b | 455 | ++$skip{PL_dumper_fd}; |
808e2276 | 456 | } |
e7c4906b | 457 | |
c69033f2 | 458 | unless ($define{'PERL_DONT_CREATE_GVSV'}) { |
e7c4906b | 459 | ++$skip{Perl_gv_SVadd}; |
c69033f2 | 460 | } |
e7c4906b | 461 | |
ce582cee | 462 | if ($define{'SPRINTF_RETURNS_STRLEN'}) { |
e7c4906b | 463 | ++$skip{Perl_my_sprintf}; |
ce582cee | 464 | } |
e7c4906b | 465 | |
ca0c25f6 | 466 | unless ($define{'PERL_USES_PL_PIDSTATUS'}) { |
e7c4906b | 467 | ++$skip{PL_pidstatus}; |
ca0c25f6 | 468 | } |
808e2276 | 469 | |
02ca4724 | 470 | unless ($define{'PERL_TRACK_MEMPOOL'}) { |
e7c4906b | 471 | ++$skip{PL_memory_debug_header}; |
02ca4724 SP |
472 | } |
473 | ||
2cea2a29 | 474 | unless ($define{PERL_MAD}) { |
e7c4906b | 475 | ++$skip{$_} foreach qw( |
e3e31fab SH |
476 | PL_madskills |
477 | PL_xmlfp | |
e7c4906b | 478 | ); |
e3e31fab SH |
479 | } |
480 | ||
2a5adacc | 481 | unless ($define{'MULTIPLICITY'}) { |
e7c4906b | 482 | ++$skip{$_} foreach qw( |
01523419 | 483 | PL_interp_size |
9e08d3a4 | 484 | PL_interp_size_5_16_0 |
e7c4906b | 485 | ); |
2a5adacc JD |
486 | } |
487 | ||
488 | unless ($define{'PERL_GLOBAL_STRUCT'}) { | |
e7c4906b | 489 | ++$skip{PL_global_struct_size}; |
2a5adacc JD |
490 | } |
491 | ||
436dbe32 | 492 | unless ($define{'PERL_GLOBAL_STRUCT_PRIVATE'}) { |
e7c4906b | 493 | ++$skip{$_} foreach qw( |
436dbe32 SH |
494 | PL_my_cxt_keys |
495 | Perl_my_cxt_index | |
e7c4906b | 496 | ); |
436dbe32 SH |
497 | } |
498 | ||
bd1ae5d2 | 499 | unless ($define{HAS_MMAP}) { |
e7c4906b | 500 | ++$skip{PL_mmap_page_size}; |
ac6bedea JH |
501 | } |
502 | ||
bd1ae5d2 | 503 | if ($define{HAS_SIGACTION}) { |
e7c4906b | 504 | ++$skip{PL_sig_trapped}; |
d97afc04 AT |
505 | } |
506 | ||
bdcba273 | 507 | unless ($define{USE_LOCALE_COLLATE}) { |
e7c4906b | 508 | ++$skip{$_} foreach qw( |
bdcba273 NC |
509 | PL_collation_ix |
510 | PL_collation_name | |
511 | PL_collation_standard | |
512 | PL_collxfrm_base | |
513 | PL_collxfrm_mult | |
514 | Perl_sv_collxfrm | |
515 | Perl_sv_collxfrm_flags | |
e7c4906b | 516 | ); |
bdcba273 NC |
517 | } |
518 | ||
1f1ade4f | 519 | unless ($define{USE_LOCALE_NUMERIC}) { |
e7c4906b | 520 | ++$skip{$_} foreach qw( |
1f1ade4f NC |
521 | PL_numeric_local |
522 | PL_numeric_name | |
523 | PL_numeric_radix_sv | |
524 | PL_numeric_standard | |
e7c4906b | 525 | ); |
1f1ade4f NC |
526 | } |
527 | ||
1ab20eaa | 528 | unless ($define{HAVE_INTERP_INTERN}) { |
e7c4906b | 529 | ++$skip{$_} foreach qw( |
1ab20eaa NC |
530 | Perl_sys_intern_clear |
531 | Perl_sys_intern_dup | |
532 | Perl_sys_intern_init | |
533 | PL_sys_intern | |
e7c4906b | 534 | ); |
1ab20eaa NC |
535 | } |
536 | ||
47e4ddfc | 537 | if ($define{HAS_SIGNBIT}) { |
e7c4906b | 538 | ++$skip{Perl_signbit}; |
47e4ddfc NC |
539 | } |
540 | ||
7766f137 | 541 | if ($define{'PERL_GLOBAL_STRUCT'}) { |
44c17813 | 542 | readvar($perlvars_h, \%skip); |
944921d3 | 543 | ++$export{Perl_GetVars}; |
430d15ed | 544 | try_symbols(qw(PL_Vars PL_VarsPtr)) unless $CCTYPE eq 'GCC'; |
aadb217d | 545 | } else { |
e7c4906b | 546 | ++$skip{$_} foreach qw(Perl_init_global_struct Perl_free_global_struct); |
7766f137 | 547 | } |
36c15d3f | 548 | |
22c35a8c GS |
549 | # functions from *.sym files |
550 | ||
7697f15a | 551 | my @syms = ($global_sym, $globvar_sym); |
549a6b10 | 552 | |
d892637e NIS |
553 | # Symbols that are the public face of the PerlIO layers implementation |
554 | # These are in _addition to_ the public face of the abstraction | |
555 | # and need to be exported to allow XS modules to implement layers | |
9df9a5cd | 556 | my @layer_syms = qw( |
db76e01e JH |
557 | PerlIOBase_binmode |
558 | PerlIOBase_clearerr | |
559 | PerlIOBase_close | |
560 | PerlIOBase_dup | |
561 | PerlIOBase_eof | |
562 | PerlIOBase_error | |
563 | PerlIOBase_fileno | |
564 | PerlIOBase_noop_fail | |
565 | PerlIOBase_noop_ok | |
566 | PerlIOBase_popped | |
7e700b9a | 567 | PerlIOBase_pushed |
db76e01e JH |
568 | PerlIOBase_read |
569 | PerlIOBase_setlinebuf | |
570 | PerlIOBase_unread | |
571 | PerlIOBuf_bufsiz | |
572 | PerlIOBuf_close | |
573 | PerlIOBuf_dup | |
574 | PerlIOBuf_fill | |
575 | PerlIOBuf_flush | |
576 | PerlIOBuf_get_base | |
577 | PerlIOBuf_get_cnt | |
578 | PerlIOBuf_get_ptr | |
579 | PerlIOBuf_open | |
580 | PerlIOBuf_popped | |
581 | PerlIOBuf_pushed | |
582 | PerlIOBuf_read | |
583 | PerlIOBuf_seek | |
584 | PerlIOBuf_set_ptrcnt | |
585 | PerlIOBuf_tell | |
586 | PerlIOBuf_unread | |
587 | PerlIOBuf_write | |
588 | PerlIO_allocate | |
8ffeedc3 | 589 | PerlIO_apply_layera |
db76e01e JH |
590 | PerlIO_apply_layers |
591 | PerlIO_arg_fetch | |
592 | PerlIO_debug | |
593 | PerlIO_define_layer | |
4dcdb34a | 594 | PerlIO_find_layer |
51d05609 | 595 | PerlIO_isutf8 |
db76e01e | 596 | PerlIO_layer_fetch |
4dcdb34a | 597 | PerlIO_list_alloc |
db76e01e JH |
598 | PerlIO_list_free |
599 | PerlIO_modestr | |
600 | PerlIO_parse_layers | |
601 | PerlIO_pending | |
602 | PerlIO_perlio | |
603 | PerlIO_pop | |
604 | PerlIO_push | |
605 | PerlIO_sv_dup | |
606 | Perl_PerlIO_clearerr | |
607 | Perl_PerlIO_close | |
188f0c84 | 608 | Perl_PerlIO_context_layers |
db76e01e JH |
609 | Perl_PerlIO_eof |
610 | Perl_PerlIO_error | |
611 | Perl_PerlIO_fileno | |
612 | Perl_PerlIO_fill | |
613 | Perl_PerlIO_flush | |
614 | Perl_PerlIO_get_base | |
615 | Perl_PerlIO_get_bufsiz | |
616 | Perl_PerlIO_get_cnt | |
617 | Perl_PerlIO_get_ptr | |
618 | Perl_PerlIO_read | |
619 | Perl_PerlIO_seek | |
620 | Perl_PerlIO_set_cnt | |
621 | Perl_PerlIO_set_ptrcnt | |
622 | Perl_PerlIO_setlinebuf | |
623 | Perl_PerlIO_stderr | |
624 | Perl_PerlIO_stdin | |
625 | Perl_PerlIO_stdout | |
626 | Perl_PerlIO_tell | |
627 | Perl_PerlIO_unread | |
628 | Perl_PerlIO_write | |
9df9a5cd | 629 | ); |
a5564b91 JH |
630 | if ($PLATFORM eq 'netware') { |
631 | push(@layer_syms,'PL_def_layerlist','PL_known_layers','PL_perlio'); | |
632 | } | |
d892637e | 633 | |
7766f137 | 634 | if ($define{'USE_PERLIO'}) { |
d892637e NIS |
635 | # Export the symols that make up the PerlIO abstraction, regardless |
636 | # of its implementation - read from a file | |
084592ab | 637 | push @syms, $perlio_sym; |
d892637e NIS |
638 | |
639 | # This part is then dependent on how the abstraction is implemented | |
084592ab | 640 | if ($define{'USE_SFIO'}) { |
d892637e | 641 | # Old legacy non-stdio "PerlIO" |
e7c4906b NC |
642 | ++$skip{$_} foreach @layer_syms; |
643 | ++$skip{perlsio_binmode}; | |
084592ab | 644 | # SFIO defines most of the PerlIO routines as macros |
d892637e NIS |
645 | # So undo most of what $perlio_sym has just done - d'oh ! |
646 | # Perhaps it would be better to list the ones which do exist | |
647 | # And emit them | |
e7c4906b | 648 | ++$skip{$_} foreach qw( |
084592ab CN |
649 | PerlIO_canset_cnt |
650 | PerlIO_clearerr | |
651 | PerlIO_close | |
652 | PerlIO_eof | |
653 | PerlIO_error | |
654 | PerlIO_exportFILE | |
655 | PerlIO_fast_gets | |
656 | PerlIO_fdopen | |
657 | PerlIO_fileno | |
658 | PerlIO_findFILE | |
659 | PerlIO_flush | |
660 | PerlIO_get_base | |
661 | PerlIO_get_bufsiz | |
662 | PerlIO_get_cnt | |
663 | PerlIO_get_ptr | |
664 | PerlIO_getc | |
665 | PerlIO_getname | |
666 | PerlIO_has_base | |
667 | PerlIO_has_cntptr | |
668 | PerlIO_importFILE | |
669 | PerlIO_open | |
670 | PerlIO_printf | |
671 | PerlIO_putc | |
672 | PerlIO_puts | |
673 | PerlIO_read | |
674 | PerlIO_releaseFILE | |
675 | PerlIO_reopen | |
676 | PerlIO_rewind | |
677 | PerlIO_seek | |
678 | PerlIO_set_cnt | |
679 | PerlIO_set_ptrcnt | |
680 | PerlIO_setlinebuf | |
681 | PerlIO_sprintf | |
682 | PerlIO_stderr | |
683 | PerlIO_stdin | |
684 | PerlIO_stdout | |
685 | PerlIO_stdoutf | |
686 | PerlIO_tell | |
687 | PerlIO_ungetc | |
688 | PerlIO_vprintf | |
689 | PerlIO_write | |
bcdb689b JH |
690 | PerlIO_perlio |
691 | Perl_PerlIO_clearerr | |
692 | Perl_PerlIO_close | |
693 | Perl_PerlIO_eof | |
694 | Perl_PerlIO_error | |
695 | Perl_PerlIO_fileno | |
696 | Perl_PerlIO_fill | |
697 | Perl_PerlIO_flush | |
698 | Perl_PerlIO_get_base | |
699 | Perl_PerlIO_get_bufsiz | |
700 | Perl_PerlIO_get_cnt | |
701 | Perl_PerlIO_get_ptr | |
702 | Perl_PerlIO_read | |
703 | Perl_PerlIO_seek | |
704 | Perl_PerlIO_set_cnt | |
705 | Perl_PerlIO_set_ptrcnt | |
706 | Perl_PerlIO_setlinebuf | |
707 | Perl_PerlIO_stderr | |
708 | Perl_PerlIO_stdin | |
709 | Perl_PerlIO_stdout | |
710 | Perl_PerlIO_tell | |
711 | Perl_PerlIO_unread | |
712 | Perl_PerlIO_write | |
ffcf5686 JH |
713 | PL_def_layerlist |
714 | PL_known_layers | |
715 | PL_perlio | |
e7c4906b | 716 | ); |
084592ab | 717 | } |
d892637e NIS |
718 | else { |
719 | # PerlIO with layers - export implementation | |
430d15ed | 720 | try_symbols(@layer_syms, 'perlsio_binmode'); |
d892637e | 721 | } |
5138f914 | 722 | } else { |
d892637e NIS |
723 | # -Uuseperlio |
724 | # Skip the PerlIO layer symbols - although | |
aadb217d | 725 | # nothing should have exported them anyway. |
e7c4906b NC |
726 | ++$skip{$_} foreach @layer_syms; |
727 | ++$skip{$_} foreach qw( | |
a6272963 SH |
728 | perlsio_binmode |
729 | PL_def_layerlist | |
730 | PL_known_layers | |
731 | PL_perlio | |
732 | PL_perlio_debug_fd | |
733 | PL_perlio_fd_refcnt | |
734 | PL_perlio_fd_refcnt_size | |
01cace46 | 735 | PL_perlio_mutex |
e7c4906b | 736 | ); |
1e8a8f59 | 737 | |
d892637e NIS |
738 | # Also do NOT add abstraction symbols from $perlio_sym |
739 | # abstraction is done as #define to stdio | |
bf09e1bd | 740 | # Remaining remnants that _may_ be functions are handled below. |
9df9a5cd | 741 | } |
7766f137 | 742 | |
71afeaec NC |
743 | ############################################################################### |
744 | ||
745 | # At this point all skip lists should be completed, as we are about to test | |
746 | # many symbols against them. | |
747 | ||
7766f137 GS |
748 | for my $syms (@syms) { |
749 | open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n"; | |
750 | while (<GLOBAL>) { | |
751 | next if (!/^[A-Za-z]/); | |
752 | # Functions have a Perl_ prefix | |
753 | # Variables have a PL_ prefix | |
754 | chomp($_); | |
755 | my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : ""); | |
756 | $symbol .= $_; | |
944921d3 | 757 | ++$export{$symbol} unless exists $skip{$symbol}; |
7766f137 GS |
758 | } |
759 | close(GLOBAL); | |
760 | } | |
0a753a76 | 761 | |
22c35a8c | 762 | # variables |
0a753a76 | 763 | |
87b9e160 | 764 | if ($define{'MULTIPLICITY'} && $define{PERL_GLOBAL_STRUCT}) { |
44c17813 | 765 | readvar($perlvars_h, \%export, sub { "Perl_" . $_[1] . $_[2] . "_ptr" }); |
1acb48c9 | 766 | # XXX AIX seems to want the perlvars.h symbols, for some reason |
5c728af0 | 767 | if ($PLATFORM eq 'aix' or $PLATFORM eq 'os2') { # OS/2 needs PL_thr_key |
44c17813 | 768 | readvar($perlvars_h, \%export); |
51371543 GS |
769 | } |
770 | } | |
771 | else { | |
772 | unless ($define{'PERL_GLOBAL_STRUCT'}) { | |
44c17813 | 773 | readvar($perlvars_h, \%export); |
9df9a5cd | 774 | } |
87b9e160 | 775 | unless ($define{MULTIPLICITY}) { |
44c17813 | 776 | readvar($intrpvar_h, \%export); |
87b9e160 | 777 | } |
51371543 | 778 | } |
0a753a76 | 779 | |
bf09e1bd | 780 | # Oddities from PerlIO |
01cace46 NC |
781 | # All have alternate implementations in perlio.c, so always exist. |
782 | # Should they be considered to be part of the API? | |
430d15ed | 783 | try_symbols(qw( |
bf09e1bd NC |
784 | PerlIO_binmode |
785 | PerlIO_getpos | |
786 | PerlIO_init | |
787 | PerlIO_setpos | |
788 | PerlIO_sprintf | |
bf09e1bd NC |
789 | PerlIO_tmpfile |
790 | PerlIO_vsprintf | |
430d15ed | 791 | )); |
ac4c12e7 | 792 | |
5581753c | 793 | if ($PLATFORM eq 'win32') { |
7a95c549 | 794 | try_symbols(qw( |
5581753c NC |
795 | setgid |
796 | setuid | |
797 | win32_free_childdir | |
798 | win32_free_childenv | |
799 | win32_get_childdir | |
800 | win32_get_childenv | |
801 | win32_spawnvp | |
7a95c549 | 802 | )); |
5581753c NC |
803 | } |
804 | ||
18f68570 | 805 | if ($PLATFORM =~ /^win(?:32|ce)$/) { |
7a95c549 | 806 | try_symbols(qw( |
7766f137 | 807 | Perl_init_os_extras |
c44d3fdb | 808 | Perl_thread_create |
7766f137 | 809 | Perl_win32_init |
23f519f0 | 810 | Perl_win32_term |
7766f137 | 811 | RunPerl |
5290524f | 812 | win32_async_check |
7766f137 GS |
813 | win32_errno |
814 | win32_environ | |
7766f137 GS |
815 | win32_abort |
816 | win32_fstat | |
817 | win32_stat | |
818 | win32_pipe | |
819 | win32_popen | |
820 | win32_pclose | |
821 | win32_rename | |
822 | win32_setmode | |
11bb82ff | 823 | win32_chsize |
7766f137 GS |
824 | win32_lseek |
825 | win32_tell | |
826 | win32_dup | |
827 | win32_dup2 | |
828 | win32_open | |
829 | win32_close | |
830 | win32_eof | |
4342f4d6 | 831 | win32_isatty |
7766f137 GS |
832 | win32_read |
833 | win32_write | |
7766f137 GS |
834 | win32_mkdir |
835 | win32_rmdir | |
836 | win32_chdir | |
837 | win32_flock | |
838 | win32_execv | |
839 | win32_execvp | |
840 | win32_htons | |
841 | win32_ntohs | |
842 | win32_htonl | |
843 | win32_ntohl | |
844 | win32_inet_addr | |
845 | win32_inet_ntoa | |
846 | win32_socket | |
847 | win32_bind | |
848 | win32_listen | |
849 | win32_accept | |
850 | win32_connect | |
851 | win32_send | |
852 | win32_sendto | |
853 | win32_recv | |
854 | win32_recvfrom | |
855 | win32_shutdown | |
856 | win32_closesocket | |
857 | win32_ioctlsocket | |
858 | win32_setsockopt | |
859 | win32_getsockopt | |
860 | win32_getpeername | |
861 | win32_getsockname | |
862 | win32_gethostname | |
863 | win32_gethostbyname | |
864 | win32_gethostbyaddr | |
865 | win32_getprotobyname | |
866 | win32_getprotobynumber | |
867 | win32_getservbyname | |
868 | win32_getservbyport | |
869 | win32_select | |
870 | win32_endhostent | |
871 | win32_endnetent | |
872 | win32_endprotoent | |
873 | win32_endservent | |
874 | win32_getnetent | |
875 | win32_getnetbyname | |
876 | win32_getnetbyaddr | |
877 | win32_getprotoent | |
878 | win32_getservent | |
879 | win32_sethostent | |
880 | win32_setnetent | |
881 | win32_setprotoent | |
882 | win32_setservent | |
883 | win32_getenv | |
884 | win32_putenv | |
885 | win32_perror | |
7766f137 GS |
886 | win32_malloc |
887 | win32_calloc | |
888 | win32_realloc | |
889 | win32_free | |
890 | win32_sleep | |
891 | win32_times | |
892 | win32_access | |
893 | win32_alarm | |
894 | win32_chmod | |
895 | win32_open_osfhandle | |
896 | win32_get_osfhandle | |
897 | win32_ioctl | |
898 | win32_link | |
899 | win32_unlink | |
900 | win32_utime | |
57ab3dfe | 901 | win32_gettimeofday |
7766f137 GS |
902 | win32_uname |
903 | win32_wait | |
904 | win32_waitpid | |
905 | win32_kill | |
906 | win32_str_os_error | |
907 | win32_opendir | |
908 | win32_readdir | |
909 | win32_telldir | |
910 | win32_seekdir | |
911 | win32_rewinddir | |
912 | win32_closedir | |
913 | win32_longpath | |
aa2b96ec | 914 | win32_ansipath |
7766f137 GS |
915 | win32_os_id |
916 | win32_getpid | |
917 | win32_crypt | |
918 | win32_dynaload | |
df3728a2 | 919 | win32_clearenv |
00b02797 JH |
920 | win32_stdin |
921 | win32_stdout | |
922 | win32_stderr | |
923 | win32_ferror | |
924 | win32_feof | |
925 | win32_strerror | |
926 | win32_fprintf | |
927 | win32_printf | |
928 | win32_vfprintf | |
929 | win32_vprintf | |
930 | win32_fread | |
931 | win32_fwrite | |
932 | win32_fopen | |
933 | win32_fdopen | |
934 | win32_freopen | |
935 | win32_fclose | |
936 | win32_fputs | |
937 | win32_fputc | |
938 | win32_ungetc | |
939 | win32_getc | |
940 | win32_fileno | |
941 | win32_clearerr | |
942 | win32_fflush | |
943 | win32_ftell | |
944 | win32_fseek | |
945 | win32_fgetpos | |
946 | win32_fsetpos | |
947 | win32_rewind | |
948 | win32_tmpfile | |
949 | win32_setbuf | |
950 | win32_setvbuf | |
951 | win32_flushall | |
952 | win32_fcloseall | |
953 | win32_fgets | |
954 | win32_gets | |
955 | win32_fgetc | |
956 | win32_putc | |
957 | win32_puts | |
958 | win32_getchar | |
959 | win32_putchar | |
7a95c549 | 960 | )); |
3a00b83e | 961 | if ($CCTYPE eq "BORLAND") { |
7a95c549 | 962 | try_symbols('_matherr'); |
3a00b83e | 963 | } |
549a6b10 | 964 | } |
71afeaec NC |
965 | elsif ($PLATFORM eq 'vms') { |
966 | try_symbols(qw( | |
967 | Perl_cando | |
968 | Perl_cando_by_name | |
969 | Perl_closedir | |
970 | Perl_csighandler_init | |
971 | Perl_do_rmdir | |
972 | Perl_fileify_dirspec | |
973 | Perl_fileify_dirspec_ts | |
974 | Perl_fileify_dirspec_utf8 | |
975 | Perl_fileify_dirspec_utf8_ts | |
976 | Perl_flex_fstat | |
977 | Perl_flex_lstat | |
978 | Perl_flex_stat | |
979 | Perl_kill_file | |
980 | Perl_my_chdir | |
981 | Perl_my_chmod | |
982 | Perl_my_crypt | |
983 | Perl_my_endpwent | |
984 | Perl_my_fclose | |
985 | Perl_my_fdopen | |
986 | Perl_my_fgetname | |
987 | Perl_my_flush | |
988 | Perl_my_fwrite | |
989 | Perl_my_gconvert | |
990 | Perl_my_getenv | |
991 | Perl_my_getenv_len | |
992 | Perl_my_getlogin | |
993 | Perl_my_getpwnam | |
994 | Perl_my_getpwuid | |
995 | Perl_my_gmtime | |
996 | Perl_my_kill | |
997 | Perl_my_localtime | |
998 | Perl_my_mkdir | |
999 | Perl_my_sigaction | |
1000 | Perl_my_symlink | |
1001 | Perl_my_time | |
1002 | Perl_my_tmpfile | |
1003 | Perl_my_trnlnm | |
1004 | Perl_my_utime | |
1005 | Perl_my_waitpid | |
1006 | Perl_opendir | |
1007 | Perl_pathify_dirspec | |
1008 | Perl_pathify_dirspec_ts | |
1009 | Perl_pathify_dirspec_utf8 | |
1010 | Perl_pathify_dirspec_utf8_ts | |
1011 | Perl_readdir | |
1012 | Perl_readdir_r | |
1013 | Perl_rename | |
1014 | Perl_rmscopy | |
1015 | Perl_rmsexpand | |
1016 | Perl_rmsexpand_ts | |
1017 | Perl_rmsexpand_utf8 | |
1018 | Perl_rmsexpand_utf8_ts | |
1019 | Perl_seekdir | |
1020 | Perl_sig_to_vmscondition | |
1021 | Perl_telldir | |
1022 | Perl_tounixpath | |
1023 | Perl_tounixpath_ts | |
1024 | Perl_tounixpath_utf8 | |
1025 | Perl_tounixpath_utf8_ts | |
1026 | Perl_tounixspec | |
1027 | Perl_tounixspec_ts | |
1028 | Perl_tounixspec_utf8 | |
1029 | Perl_tounixspec_utf8_ts | |
1030 | Perl_tovmspath | |
1031 | Perl_tovmspath_ts | |
1032 | Perl_tovmspath_utf8 | |
1033 | Perl_tovmspath_utf8_ts | |
1034 | Perl_tovmsspec | |
1035 | Perl_tovmsspec_ts | |
1036 | Perl_tovmsspec_utf8 | |
1037 | Perl_tovmsspec_utf8_ts | |
1038 | Perl_trim_unixpath | |
1039 | Perl_vms_case_tolerant | |
1040 | Perl_vms_do_aexec | |
1041 | Perl_vms_do_exec | |
1042 | Perl_vms_image_init | |
1043 | Perl_vms_realpath | |
1044 | Perl_vmssetenv | |
1045 | Perl_vmssetuserlnm | |
1046 | Perl_vmstrnenv | |
1047 | PerlIO_openn | |
1048 | )); | |
1049 | } | |
3cfae81b | 1050 | elsif ($PLATFORM eq 'os2') { |
71afeaec NC |
1051 | try_symbols(qw( |
1052 | ctermid | |
1053 | get_sysinfo | |
1054 | Perl_OS2_init | |
1055 | Perl_OS2_init3 | |
1056 | Perl_OS2_term | |
1057 | OS2_Perl_data | |
1058 | dlopen | |
1059 | dlsym | |
1060 | dlerror | |
1061 | dlclose | |
1062 | dup2 | |
1063 | dup | |
1064 | my_tmpfile | |
1065 | my_tmpnam | |
1066 | my_flock | |
1067 | my_rmdir | |
1068 | my_mkdir | |
1069 | my_getpwuid | |
1070 | my_getpwnam | |
1071 | my_getpwent | |
1072 | my_setpwent | |
1073 | my_endpwent | |
1074 | fork_with_resources | |
1075 | croak_with_os2error | |
1076 | setgrent | |
1077 | endgrent | |
1078 | getgrent | |
1079 | malloc_mutex | |
1080 | threads_mutex | |
1081 | nthreads | |
1082 | nthreads_cond | |
1083 | os2_cond_wait | |
1084 | os2_stat | |
1085 | os2_execname | |
1086 | async_mssleep | |
1087 | msCounter | |
1088 | InfoTable | |
1089 | pthread_join | |
1090 | pthread_create | |
1091 | pthread_detach | |
1092 | XS_Cwd_change_drive | |
1093 | XS_Cwd_current_drive | |
1094 | XS_Cwd_extLibpath | |
1095 | XS_Cwd_extLibpath_set | |
1096 | XS_Cwd_sys_abspath | |
1097 | XS_Cwd_sys_chdir | |
1098 | XS_Cwd_sys_cwd | |
1099 | XS_Cwd_sys_is_absolute | |
1100 | XS_Cwd_sys_is_relative | |
1101 | XS_Cwd_sys_is_rooted | |
1102 | XS_DynaLoader_mod2fname | |
1103 | XS_File__Copy_syscopy | |
1104 | Perl_Register_MQ | |
1105 | Perl_Deregister_MQ | |
1106 | Perl_Serve_Messages | |
1107 | Perl_Process_Messages | |
1108 | init_PMWIN_entries | |
1109 | PMWIN_entries | |
1110 | Perl_hab_GET | |
1111 | loadByOrdinal | |
1112 | pExtFCN | |
1113 | os2error | |
1114 | ResetWinError | |
1115 | CroakWinError | |
1116 | PL_do_undump | |
1117 | )); | |
3cfae81b | 1118 | } |
2986a63f | 1119 | elsif ($PLATFORM eq 'netware') { |
7a95c549 | 1120 | try_symbols(qw( |
2986a63f JH |
1121 | Perl_init_os_extras |
1122 | Perl_thread_create | |
1123 | Perl_nw5_init | |
1124 | RunPerl | |
1125 | AllocStdPerl | |
1126 | FreeStdPerl | |
1127 | do_spawn2 | |
1128 | do_aspawn | |
1129 | nw_uname | |
1130 | nw_stdin | |
1131 | nw_stdout | |
1132 | nw_stderr | |
1133 | nw_feof | |
1134 | nw_ferror | |
1135 | nw_fopen | |
1136 | nw_fclose | |
1137 | nw_clearerr | |
1138 | nw_getc | |
1139 | nw_fgets | |
1140 | nw_fputc | |
1141 | nw_fputs | |
1142 | nw_fflush | |
1143 | nw_ungetc | |
1144 | nw_fileno | |
1145 | nw_fdopen | |
1146 | nw_freopen | |
1147 | nw_fread | |
1148 | nw_fwrite | |
1149 | nw_setbuf | |
1150 | nw_setvbuf | |
1151 | nw_vfprintf | |
1152 | nw_ftell | |
1153 | nw_fseek | |
1154 | nw_rewind | |
1155 | nw_tmpfile | |
1156 | nw_fgetpos | |
1157 | nw_fsetpos | |
1158 | nw_dup | |
1159 | nw_access | |
1160 | nw_chmod | |
1161 | nw_chsize | |
1162 | nw_close | |
1163 | nw_dup2 | |
1164 | nw_flock | |
1165 | nw_isatty | |
1166 | nw_link | |
1167 | nw_lseek | |
1168 | nw_stat | |
1169 | nw_mktemp | |
1170 | nw_open | |
1171 | nw_read | |
1172 | nw_rename | |
1173 | nw_setmode | |
1174 | nw_unlink | |
1175 | nw_utime | |
1176 | nw_write | |
1177 | nw_chdir | |
1178 | nw_rmdir | |
1179 | nw_closedir | |
1180 | nw_opendir | |
1181 | nw_readdir | |
1182 | nw_rewinddir | |
1183 | nw_seekdir | |
1184 | nw_telldir | |
1185 | nw_htonl | |
1186 | nw_htons | |
1187 | nw_ntohl | |
1188 | nw_ntohs | |
1189 | nw_accept | |
1190 | nw_bind | |
1191 | nw_connect | |
1192 | nw_endhostent | |
1193 | nw_endnetent | |
1194 | nw_endprotoent | |
1195 | nw_endservent | |
1196 | nw_gethostbyaddr | |
1197 | nw_gethostbyname | |
1198 | nw_gethostent | |
1199 | nw_gethostname | |
1200 | nw_getnetbyaddr | |
1201 | nw_getnetbyname | |
1202 | nw_getnetent | |
1203 | nw_getpeername | |
1204 | nw_getprotobyname | |
1205 | nw_getprotobynumber | |
1206 | nw_getprotoent | |
1207 | nw_getservbyname | |
1208 | nw_getservbyport | |
1209 | nw_getservent | |
1210 | nw_getsockname | |
1211 | nw_getsockopt | |
1212 | nw_inet_addr | |
1213 | nw_listen | |
1214 | nw_socket | |
1215 | nw_recv | |
1216 | nw_recvfrom | |
1217 | nw_select | |
1218 | nw_send | |
1219 | nw_sendto | |
1220 | nw_sethostent | |
1221 | nw_setnetent | |
1222 | nw_setprotoent | |
1223 | nw_setservent | |
3a0827a6 | 1224 | nw_setsockopt |
4d76e4b4 | 1225 | nw_inet_ntoa |
2986a63f JH |
1226 | nw_shutdown |
1227 | nw_crypt | |
1228 | nw_execvp | |
1229 | nw_kill | |
1230 | nw_Popen | |
1231 | nw_Pclose | |
1232 | nw_Pipe | |
1233 | nw_times | |
1234 | nw_waitpid | |
1235 | nw_getpid | |
1236 | nw_spawnvp | |
1237 | nw_os_id | |
1238 | nw_open_osfhandle | |
1239 | nw_get_osfhandle | |
1240 | nw_abort | |
1241 | nw_sleep | |
1242 | nw_wait | |
1243 | nw_dynaload | |
1244 | nw_strerror | |
1245 | fnFpSetMode | |
1246 | fnInsertHashListAddrs | |
1247 | fnGetHashListAddrs | |
1248 | Perl_deb | |
011f1a1a JH |
1249 | Perl_sv_setsv |
1250 | Perl_sv_catsv | |
1251 | Perl_sv_catpvn | |
1252 | Perl_sv_2pv | |
f355267c JH |
1253 | nw_freeenviron |
1254 | Remove_Thread_Ctx | |
7a95c549 | 1255 | )); |
2986a63f | 1256 | } |
22239a37 | 1257 | |
d2b25974 VK |
1258 | # records of type boot_module for statically linked modules (except Dynaloader) |
1259 | $static_ext =~ s/\//__/g; | |
1260 | $static_ext =~ s/\bDynaLoader\b//; | |
7a95c549 NC |
1261 | try_symbols(map {"boot_$_"} grep {/\S/} split /\s+/, $static_ext); |
1262 | try_symbols("init_Win32CORE") if $static_ext =~ /\bWin32CORE\b/; | |
9fb265f7 | 1263 | |
71afeaec NC |
1264 | if ($PLATFORM eq 'os2') { |
1265 | my (%mapped, @missing); | |
1266 | open MAP, 'miniperl.map' or die 'Cannot read miniperl.map'; | |
1267 | /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>; | |
1268 | close MAP or die 'Cannot close miniperl.map'; | |
1269 | ||
1270 | @missing = grep { !exists $mapped{$_} } | |
1271 | keys %export; | |
1272 | @missing = grep { !exists $exportperlmalloc{$_} } @missing; | |
1273 | delete $export{$_} foreach @missing; | |
1274 | } | |
1275 | ||
d6035849 NC |
1276 | ############################################################################### |
1277 | ||
1278 | # Now all symbols should be defined because next we are going to output them. | |
1279 | ||
1280 | # Start with platform specific headers: | |
1281 | ||
1282 | if ($PLATFORM =~ /^win(?:32|ce)$/) { | |
1283 | (my $dll = ($define{PERL_DLL} || "perl515")) =~ s/\.dll$//i; | |
1284 | print "LIBRARY $dll\n"; | |
1285 | # The DESCRIPTION module definition file statement is not supported | |
1286 | # by VC7 onwards. | |
1287 | if ($CCTYPE =~ /^(?:MSVC60|GCC|BORLAND)$/) { | |
1288 | print "DESCRIPTION 'Perl interpreter'\n"; | |
1289 | } | |
1290 | print "EXPORTS\n"; | |
1291 | } | |
1292 | elsif ($PLATFORM eq 'os2') { | |
1293 | (my $v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/; | |
1294 | $v .= '-thread' if $define{archname} =~ /-thread/; | |
1295 | (my $dll = $define{PERL_DLL}) =~ s/\.dll$//i; | |
1296 | $v .= "\@$define{perl_patchlevel}" if $define{perl_patchlevel}; | |
1297 | my $d = "DESCRIPTION '\@#perl5-porters\@perl.org:$v#\@ Perl interpreter, configured as $define{config_args}'"; | |
1298 | $d = substr($d, 0, 249) . "...'" if length $d > 253; | |
1299 | print <<"---EOP---"; | |
1300 | LIBRARY '$dll' INITINSTANCE TERMINSTANCE | |
1301 | $d | |
1302 | STACKSIZE 32768 | |
1303 | CODE LOADONCALL | |
1304 | DATA LOADONCALL NONSHARED MULTIPLE | |
1305 | EXPORTS | |
1306 | ---EOP--- | |
1307 | } | |
1308 | elsif ($PLATFORM eq 'aix') { | |
1309 | my $OSVER = `uname -v`; | |
1310 | chop $OSVER; | |
1311 | my $OSREL = `uname -r`; | |
1312 | chop $OSREL; | |
1313 | if ($OSVER > 4 || ($OSVER == 4 && $OSREL >= 3)) { | |
1314 | print "#! ..\n"; | |
1315 | } else { | |
1316 | print "#!\n"; | |
1317 | } | |
1318 | } | |
1319 | elsif ($PLATFORM eq 'netware') { | |
1320 | if ($FILETYPE eq 'def') { | |
1321 | print "LIBRARY perl515\n"; | |
1322 | print "DESCRIPTION 'Perl interpreter for NetWare'\n"; | |
1323 | print "EXPORTS\n"; | |
1324 | } | |
1325 | } | |
1326 | ||
1327 | # Then the symbols | |
549a6b10 | 1328 | |
7766f137 | 1329 | foreach my $symbol (sort keys %export) { |
18f68570 | 1330 | if ($PLATFORM =~ /^win(?:32|ce)$/) { |
549a6b10 | 1331 | $symbol = "_$symbol" if $CCTYPE eq 'BORLAND'; |
520c758a | 1332 | print "\t$symbol\n"; |
7766f137 GS |
1333 | } |
1334 | elsif ($PLATFORM eq 'os2') { | |
52e4c282 IZ |
1335 | printf qq( %-31s \@%s\n), |
1336 | qq("$symbol"), $ordinal{$symbol} || ++$sym_ord; | |
78232bc0 JH |
1337 | printf qq( %-31s \@%s\n), |
1338 | qq("$exportperlmalloc{$symbol}" = "$symbol"), | |
1339 | $ordinal{$exportperlmalloc{$symbol}} || ++$sym_ord | |
1340 | if $exportperlmalloc and exists $exportperlmalloc{$symbol}; | |
7766f137 | 1341 | } |
ed463ba8 NC |
1342 | elsif ($PLATFORM eq 'netware') { |
1343 | print "\t$symbol,\n"; | |
1344 | } else { | |
549a6b10 JH |
1345 | print "$symbol\n"; |
1346 | } | |
ed463ba8 NC |
1347 | } |
1348 | ||
1349 | # Then platform specific footers. | |
1350 | ||
1351 | if ($PLATFORM eq 'os2') { | |
1352 | print <<EOP; | |
1353 | dll_perlmain=main | |
1354 | fill_extLibpath | |
1355 | dir_subst | |
1356 | Perl_OS2_handler_install | |
1357 | ||
1358 | ; LAST_ORDINAL=$sym_ord | |
1359 | EOP | |
549a6b10 JH |
1360 | } |
1361 | ||
1362 | 1; |