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