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 | |
d55594ae | 17 | while (@ARGV && $ARGV[0] =~ /^-/) |
18 | { | |
19 | my $flag = shift; | |
20 | $define{$1} = 1 if ($flag =~ /^-D(\w+)$/); | |
21 | } | |
22 | ||
bbc8f9de | 23 | open(CFG,'config.h') || die "Cannot open config.h:$!"; |
24 | while (<CFG>) | |
25 | { | |
26 | $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/; | |
27 | } | |
28 | close(CFG); | |
29 | ||
d55594ae | 30 | warn join(' ',keys %define)."\n"; |
31 | ||
3e3baf6d | 32 | my $CCTYPE = shift || "MSVC"; |
33 | ||
04dc04aa | 34 | if ($CCTYPE ne 'GCC') |
35 | { | |
36 | print "LIBRARY Perl\n"; | |
37 | print "DESCRIPTION 'Perl interpreter, export autogenerated'\n"; | |
38 | print "CODE LOADONCALL\n"; | |
39 | print "DATA LOADONCALL NONSHARED MULTIPLE\n"; | |
40 | } | |
bbc8f9de | 41 | print "EXPORTS\n"; |
42 | ||
0a753a76 | 43 | $skip_sym=<<'!END!OF!SKIP!'; |
0a753a76 | 44 | Perl_block_type |
0a753a76 | 45 | Perl_additem |
46 | Perl_cast_ulong | |
47 | Perl_check_uni | |
48 | Perl_checkcomma | |
49 | Perl_chsize | |
50 | Perl_ck_aelem | |
51 | Perl_cryptseen | |
52 | Perl_cx_dump | |
53 | Perl_deb | |
54 | Perl_deb_growlevel | |
55 | Perl_debop | |
56 | Perl_debprofdump | |
57 | Perl_debstack | |
58 | Perl_debstackptrs | |
59 | Perl_do_ipcctl | |
60 | Perl_do_ipcget | |
61 | Perl_do_msgrcv | |
62 | Perl_do_msgsnd | |
63 | Perl_do_semop | |
64 | Perl_do_shmio | |
65 | Perl_doeval | |
66 | Perl_dofindlabel | |
67 | Perl_dopoptoeval | |
68 | Perl_dump_eval | |
69 | Perl_dump_fds | |
70 | Perl_dump_form | |
71 | Perl_dump_gv | |
72 | Perl_dump_mstats | |
73 | Perl_dump_op | |
74 | Perl_dump_packsubs | |
75 | Perl_dump_pm | |
76 | Perl_dump_sub | |
77 | Perl_expectterm | |
78 | Perl_fetch_gv | |
79 | Perl_fetch_io | |
80 | Perl_force_ident | |
81 | Perl_force_next | |
82 | Perl_force_word | |
83 | Perl_hv_stashpv | |
84 | Perl_intuit_more | |
d55594ae | 85 | Perl_init_thread_intern |
0a753a76 | 86 | Perl_know_next |
87 | Perl_modkids | |
88 | Perl_mstats | |
89 | Perl_my_bzero | |
90 | Perl_my_htonl | |
91 | Perl_my_ntohl | |
92 | Perl_my_swap | |
93 | Perl_my_chsize | |
94 | Perl_newXSUB | |
95 | Perl_no_fh_allowed | |
96 | Perl_no_op | |
97 | Perl_nointrp | |
98 | Perl_nomem | |
99 | Perl_pp_cswitch | |
100 | Perl_pp_entersubr | |
101 | Perl_pp_evalonce | |
102 | Perl_pp_interp | |
103 | Perl_pp_map | |
104 | Perl_pp_nswitch | |
105 | Perl_q | |
d55594ae | 106 | Perl_rcsid |
0a753a76 | 107 | Perl_reall_srchlen |
108 | Perl_regdump | |
109 | Perl_regfold | |
110 | Perl_regmyendp | |
111 | Perl_regmyp_size | |
112 | Perl_regmystartp | |
113 | Perl_regnarrate | |
114 | Perl_regprop | |
115 | Perl_same_dirent | |
116 | Perl_saw_return | |
117 | Perl_scan_const | |
118 | Perl_scan_formline | |
119 | Perl_scan_heredoc | |
120 | Perl_scan_ident | |
121 | Perl_scan_inputsymbol | |
122 | Perl_scan_pat | |
123 | Perl_scan_prefix | |
124 | Perl_scan_str | |
125 | Perl_scan_subst | |
126 | Perl_scan_trans | |
127 | Perl_scan_word | |
68dc0745 | 128 | Perl_setenv_getix |
0a753a76 | 129 | Perl_skipspace |
130 | Perl_sublex_done | |
131 | Perl_sublex_start | |
0a753a76 | 132 | Perl_sv_ref |
133 | Perl_sv_setptrobj | |
134 | Perl_timesbuf | |
135 | Perl_too_few_arguments | |
136 | Perl_too_many_arguments | |
137 | Perl_unlnk | |
138 | Perl_wait4pid | |
139 | Perl_watch | |
140 | Perl_yyname | |
141 | Perl_yyrule | |
142 | allgvs | |
143 | curblock | |
0a753a76 | 144 | curcsv |
0a753a76 | 145 | lastretstr |
146 | mystack_mark | |
147 | perl_init_ext | |
148 | perl_requirepv | |
0a753a76 | 149 | stack |
ff0cee69 | 150 | statusvalue_vms |
0a753a76 | 151 | Perl_safexcalloc |
152 | Perl_safexmalloc | |
153 | Perl_safexfree | |
154 | Perl_safexrealloc | |
68dc0745 | 155 | Perl_my_memcmp |
8b10511d | 156 | Perl_my_memset |
68dc0745 | 157 | Perl_cshlen |
158 | Perl_cshname | |
0da3735a | 159 | Perl_opsave |
0a753a76 | 160 | !END!OF!SKIP! |
161 | ||
c69f112c | 162 | if ($CCTYPE eq 'GCC') |
163 | { | |
164 | $skip_sym .= "Perl_na\n"; | |
165 | } | |
166 | ||
bbc8f9de | 167 | if ($define{'MYMALLOC'}) |
168 | { | |
169 | $skip_sym .= <<'!END!OF!SKIP!'; | |
170 | Perl_safefree | |
171 | Perl_safemalloc | |
172 | Perl_saferealloc | |
173 | Perl_safecalloc | |
174 | !END!OF!SKIP! | |
175 | emit_symbol('Perl_malloc'); | |
176 | emit_symbol('Perl_free'); | |
177 | emit_symbol('Perl_realloc'); | |
178 | emit_symbol('Perl_calloc'); | |
179 | } | |
180 | ||
d55594ae | 181 | unless ($define{'USE_THREADS'}) |
182 | { | |
183 | $skip_sym .= <<'!END!OF!SKIP!'; | |
184 | Perl_condpair_magic | |
185 | Perl_thr_key | |
186 | Perl_sv_mutex | |
187 | Perl_malloc_mutex | |
188 | Perl_eval_mutex | |
189 | Perl_eval_cond | |
190 | Perl_eval_owner | |
191 | Perl_threads_mutex | |
32f822de | 192 | Perl_new_struct_thread |
193 | Perl_nthreads | |
d55594ae | 194 | Perl_nthreads_cond |
32f822de | 195 | Perl_per_thread_magicals |
d4cce5f1 | 196 | Perl_thread_create |
197 | Perl_find_threadsv | |
198 | Perl_threadsv_names | |
32f822de | 199 | Perl_thrsv |
d55594ae | 200 | Perl_unlock_condpair |
201 | Perl_vtbl_mutex | |
202 | Perl_magic_mutexfree | |
203 | Perl_sv_iv | |
204 | Perl_sv_nv | |
205 | Perl_sv_true | |
206 | Perl_sv_uv | |
207 | Perl_sv_pvn | |
208 | Perl_newRV_noinc | |
209 | !END!OF!SKIP! | |
d4cce5f1 | 210 | |
d55594ae | 211 | } |
212 | ||
d4cce5f1 | 213 | if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'}) |
d55594ae | 214 | { |
d4cce5f1 | 215 | open(THREAD,"<../thrdvar.h") || die "Cannot open ../thrdvar.h:$!"; |
d55594ae | 216 | while (<THREAD>) |
217 | { | |
d4cce5f1 | 218 | if (/\bPERLVARI?\(T(\w+)/) |
219 | { | |
220 | $skip_sym .= "Perl_".$1."\n"; | |
221 | } | |
d55594ae | 222 | } |
223 | close(THREAD); | |
d55594ae | 224 | } |
225 | ||
d4cce5f1 | 226 | if ($define{'MULTIPLICITY'}) |
d55594ae | 227 | { |
d4cce5f1 | 228 | open(THREAD,"<../intrpvar.h") || die "Cannot open ../intrpvar.h:$!"; |
229 | while (<THREAD>) | |
230 | { | |
231 | if (/\bPERLVARI?\(I(\w+)/) | |
232 | { | |
233 | $skip_sym .= "Perl_".$1."\n"; | |
234 | } | |
235 | } | |
236 | close(THREAD); | |
237 | } | |
d55594ae | 238 | |
0a753a76 | 239 | # All symbols have a Perl_ prefix because that's what embed.h |
240 | # sticks in front of them. | |
241 | ||
242 | ||
0a753a76 | 243 | open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!; |
244 | while (<GLOBAL>) { | |
245 | my $symbol; | |
246 | next if (!/^[A-Za-z]/); | |
247 | next if (/_amg[ \t]*$/); | |
248 | $symbol = "Perl_$_"; | |
249 | next if ($skip_sym =~ m/$symbol/m); | |
3e3baf6d | 250 | emit_symbol($symbol); |
251 | } | |
0a753a76 | 252 | close(GLOBAL); |
253 | ||
254 | # also add symbols from interp.sym | |
255 | # They are only needed if -DMULTIPLICITY is not set but it | |
256 | # doesn't hurt to include them anyway. | |
257 | # these don't have Perl prefix | |
258 | ||
259 | open (INTERP, "<../interp.sym") || die "failed to open interp.sym" . $!; | |
260 | while (<INTERP>) { | |
261 | my $symbol; | |
262 | next if (!/^[A-Za-z]/); | |
263 | next if (/_amg[ \t]*$/); | |
264 | $symbol = $_; | |
265 | next if ($skip_sym =~ m/$symbol/m); | |
266 | #print "\t$symbol"; | |
3e3baf6d | 267 | emit_symbol("Perl_" . $symbol); |
268 | } | |
0a753a76 | 269 | |
270 | #close(INTERP); | |
271 | ||
272 | while (<DATA>) { | |
273 | my $symbol; | |
274 | next if (!/^[A-Za-z]/); | |
275 | next if (/^#/); | |
a868473f | 276 | s/\r//g; |
0a753a76 | 277 | $symbol = $_; |
278 | next if ($skip_sym =~ m/^$symbol/m); | |
d55594ae | 279 | $symbol = "Perl_".$symbol if ($define{'USE_THISPTR'} |
280 | && $symbol =~ /^perl/); | |
3e3baf6d | 281 | emit_symbol($symbol); |
282 | } | |
283 | ||
284 | sub emit_symbol { | |
285 | my $symbol = shift; | |
286 | chomp $symbol; | |
287 | if ($CCTYPE eq "BORLAND") { | |
288 | # workaround Borland quirk by exporting both the straight | |
84902520 | 289 | # name and a name with leading underscore. Note the |
290 | # alias *must* come after the symbol itself, if both | |
291 | # are to be exported. (Linker bug?) | |
3e3baf6d | 292 | print "\t_$symbol\n"; |
84902520 | 293 | print "\t$symbol = _$symbol\n"; |
3e3baf6d | 294 | } |
295 | else { | |
84902520 | 296 | # for binary coexistence, export both the symbol and |
297 | # alias with leading underscore | |
3e3baf6d | 298 | print "\t$symbol\n"; |
84902520 | 299 | print "\t_$symbol = $symbol\n"; |
3e3baf6d | 300 | } |
301 | } | |
0a753a76 | 302 | |
303 | 1; | |
304 | __DATA__ | |
305 | # extra globals not included above. | |
306 | perl_init_i18nl10n | |
307 | perl_init_ext | |
308 | perl_alloc | |
309 | perl_construct | |
310 | perl_destruct | |
311 | perl_free | |
312 | perl_parse | |
313 | perl_run | |
314 | perl_get_sv | |
315 | perl_get_av | |
316 | perl_get_hv | |
317 | perl_get_cv | |
318 | perl_call_argv | |
319 | perl_call_pv | |
320 | perl_call_method | |
321 | perl_call_sv | |
10dd38fc | 322 | perl_require_pv |
323 | perl_eval_pv | |
324 | perl_eval_sv | |
d28b3ca3 | 325 | boot_DynaLoader |
d55594ae | 326 | Perl_thread_create |
68dc0745 | 327 | win32_errno |
96e4d5b1 | 328 | win32_environ |
68dc0745 | 329 | win32_stdin |
330 | win32_stdout | |
96e4d5b1 | 331 | win32_stderr |
68dc0745 | 332 | win32_ferror |
333 | win32_feof | |
334 | win32_strerror | |
335 | win32_fprintf | |
336 | win32_printf | |
337 | win32_vfprintf | |
96e4d5b1 | 338 | win32_vprintf |
68dc0745 | 339 | win32_fread |
340 | win32_fwrite | |
341 | win32_fopen | |
342 | win32_fdopen | |
343 | win32_freopen | |
344 | win32_fclose | |
345 | win32_fputs | |
346 | win32_fputc | |
347 | win32_ungetc | |
348 | win32_getc | |
349 | win32_fileno | |
350 | win32_clearerr | |
351 | win32_fflush | |
352 | win32_ftell | |
353 | win32_fseek | |
354 | win32_fgetpos | |
355 | win32_fsetpos | |
356 | win32_rewind | |
357 | win32_tmpfile | |
358 | win32_abort | |
359 | win32_fstat | |
96e4d5b1 | 360 | win32_stat |
68dc0745 | 361 | win32_pipe |
362 | win32_popen | |
363 | win32_pclose | |
364 | win32_setmode | |
96e4d5b1 | 365 | win32_lseek |
366 | win32_tell | |
68dc0745 | 367 | win32_dup |
368 | win32_dup2 | |
96e4d5b1 | 369 | win32_open |
370 | win32_close | |
371 | win32_eof | |
68dc0745 | 372 | win32_read |
373 | win32_write | |
3e3baf6d | 374 | win32_spawnvp |
5aabfad6 | 375 | win32_mkdir |
376 | win32_rmdir | |
377 | win32_chdir | |
c90c0ff4 | 378 | win32_flock |
6890e559 | 379 | win32_execvp |
54310121 | 380 | win32_htons |
381 | win32_ntohs | |
382 | win32_htonl | |
383 | win32_ntohl | |
384 | win32_inet_addr | |
385 | win32_inet_ntoa | |
386 | win32_socket | |
387 | win32_bind | |
388 | win32_listen | |
389 | win32_accept | |
390 | win32_connect | |
391 | win32_send | |
392 | win32_sendto | |
393 | win32_recv | |
394 | win32_recvfrom | |
395 | win32_shutdown | |
3a25acb4 | 396 | win32_closesocket |
54310121 | 397 | win32_ioctlsocket |
398 | win32_setsockopt | |
399 | win32_getsockopt | |
400 | win32_getpeername | |
401 | win32_getsockname | |
402 | win32_gethostname | |
403 | win32_gethostbyname | |
404 | win32_gethostbyaddr | |
405 | win32_getprotobyname | |
406 | win32_getprotobynumber | |
407 | win32_getservbyname | |
408 | win32_getservbyport | |
409 | win32_select | |
410 | win32_endhostent | |
411 | win32_endnetent | |
412 | win32_endprotoent | |
413 | win32_endservent | |
414 | win32_getnetent | |
415 | win32_getnetbyname | |
416 | win32_getnetbyaddr | |
417 | win32_getprotoent | |
418 | win32_getservent | |
419 | win32_sethostent | |
420 | win32_setnetent | |
421 | win32_setprotoent | |
422 | win32_setservent | |
ad2e33dc | 423 | win32_getenv |
84902520 | 424 | win32_perror |
425 | win32_setbuf | |
426 | win32_setvbuf | |
427 | win32_flushall | |
428 | win32_fcloseall | |
429 | win32_fgets | |
430 | win32_gets | |
431 | win32_fgetc | |
432 | win32_putc | |
433 | win32_puts | |
434 | win32_getchar | |
435 | win32_putchar | |
436 | win32_malloc | |
437 | win32_calloc | |
438 | win32_realloc | |
439 | win32_free | |
f3986ebb | 440 | win32_sleep |
441 | win32_times | |
442 | win32_alarm | |
65e48ea9 | 443 | win32_open_osfhandle |
444 | win32_get_osfhandle | |
ad2e33dc | 445 | Perl_win32_init |
f3986ebb | 446 | Perl_init_os_extras |
9811a7d7 | 447 | Perl_getTHR |
0fefa03b | 448 | Perl_setTHR |
84902520 | 449 | RunPerl |