This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate latest mainline into win32 branch.
[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
0a753a76 111Perl_sv_ref
112Perl_sv_setptrobj
113Perl_timesbuf
114Perl_too_few_arguments
115Perl_too_many_arguments
116Perl_unlnk
117Perl_wait4pid
118Perl_watch
119Perl_yyname
120Perl_yyrule
121allgvs
122curblock
0a753a76 123curcsv
0a753a76 124lastretstr
125mystack_mark
126perl_init_ext
127perl_requirepv
0a753a76 128stack
ff0cee69 129statusvalue_vms
0a753a76 130Perl_safexcalloc
131Perl_safexmalloc
132Perl_safexfree
133Perl_safexrealloc
68dc0745 134Perl_my_memcmp
8b10511d 135Perl_my_memset
68dc0745 136Perl_cshlen
137Perl_cshname
0da3735a 138Perl_opsave
0a753a76 139!END!OF!SKIP!
140
141# All symbols have a Perl_ prefix because that's what embed.h
142# sticks in front of them.
143
144
145print "LIBRARY Perl\n";
146print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
147print "CODE LOADONCALL\n";
148print "DATA LOADONCALL NONSHARED MULTIPLE\n";
149print "EXPORTS\n";
150
151open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!;
152while (<GLOBAL>) {
153 my $symbol;
154 next if (!/^[A-Za-z]/);
155 next if (/_amg[ \t]*$/);
156 $symbol = "Perl_$_";
157 next if ($skip_sym =~ m/$symbol/m);
3e3baf6d
TB
158 emit_symbol($symbol);
159}
0a753a76 160close(GLOBAL);
161
162# also add symbols from interp.sym
163# They are only needed if -DMULTIPLICITY is not set but it
164# doesn't hurt to include them anyway.
165# these don't have Perl prefix
166
167open (INTERP, "<../interp.sym") || die "failed to open interp.sym" . $!;
168while (<INTERP>) {
169 my $symbol;
170 next if (!/^[A-Za-z]/);
171 next if (/_amg[ \t]*$/);
172 $symbol = $_;
173 next if ($skip_sym =~ m/$symbol/m);
174 #print "\t$symbol";
3e3baf6d
TB
175 emit_symbol("Perl_" . $symbol);
176}
0a753a76 177
178#close(INTERP);
179
180while (<DATA>) {
181 my $symbol;
182 next if (!/^[A-Za-z]/);
183 next if (/^#/);
184 $symbol = $_;
185 next if ($skip_sym =~ m/^$symbol/m);
3e3baf6d
TB
186 emit_symbol($symbol);
187}
188
189sub emit_symbol {
190 my $symbol = shift;
191 chomp $symbol;
192 if ($CCTYPE eq "BORLAND") {
193 # workaround Borland quirk by exporting both the straight
84902520
TB
194 # name and a name with leading underscore. Note the
195 # alias *must* come after the symbol itself, if both
196 # are to be exported. (Linker bug?)
3e3baf6d 197 print "\t_$symbol\n";
84902520 198 print "\t$symbol = _$symbol\n";
3e3baf6d
TB
199 }
200 else {
84902520
TB
201 # for binary coexistence, export both the symbol and
202 # alias with leading underscore
3e3baf6d 203 print "\t$symbol\n";
84902520 204 print "\t_$symbol = $symbol\n";
3e3baf6d
TB
205 }
206}
0a753a76 207
2081;
209__DATA__
210# extra globals not included above.
211perl_init_i18nl10n
212perl_init_ext
213perl_alloc
214perl_construct
215perl_destruct
216perl_free
217perl_parse
218perl_run
219perl_get_sv
220perl_get_av
221perl_get_hv
222perl_get_cv
223perl_call_argv
224perl_call_pv
225perl_call_method
226perl_call_sv
10dd38fc
GS
227perl_require_pv
228perl_eval_pv
229perl_eval_sv
d28b3ca3 230boot_DynaLoader
68dc0745 231win32_errno
96e4d5b1 232win32_environ
68dc0745 233win32_stdin
234win32_stdout
96e4d5b1 235win32_stderr
68dc0745 236win32_ferror
237win32_feof
238win32_strerror
239win32_fprintf
240win32_printf
241win32_vfprintf
96e4d5b1 242win32_vprintf
68dc0745 243win32_fread
244win32_fwrite
245win32_fopen
246win32_fdopen
247win32_freopen
248win32_fclose
249win32_fputs
250win32_fputc
251win32_ungetc
252win32_getc
253win32_fileno
254win32_clearerr
255win32_fflush
256win32_ftell
257win32_fseek
258win32_fgetpos
259win32_fsetpos
260win32_rewind
261win32_tmpfile
262win32_abort
263win32_fstat
96e4d5b1 264win32_stat
68dc0745 265win32_pipe
266win32_popen
267win32_pclose
268win32_setmode
96e4d5b1 269win32_lseek
270win32_tell
68dc0745 271win32_dup
272win32_dup2
96e4d5b1 273win32_open
274win32_close
275win32_eof
68dc0745 276win32_read
277win32_write
3e3baf6d 278win32_spawnvp
5aabfad6 279win32_mkdir
280win32_rmdir
281win32_chdir
c90c0ff4 282win32_flock
6890e559 283win32_execvp
54310121 284win32_htons
285win32_ntohs
286win32_htonl
287win32_ntohl
288win32_inet_addr
289win32_inet_ntoa
290win32_socket
291win32_bind
292win32_listen
293win32_accept
294win32_connect
295win32_send
296win32_sendto
297win32_recv
298win32_recvfrom
299win32_shutdown
300win32_ioctlsocket
301win32_setsockopt
302win32_getsockopt
303win32_getpeername
304win32_getsockname
305win32_gethostname
306win32_gethostbyname
307win32_gethostbyaddr
308win32_getprotobyname
309win32_getprotobynumber
310win32_getservbyname
311win32_getservbyport
312win32_select
313win32_endhostent
314win32_endnetent
315win32_endprotoent
316win32_endservent
317win32_getnetent
318win32_getnetbyname
319win32_getnetbyaddr
320win32_getprotoent
321win32_getservent
322win32_sethostent
323win32_setnetent
324win32_setprotoent
325win32_setservent
ad2e33dc 326win32_getenv
84902520
TB
327win32_perror
328win32_setbuf
329win32_setvbuf
330win32_flushall
331win32_fcloseall
332win32_fgets
333win32_gets
334win32_fgetc
335win32_putc
336win32_puts
337win32_getchar
338win32_putchar
339win32_malloc
340win32_calloc
341win32_realloc
342win32_free
343win32stdio
ad2e33dc 344Perl_win32_init
84902520
TB
345RunPerl
346SetIOSubSystem
347GetIOSubSystem