Commit | Line | Data |
---|---|---|
0a753a76 | 1 | #!../miniperl |
2 | ||
3 | # Written: 10 April 1996 Gary Ng (71564.1743@compuserve.com) | |
4 | ||
5 | # Create the export list for perl. | |
6 | # Needed by WIN32 for creating perl.dll | |
7 | # based on perl_exp.SH in the main perl distribution directory | |
8 | ||
9 | # This simple program relys on 'global.sym' being up to date | |
10 | # with all of the global symbols that a dynamicly link library | |
11 | # might want to access. | |
12 | ||
13 | # There is some symbol defined in global.sym and interp.sym | |
14 | # that does not present in the WIN32 port but there is no easy | |
84902520 | 15 | # way to find them so I just put a exception list here |
0a753a76 | 16 | |
910dfcc8 | 17 | my $CCTYPE = "MSVC"; # default |
18 | ||
19 | while (@ARGV) | |
d55594ae | 20 | { |
21 | my $flag = shift; | |
22 | $define{$1} = 1 if ($flag =~ /^-D(\w+)$/); | |
910dfcc8 | 23 | $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/); |
d55594ae | 24 | } |
25 | ||
bbc8f9de | 26 | open(CFG,'config.h') || die "Cannot open config.h:$!"; |
27 | while (<CFG>) | |
28 | { | |
29 | $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/; | |
30 | } | |
31 | close(CFG); | |
32 | ||
d55594ae | 33 | warn join(' ',keys %define)."\n"; |
34 | ||
04dc04aa | 35 | if ($CCTYPE ne 'GCC') |
36 | { | |
37 | print "LIBRARY Perl\n"; | |
38 | print "DESCRIPTION 'Perl interpreter, export autogenerated'\n"; | |
39 | print "CODE LOADONCALL\n"; | |
40 | print "DATA LOADONCALL NONSHARED MULTIPLE\n"; | |
41 | } | |
22239a37 | 42 | else |
43 | { | |
44 | $define{'PERL_GLOBAL_STRUCT'} = 1; | |
45 | $define{'MULTIPLICITY'} = 1; | |
46 | } | |
47 | ||
bbc8f9de | 48 | print "EXPORTS\n"; |
49 | ||
22239a37 | 50 | my %skip; |
51 | my %export; | |
52 | ||
53 | sub skip_symbols | |
54 | { | |
55 | my $list = shift; | |
56 | foreach my $symbol (@$list) | |
57 | { | |
58 | $skip{$symbol} = 1; | |
59 | } | |
60 | } | |
61 | ||
62 | sub emit_symbols | |
63 | { | |
64 | my $list = shift; | |
65 | foreach my $symbol (@$list) | |
66 | { | |
67 | emit_symbol($symbol) unless exists $skip{$symbol}; | |
68 | } | |
69 | } | |
70 | ||
71 | skip_symbols [qw( | |
72 | Perl_statusvalue_vms | |
9d8a25dc | 73 | Perl_archpat_auto |
0a753a76 | 74 | Perl_block_type |
9d8a25dc | 75 | Perl_bostr |
0a753a76 | 76 | Perl_additem |
77 | Perl_cast_ulong | |
78 | Perl_check_uni | |
79 | Perl_checkcomma | |
80 | Perl_chsize | |
81 | Perl_ck_aelem | |
9d8a25dc | 82 | Perl_colors |
83 | Perl_colorset | |
0a753a76 | 84 | Perl_cryptseen |
85 | Perl_cx_dump | |
9d8a25dc | 86 | Perl_DBcv |
0a753a76 | 87 | Perl_do_ipcctl |
88 | Perl_do_ipcget | |
89 | Perl_do_msgrcv | |
90 | Perl_do_msgsnd | |
91 | Perl_do_semop | |
92 | Perl_do_shmio | |
93 | Perl_doeval | |
94 | Perl_dofindlabel | |
95 | Perl_dopoptoeval | |
96 | Perl_dump_eval | |
97 | Perl_dump_fds | |
98 | Perl_dump_form | |
99 | Perl_dump_gv | |
100 | Perl_dump_mstats | |
101 | Perl_dump_op | |
102 | Perl_dump_packsubs | |
103 | Perl_dump_pm | |
104 | Perl_dump_sub | |
105 | Perl_expectterm | |
76e3520e | 106 | Perl_error_no |
9d8a25dc | 107 | Perl_extralen |
0a753a76 | 108 | Perl_fetch_gv |
109 | Perl_fetch_io | |
110 | Perl_force_ident | |
111 | Perl_force_next | |
112 | Perl_force_word | |
9d8a25dc | 113 | Perl_generation |
0a753a76 | 114 | Perl_hv_stashpv |
9d8a25dc | 115 | Perl_in_clean_all |
116 | Perl_in_clean_objs | |
0a753a76 | 117 | Perl_intuit_more |
d55594ae | 118 | Perl_init_thread_intern |
0a753a76 | 119 | Perl_know_next |
9d8a25dc | 120 | Perl_lastgotoprobe |
121 | Perl_linestart | |
122 | Perl_modcount | |
0a753a76 | 123 | Perl_modkids |
124 | Perl_mstats | |
125 | Perl_my_bzero | |
126 | Perl_my_htonl | |
127 | Perl_my_ntohl | |
128 | Perl_my_swap | |
129 | Perl_my_chsize | |
130 | Perl_newXSUB | |
131 | Perl_no_fh_allowed | |
132 | Perl_no_op | |
133 | Perl_nointrp | |
134 | Perl_nomem | |
9d8a25dc | 135 | Perl_pending_ident |
0a753a76 | 136 | Perl_pp_cswitch |
137 | Perl_pp_entersubr | |
138 | Perl_pp_evalonce | |
139 | Perl_pp_interp | |
140 | Perl_pp_map | |
141 | Perl_pp_nswitch | |
142 | Perl_q | |
d55594ae | 143 | Perl_rcsid |
0a753a76 | 144 | Perl_reall_srchlen |
9d8a25dc | 145 | Perl_reg_eval_set |
146 | Perl_reg_flags | |
147 | Perl_reg_start_tmp | |
148 | Perl_reg_start_tmpl | |
149 | Perl_regbol | |
150 | Perl_regcc | |
151 | Perl_regcode | |
152 | Perl_regdata | |
153 | Perl_regdummy | |
0a753a76 | 154 | Perl_regdump |
155 | Perl_regfold | |
9d8a25dc | 156 | Perl_regendp |
157 | Perl_regeol | |
158 | Perl_regflags | |
159 | Perl_regindent | |
160 | Perl_reginput | |
161 | Perl_reglastparen | |
0a753a76 | 162 | Perl_regmyendp |
163 | Perl_regmyp_size | |
164 | Perl_regmystartp | |
165 | Perl_regnarrate | |
9d8a25dc | 166 | Perl_regnaughty |
167 | Perl_regnpar | |
168 | Perl_regparse | |
169 | Perl_regprecomp | |
170 | Perl_regprev | |
171 | Perl_regprogram | |
0a753a76 | 172 | Perl_regprop |
9d8a25dc | 173 | Perl_regsawback |
174 | Perl_regseen | |
175 | Perl_regsize | |
176 | Perl_regstartp | |
177 | Perl_regtill | |
178 | Perl_regxend | |
179 | Perl_rx | |
0a753a76 | 180 | Perl_same_dirent |
181 | Perl_saw_return | |
182 | Perl_scan_const | |
183 | Perl_scan_formline | |
184 | Perl_scan_heredoc | |
185 | Perl_scan_ident | |
186 | Perl_scan_inputsymbol | |
187 | Perl_scan_pat | |
188 | Perl_scan_prefix | |
189 | Perl_scan_str | |
190 | Perl_scan_subst | |
191 | Perl_scan_trans | |
192 | Perl_scan_word | |
9d8a25dc | 193 | Perl_seen_zerolen |
68dc0745 | 194 | Perl_setenv_getix |
0a753a76 | 195 | Perl_skipspace |
76e3520e | 196 | Perl_sort_mutex |
9d8a25dc | 197 | Perl_sortcxix |
0a753a76 | 198 | Perl_sublex_done |
9d8a25dc | 199 | Perl_sublex_info |
0a753a76 | 200 | Perl_sublex_start |
0a753a76 | 201 | Perl_sv_ref |
202 | Perl_sv_setptrobj | |
203 | Perl_timesbuf | |
204 | Perl_too_few_arguments | |
205 | Perl_too_many_arguments | |
206 | Perl_unlnk | |
0a753a76 | 207 | Perl_watch |
208 | Perl_yyname | |
209 | Perl_yyrule | |
210 | allgvs | |
211 | curblock | |
0a753a76 | 212 | curcsv |
0a753a76 | 213 | lastretstr |
214 | mystack_mark | |
215 | perl_init_ext | |
216 | perl_requirepv | |
0a753a76 | 217 | stack |
ff0cee69 | 218 | statusvalue_vms |
0a753a76 | 219 | Perl_safexcalloc |
220 | Perl_safexmalloc | |
221 | Perl_safexfree | |
222 | Perl_safexrealloc | |
68dc0745 | 223 | Perl_my_memcmp |
8b10511d | 224 | Perl_my_memset |
68dc0745 | 225 | Perl_cshlen |
226 | Perl_cshname | |
0da3735a | 227 | Perl_opsave |
22239a37 | 228 | )]; |
0a753a76 | 229 | |
c69f112c | 230 | |
bbc8f9de | 231 | if ($define{'MYMALLOC'}) |
232 | { | |
22239a37 | 233 | skip_symbols [qw( |
234 | Perl_safefree | |
235 | Perl_safemalloc | |
236 | Perl_saferealloc | |
237 | Perl_safecalloc)]; | |
238 | emit_symbols [qw( | |
239 | Perl_malloc | |
240 | Perl_free | |
241 | Perl_realloc | |
242 | Perl_calloc)]; | |
bbc8f9de | 243 | } |
244 | ||
d55594ae | 245 | unless ($define{'USE_THREADS'}) |
246 | { | |
22239a37 | 247 | skip_symbols [qw( |
d55594ae | 248 | Perl_condpair_magic |
249 | Perl_thr_key | |
250 | Perl_sv_mutex | |
251 | Perl_malloc_mutex | |
252 | Perl_eval_mutex | |
253 | Perl_eval_cond | |
254 | Perl_eval_owner | |
255 | Perl_threads_mutex | |
32f822de | 256 | Perl_new_struct_thread |
257 | Perl_nthreads | |
d55594ae | 258 | Perl_nthreads_cond |
32f822de | 259 | Perl_per_thread_magicals |
d4cce5f1 | 260 | Perl_thread_create |
93bce2dc | 261 | Perl_threadnum |
d4cce5f1 | 262 | Perl_find_threadsv |
263 | Perl_threadsv_names | |
32f822de | 264 | Perl_thrsv |
d55594ae | 265 | Perl_unlock_condpair |
266 | Perl_vtbl_mutex | |
267 | Perl_magic_mutexfree | |
268 | Perl_sv_iv | |
269 | Perl_sv_nv | |
270 | Perl_sv_true | |
271 | Perl_sv_uv | |
272 | Perl_sv_pvn | |
22239a37 | 273 | Perl_newRV_noinc)]; |
910dfcc8 | 274 | } |
d4cce5f1 | 275 | |
910dfcc8 | 276 | unless ($define{'FAKE_THREADS'}) |
277 | { | |
278 | skip_symbols [qw(Perl_curthr)]; | |
d55594ae | 279 | } |
280 | ||
22239a37 | 281 | sub readvar |
282 | { | |
283 | my $file = shift; | |
284 | open(VARS,$file) || die "Cannot open $file:$!"; | |
285 | my @syms; | |
286 | while (<VARS>) | |
287 | { | |
288 | # All symbols have a Perl_ prefix because that's what embed.h | |
289 | # sticks in front of them. | |
83921c94 | 290 | push(@syms,"Perl_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/); |
22239a37 | 291 | } |
292 | close(VARS); | |
293 | return \@syms; | |
294 | } | |
295 | ||
d4cce5f1 | 296 | if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'}) |
d55594ae | 297 | { |
22239a37 | 298 | my $thrd = readvar("../thrdvar.h"); |
299 | skip_symbols $thrd; | |
d55594ae | 300 | } |
301 | ||
d4cce5f1 | 302 | if ($define{'MULTIPLICITY'}) |
d55594ae | 303 | { |
22239a37 | 304 | my $interp = readvar("../intrpvar.h"); |
305 | skip_symbols $interp; | |
306 | } | |
307 | ||
308 | if ($define{'PERL_GLOBAL_STRUCT'}) | |
309 | { | |
310 | my $global = readvar("../perlvars.h"); | |
311 | skip_symbols $global; | |
d4cce5f1 | 312 | } |
d55594ae | 313 | |
36c15d3f | 314 | unless ($define{'DEBUGGING'}) |
315 | { | |
22239a37 | 316 | skip_symbols [qw( |
fea7140c | 317 | Perl_deb |
318 | Perl_deb_growlevel | |
319 | Perl_debop | |
320 | Perl_debprofdump | |
321 | Perl_debstack | |
322 | Perl_debstackptrs | |
22239a37 | 323 | Perl_runops_debug |
324 | Perl_sv_peek | |
325 | Perl_watchaddr | |
326 | Perl_watchok)]; | |
36c15d3f | 327 | } |
328 | ||
26618a56 | 329 | if ($define{'HAVE_DES_FCRYPT'}) |
330 | { | |
331 | emit_symbols [qw(win32_crypt)]; | |
332 | } | |
333 | ||
0a753a76 | 334 | open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!; |
22239a37 | 335 | while (<GLOBAL>) |
336 | { | |
337 | next if (!/^[A-Za-z]/); | |
338 | next if (/_amg[ \t]*$/); | |
339 | # All symbols have a Perl_ prefix because that's what embed.h | |
340 | # sticks in front of them. | |
341 | chomp($_); | |
342 | my $symbol = "Perl_$_"; | |
343 | emit_symbol($symbol) unless exists $skip{$symbol}; | |
344 | } | |
0a753a76 | 345 | close(GLOBAL); |
346 | ||
347 | # also add symbols from interp.sym | |
348 | # They are only needed if -DMULTIPLICITY is not set but it | |
349 | # doesn't hurt to include them anyway. | |
350 | # these don't have Perl prefix | |
351 | ||
22239a37 | 352 | if ($define{'PERL_GLOBAL_STRUCT'}) |
353 | { | |
354 | emit_symbol( ($CCTYPE eq 'GCC') ? 'Perl_GetVars' : 'Perl_VarsPtr') | |
355 | } | |
356 | else | |
357 | { | |
358 | my $glob = readvar("../perlvars.h"); | |
359 | emit_symbols $glob; | |
360 | } | |
361 | ||
362 | unless ($define{'MULTIPLICITY'}) | |
363 | { | |
364 | my $glob = readvar("../intrpvar.h"); | |
365 | emit_symbols $glob; | |
366 | } | |
0a753a76 | 367 | |
22239a37 | 368 | unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'}) |
369 | { | |
370 | my $glob = readvar("../thrdvar.h"); | |
371 | emit_symbols $glob; | |
372 | } | |
0a753a76 | 373 | |
374 | while (<DATA>) { | |
375 | my $symbol; | |
376 | next if (!/^[A-Za-z]/); | |
377 | next if (/^#/); | |
a868473f | 378 | s/\r//g; |
22239a37 | 379 | chomp($_); |
0a753a76 | 380 | $symbol = $_; |
22239a37 | 381 | next if exists $skip{$symbol}; |
3e3baf6d | 382 | emit_symbol($symbol); |
383 | } | |
384 | ||
22239a37 | 385 | foreach my $symbol (sort keys %export) |
386 | { | |
3e3baf6d | 387 | if ($CCTYPE eq "BORLAND") { |
388 | # workaround Borland quirk by exporting both the straight | |
84902520 | 389 | # name and a name with leading underscore. Note the |
390 | # alias *must* come after the symbol itself, if both | |
391 | # are to be exported. (Linker bug?) | |
3e3baf6d | 392 | print "\t_$symbol\n"; |
84902520 | 393 | print "\t$symbol = _$symbol\n"; |
3e3baf6d | 394 | } |
22239a37 | 395 | elsif ($CCTYPE eq 'GCC') { |
396 | # Symbols have leading _ whole process is $%£"% slow | |
397 | # so skip aliases for now | |
398 | print "\t$symbol\n"; | |
399 | } | |
3e3baf6d | 400 | else { |
84902520 | 401 | # for binary coexistence, export both the symbol and |
402 | # alias with leading underscore | |
3e3baf6d | 403 | print "\t$symbol\n"; |
84902520 | 404 | print "\t_$symbol = $symbol\n"; |
3e3baf6d | 405 | } |
22239a37 | 406 | } |
407 | ||
408 | sub emit_symbol { | |
409 | my $symbol = shift; | |
410 | chomp($symbol); | |
411 | $export{$symbol} = 1; | |
3e3baf6d | 412 | } |
0a753a76 | 413 | |
414 | 1; | |
415 | __DATA__ | |
416 | # extra globals not included above. | |
417 | perl_init_i18nl10n | |
418 | perl_init_ext | |
419 | perl_alloc | |
420 | perl_construct | |
421 | perl_destruct | |
422 | perl_free | |
423 | perl_parse | |
424 | perl_run | |
425 | perl_get_sv | |
426 | perl_get_av | |
427 | perl_get_hv | |
428 | perl_get_cv | |
429 | perl_call_argv | |
430 | perl_call_pv | |
431 | perl_call_method | |
432 | perl_call_sv | |
10dd38fc | 433 | perl_require_pv |
434 | perl_eval_pv | |
435 | perl_eval_sv | |
d28b3ca3 | 436 | boot_DynaLoader |
d55594ae | 437 | Perl_thread_create |
68dc0745 | 438 | win32_errno |
96e4d5b1 | 439 | win32_environ |
68dc0745 | 440 | win32_stdin |
441 | win32_stdout | |
96e4d5b1 | 442 | win32_stderr |
68dc0745 | 443 | win32_ferror |
444 | win32_feof | |
445 | win32_strerror | |
446 | win32_fprintf | |
447 | win32_printf | |
448 | win32_vfprintf | |
96e4d5b1 | 449 | win32_vprintf |
68dc0745 | 450 | win32_fread |
451 | win32_fwrite | |
452 | win32_fopen | |
453 | win32_fdopen | |
454 | win32_freopen | |
455 | win32_fclose | |
456 | win32_fputs | |
457 | win32_fputc | |
458 | win32_ungetc | |
459 | win32_getc | |
460 | win32_fileno | |
461 | win32_clearerr | |
462 | win32_fflush | |
463 | win32_ftell | |
464 | win32_fseek | |
465 | win32_fgetpos | |
466 | win32_fsetpos | |
467 | win32_rewind | |
468 | win32_tmpfile | |
469 | win32_abort | |
470 | win32_fstat | |
96e4d5b1 | 471 | win32_stat |
68dc0745 | 472 | win32_pipe |
473 | win32_popen | |
474 | win32_pclose | |
475 | win32_setmode | |
96e4d5b1 | 476 | win32_lseek |
477 | win32_tell | |
68dc0745 | 478 | win32_dup |
479 | win32_dup2 | |
96e4d5b1 | 480 | win32_open |
481 | win32_close | |
482 | win32_eof | |
68dc0745 | 483 | win32_read |
484 | win32_write | |
3e3baf6d | 485 | win32_spawnvp |
5aabfad6 | 486 | win32_mkdir |
487 | win32_rmdir | |
488 | win32_chdir | |
c90c0ff4 | 489 | win32_flock |
6890e559 | 490 | win32_execvp |
54310121 | 491 | win32_htons |
492 | win32_ntohs | |
493 | win32_htonl | |
494 | win32_ntohl | |
495 | win32_inet_addr | |
496 | win32_inet_ntoa | |
497 | win32_socket | |
498 | win32_bind | |
499 | win32_listen | |
500 | win32_accept | |
501 | win32_connect | |
502 | win32_send | |
503 | win32_sendto | |
504 | win32_recv | |
505 | win32_recvfrom | |
506 | win32_shutdown | |
3a25acb4 | 507 | win32_closesocket |
54310121 | 508 | win32_ioctlsocket |
509 | win32_setsockopt | |
510 | win32_getsockopt | |
511 | win32_getpeername | |
512 | win32_getsockname | |
513 | win32_gethostname | |
514 | win32_gethostbyname | |
515 | win32_gethostbyaddr | |
516 | win32_getprotobyname | |
517 | win32_getprotobynumber | |
518 | win32_getservbyname | |
519 | win32_getservbyport | |
520 | win32_select | |
521 | win32_endhostent | |
522 | win32_endnetent | |
523 | win32_endprotoent | |
524 | win32_endservent | |
525 | win32_getnetent | |
526 | win32_getnetbyname | |
527 | win32_getnetbyaddr | |
528 | win32_getprotoent | |
529 | win32_getservent | |
530 | win32_sethostent | |
531 | win32_setnetent | |
532 | win32_setprotoent | |
533 | win32_setservent | |
ad2e33dc | 534 | win32_getenv |
84902520 | 535 | win32_perror |
536 | win32_setbuf | |
537 | win32_setvbuf | |
538 | win32_flushall | |
539 | win32_fcloseall | |
540 | win32_fgets | |
541 | win32_gets | |
542 | win32_fgetc | |
543 | win32_putc | |
544 | win32_puts | |
545 | win32_getchar | |
546 | win32_putchar | |
547 | win32_malloc | |
548 | win32_calloc | |
549 | win32_realloc | |
550 | win32_free | |
f3986ebb | 551 | win32_sleep |
552 | win32_times | |
553 | win32_alarm | |
65e48ea9 | 554 | win32_open_osfhandle |
555 | win32_get_osfhandle | |
f998180f | 556 | win32_ioctl |
ad0751ec | 557 | win32_utime |
22fae026 | 558 | win32_wait |
559 | win32_str_os_error | |
ad2e33dc | 560 | Perl_win32_init |
f3986ebb | 561 | Perl_init_os_extras |
9811a7d7 | 562 | Perl_getTHR |
0fefa03b | 563 | Perl_setTHR |
84902520 | 564 | RunPerl |
22239a37 | 565 |