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