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