This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge maint-5.004 branch (5.004_04) with mainline.
[perl5.git] / win32 / makedef.pl
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
15 # way to find them so I just put a exception list here
16
17 my $CCTYPE = shift || "MSVC";
18
19 $skip_sym=<<'!END!OF!SKIP!';
20 Perl_SvIV
21 Perl_SvNV
22 Perl_SvTRUE
23 Perl_SvUV
24 Perl_block_type
25 Perl_sv_pvn
26 Perl_additem
27 Perl_cast_ulong
28 Perl_check_uni
29 Perl_checkcomma
30 Perl_chsize
31 Perl_ck_aelem
32 Perl_cryptseen
33 Perl_cx_dump
34 Perl_deb
35 Perl_deb_growlevel
36 Perl_debop
37 Perl_debprofdump
38 Perl_debstack
39 Perl_debstackptrs
40 Perl_do_ipcctl
41 Perl_do_ipcget
42 Perl_do_msgrcv
43 Perl_do_msgsnd
44 Perl_do_semop
45 Perl_do_shmio
46 Perl_doeval
47 Perl_dofindlabel
48 Perl_dopoptoeval
49 Perl_dump_eval
50 Perl_dump_fds
51 Perl_dump_form
52 Perl_dump_gv
53 Perl_dump_mstats
54 Perl_dump_op
55 Perl_dump_packsubs
56 Perl_dump_pm
57 Perl_dump_sub
58 Perl_expectterm
59 Perl_fetch_gv
60 Perl_fetch_io
61 Perl_force_ident
62 Perl_force_next
63 Perl_force_word
64 Perl_hv_stashpv
65 Perl_intuit_more
66 Perl_know_next
67 Perl_modkids
68 Perl_mstats
69 Perl_my_bzero
70 Perl_my_htonl
71 Perl_my_ntohl
72 Perl_my_swap
73 Perl_my_chsize
74 Perl_newXSUB
75 Perl_no_fh_allowed
76 Perl_no_op
77 Perl_nointrp
78 Perl_nomem
79 Perl_pp_cswitch
80 Perl_pp_entersubr
81 Perl_pp_evalonce
82 Perl_pp_interp
83 Perl_pp_map
84 Perl_pp_nswitch
85 Perl_q
86 Perl_reall_srchlen
87 Perl_regdump
88 Perl_regfold
89 Perl_regmyendp
90 Perl_regmyp_size
91 Perl_regmystartp
92 Perl_regnarrate
93 Perl_regprop
94 Perl_same_dirent
95 Perl_saw_return
96 Perl_scan_const
97 Perl_scan_formline
98 Perl_scan_heredoc
99 Perl_scan_ident
100 Perl_scan_inputsymbol
101 Perl_scan_pat
102 Perl_scan_prefix
103 Perl_scan_str
104 Perl_scan_subst
105 Perl_scan_trans
106 Perl_scan_word
107 Perl_setenv_getix
108 Perl_skipspace
109 Perl_sublex_done
110 Perl_sublex_start
111 Perl_sv_peek
112 Perl_sv_ref
113 Perl_sv_setptrobj
114 Perl_timesbuf
115 Perl_too_few_arguments
116 Perl_too_many_arguments
117 Perl_unlnk
118 Perl_wait4pid
119 Perl_watch
120 Perl_yyname
121 Perl_yyrule
122 allgvs
123 curblock
124 curcsv
125 lastretstr
126 mystack_mark
127 perl_init_ext
128 perl_requirepv
129 stack
130 statusvalue_vms
131 Perl_safexcalloc
132 Perl_safexmalloc
133 Perl_safexfree
134 Perl_safexrealloc
135 Perl_my_memcmp
136 Perl_my_memset
137 Perl_cshlen
138 Perl_cshname
139 Perl_condpair_magic
140 Perl_magic_mutexfree
141 Perl_opsave
142 Perl_unlock_condpair
143 Perl_vtbl_mutex
144 !END!OF!SKIP!
145
146 # All symbols have a Perl_ prefix because that's what embed.h
147 # sticks in front of them.
148
149
150 print "LIBRARY Perl\n";
151 print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
152 print "CODE LOADONCALL\n";
153 print "DATA LOADONCALL NONSHARED MULTIPLE\n";
154 print "EXPORTS\n";
155
156 open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!;
157 while (<GLOBAL>) {
158         my $symbol;
159         next if (!/^[A-Za-z]/);
160         next if (/_amg[ \t]*$/);
161         $symbol = "Perl_$_";
162         next if ($skip_sym =~ m/$symbol/m);
163         emit_symbol($symbol);
164 }
165 close(GLOBAL);
166
167 # also add symbols from interp.sym
168 # They are only needed if -DMULTIPLICITY is not set but it
169 # doesn't hurt to include them anyway.
170 # these don't have Perl prefix
171
172 open (INTERP, "<../interp.sym") || die "failed to open interp.sym" . $!;
173 while (<INTERP>) {
174         my $symbol;
175         next if (!/^[A-Za-z]/);
176         next if (/_amg[ \t]*$/);
177         $symbol = $_;
178         next if ($skip_sym =~ m/$symbol/m);
179         #print "\t$symbol";
180         emit_symbol("Perl_" . $symbol);
181 }
182
183 #close(INTERP);
184
185 while (<DATA>) {
186         my $symbol;
187         next if (!/^[A-Za-z]/);
188         next if (/^#/);
189         $symbol = $_;
190         next if ($skip_sym =~ m/^$symbol/m);
191         emit_symbol($symbol);
192 }
193
194 sub emit_symbol {
195         my $symbol = shift;
196         chomp $symbol;
197         if ($CCTYPE eq "BORLAND") {
198                 # workaround Borland quirk by exporting both the straight
199                 # name and a name with leading underscore.  Note the
200                 # alias *must* come after the symbol itself, if both
201                 # are to be exported. (Linker bug?)
202                 print "\t_$symbol\n";
203                 print "\t$symbol = _$symbol\n";
204         }
205         else {
206                 # for binary coexistence, export both the symbol and
207                 # alias with leading underscore
208                 print "\t$symbol\n";
209                 print "\t_$symbol = $symbol\n";
210         }
211 }
212
213 1;
214 __DATA__
215 # extra globals not included above.
216 perl_init_i18nl10n
217 perl_init_ext
218 perl_alloc
219 perl_construct
220 perl_destruct
221 perl_free
222 perl_parse
223 perl_run
224 perl_get_sv
225 perl_get_av
226 perl_get_hv
227 perl_get_cv
228 perl_call_argv
229 perl_call_pv
230 perl_call_method
231 perl_call_sv
232 perl_require_pv
233 perl_eval_pv
234 perl_eval_sv
235 boot_DynaLoader
236 win32_errno
237 win32_environ
238 win32_stdin
239 win32_stdout
240 win32_stderr
241 win32_ferror
242 win32_feof
243 win32_strerror
244 win32_fprintf
245 win32_printf
246 win32_vfprintf
247 win32_vprintf
248 win32_fread
249 win32_fwrite
250 win32_fopen
251 win32_fdopen
252 win32_freopen
253 win32_fclose
254 win32_fputs
255 win32_fputc
256 win32_ungetc
257 win32_getc
258 win32_fileno
259 win32_clearerr
260 win32_fflush
261 win32_ftell
262 win32_fseek
263 win32_fgetpos
264 win32_fsetpos
265 win32_rewind
266 win32_tmpfile
267 win32_abort
268 win32_fstat
269 win32_stat
270 win32_pipe
271 win32_popen
272 win32_pclose
273 win32_setmode
274 win32_lseek
275 win32_tell
276 win32_dup
277 win32_dup2
278 win32_open
279 win32_close
280 win32_eof
281 win32_read
282 win32_write
283 win32_spawnvp
284 win32_mkdir
285 win32_rmdir
286 win32_chdir
287 win32_flock
288 win32_execvp
289 win32_htons
290 win32_ntohs
291 win32_htonl
292 win32_ntohl
293 win32_inet_addr
294 win32_inet_ntoa
295 win32_socket
296 win32_bind
297 win32_listen
298 win32_accept
299 win32_connect
300 win32_send
301 win32_sendto
302 win32_recv
303 win32_recvfrom
304 win32_shutdown
305 win32_ioctlsocket
306 win32_setsockopt
307 win32_getsockopt
308 win32_getpeername
309 win32_getsockname
310 win32_gethostname
311 win32_gethostbyname
312 win32_gethostbyaddr
313 win32_getprotobyname
314 win32_getprotobynumber
315 win32_getservbyname
316 win32_getservbyport
317 win32_select
318 win32_endhostent
319 win32_endnetent
320 win32_endprotoent
321 win32_endservent
322 win32_getnetent
323 win32_getnetbyname
324 win32_getnetbyaddr
325 win32_getprotoent
326 win32_getservent
327 win32_sethostent
328 win32_setnetent
329 win32_setprotoent
330 win32_setservent
331 win32_getenv
332 win32_perror
333 win32_setbuf
334 win32_setvbuf
335 win32_flushall
336 win32_fcloseall
337 win32_fgets
338 win32_gets
339 win32_fgetc
340 win32_putc
341 win32_puts
342 win32_getchar
343 win32_putchar
344 win32_malloc
345 win32_calloc
346 win32_realloc
347 win32_free
348 win32stdio
349 Perl_win32_init
350 RunPerl
351 SetIOSubSystem
352 GetIOSubSystem