| 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 | while (@ARGV && $ARGV[0] =~ /^-/) |
| 18 | { |
| 19 | my $flag = shift; |
| 20 | $define{$1} = 1 if ($flag =~ /^-D(\w+)$/); |
| 21 | } |
| 22 | |
| 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 | |
| 30 | warn join(' ',keys %define)."\n"; |
| 31 | |
| 32 | my $CCTYPE = shift || "MSVC"; |
| 33 | |
| 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 | } |
| 41 | print "EXPORTS\n"; |
| 42 | |
| 43 | $skip_sym=<<'!END!OF!SKIP!'; |
| 44 | Perl_block_type |
| 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 |
| 85 | Perl_init_thread_intern |
| 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 |
| 106 | Perl_rcsid |
| 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 |
| 128 | Perl_setenv_getix |
| 129 | Perl_skipspace |
| 130 | Perl_sublex_done |
| 131 | Perl_sublex_start |
| 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 |
| 144 | curcsv |
| 145 | lastretstr |
| 146 | mystack_mark |
| 147 | perl_init_ext |
| 148 | perl_requirepv |
| 149 | stack |
| 150 | statusvalue_vms |
| 151 | Perl_safexcalloc |
| 152 | Perl_safexmalloc |
| 153 | Perl_safexfree |
| 154 | Perl_safexrealloc |
| 155 | Perl_my_memcmp |
| 156 | Perl_my_memset |
| 157 | Perl_cshlen |
| 158 | Perl_cshname |
| 159 | Perl_opsave |
| 160 | !END!OF!SKIP! |
| 161 | |
| 162 | if ($define{'MYMALLOC'}) |
| 163 | { |
| 164 | $skip_sym .= <<'!END!OF!SKIP!'; |
| 165 | Perl_safefree |
| 166 | Perl_safemalloc |
| 167 | Perl_saferealloc |
| 168 | Perl_safecalloc |
| 169 | !END!OF!SKIP! |
| 170 | emit_symbol('Perl_malloc'); |
| 171 | emit_symbol('Perl_free'); |
| 172 | emit_symbol('Perl_realloc'); |
| 173 | emit_symbol('Perl_calloc'); |
| 174 | } |
| 175 | |
| 176 | unless ($define{'USE_THREADS'}) |
| 177 | { |
| 178 | $skip_sym .= <<'!END!OF!SKIP!'; |
| 179 | Perl_condpair_magic |
| 180 | Perl_thr_key |
| 181 | Perl_sv_mutex |
| 182 | Perl_malloc_mutex |
| 183 | Perl_eval_mutex |
| 184 | Perl_eval_cond |
| 185 | Perl_eval_owner |
| 186 | Perl_threads_mutex |
| 187 | Perl_new_struct_thread |
| 188 | Perl_nthreads |
| 189 | Perl_nthreads_cond |
| 190 | Perl_per_thread_magicals |
| 191 | Perl_thrsv |
| 192 | Perl_unlock_condpair |
| 193 | Perl_vtbl_mutex |
| 194 | Perl_magic_mutexfree |
| 195 | Perl_sv_iv |
| 196 | Perl_sv_nv |
| 197 | Perl_sv_true |
| 198 | Perl_sv_uv |
| 199 | Perl_sv_pvn |
| 200 | Perl_newRV_noinc |
| 201 | !END!OF!SKIP! |
| 202 | } |
| 203 | |
| 204 | if ($define{'USE_THISPTR'} || $define{'USE_THREADS'}) |
| 205 | { |
| 206 | open(THREAD,"<../thread.sym") || die "Cannot open thread.sym:$!"; |
| 207 | while (<THREAD>) |
| 208 | { |
| 209 | next if (!/^[A-Za-z]/); |
| 210 | next if (/_amg[ \t]*$/); |
| 211 | $skip_sym .= "Perl_".$_; |
| 212 | } |
| 213 | close(THREAD); |
| 214 | $skip_sym .= "Perl_op\n"; |
| 215 | } |
| 216 | |
| 217 | unless ($define{'USE_THREADS'}) |
| 218 | { |
| 219 | $skip_sym .= "Perl_thread_create\n"; |
| 220 | $skip_sym .= "Perl_find_threadsv\n"; |
| 221 | $skip_sym .= "Perl_threadsv_names\n"; |
| 222 | } |
| 223 | |
| 224 | # All symbols have a Perl_ prefix because that's what embed.h |
| 225 | # sticks in front of them. |
| 226 | |
| 227 | |
| 228 | open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!; |
| 229 | while (<GLOBAL>) { |
| 230 | my $symbol; |
| 231 | next if (!/^[A-Za-z]/); |
| 232 | next if (/_amg[ \t]*$/); |
| 233 | $symbol = "Perl_$_"; |
| 234 | next if ($skip_sym =~ m/$symbol/m); |
| 235 | emit_symbol($symbol); |
| 236 | } |
| 237 | close(GLOBAL); |
| 238 | |
| 239 | # also add symbols from interp.sym |
| 240 | # They are only needed if -DMULTIPLICITY is not set but it |
| 241 | # doesn't hurt to include them anyway. |
| 242 | # these don't have Perl prefix |
| 243 | |
| 244 | open (INTERP, "<../interp.sym") || die "failed to open interp.sym" . $!; |
| 245 | while (<INTERP>) { |
| 246 | my $symbol; |
| 247 | next if (!/^[A-Za-z]/); |
| 248 | next if (/_amg[ \t]*$/); |
| 249 | $symbol = $_; |
| 250 | next if ($skip_sym =~ m/$symbol/m); |
| 251 | #print "\t$symbol"; |
| 252 | emit_symbol("Perl_" . $symbol); |
| 253 | } |
| 254 | |
| 255 | #close(INTERP); |
| 256 | |
| 257 | while (<DATA>) { |
| 258 | my $symbol; |
| 259 | next if (!/^[A-Za-z]/); |
| 260 | next if (/^#/); |
| 261 | s/\r//g; |
| 262 | $symbol = $_; |
| 263 | next if ($skip_sym =~ m/^$symbol/m); |
| 264 | $symbol = "Perl_".$symbol if ($define{'USE_THISPTR'} |
| 265 | && $symbol =~ /^perl/); |
| 266 | emit_symbol($symbol); |
| 267 | } |
| 268 | |
| 269 | sub emit_symbol { |
| 270 | my $symbol = shift; |
| 271 | chomp $symbol; |
| 272 | if ($CCTYPE eq "BORLAND") { |
| 273 | # workaround Borland quirk by exporting both the straight |
| 274 | # name and a name with leading underscore. Note the |
| 275 | # alias *must* come after the symbol itself, if both |
| 276 | # are to be exported. (Linker bug?) |
| 277 | print "\t_$symbol\n"; |
| 278 | print "\t$symbol = _$symbol\n"; |
| 279 | } |
| 280 | else { |
| 281 | # for binary coexistence, export both the symbol and |
| 282 | # alias with leading underscore |
| 283 | print "\t$symbol\n"; |
| 284 | print "\t_$symbol = $symbol\n"; |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | 1; |
| 289 | __DATA__ |
| 290 | # extra globals not included above. |
| 291 | perl_init_i18nl10n |
| 292 | perl_init_ext |
| 293 | perl_alloc |
| 294 | perl_construct |
| 295 | perl_destruct |
| 296 | perl_free |
| 297 | perl_parse |
| 298 | perl_run |
| 299 | perl_get_sv |
| 300 | perl_get_av |
| 301 | perl_get_hv |
| 302 | perl_get_cv |
| 303 | perl_call_argv |
| 304 | perl_call_pv |
| 305 | perl_call_method |
| 306 | perl_call_sv |
| 307 | perl_require_pv |
| 308 | perl_eval_pv |
| 309 | perl_eval_sv |
| 310 | boot_DynaLoader |
| 311 | Perl_thread_create |
| 312 | win32_errno |
| 313 | win32_environ |
| 314 | win32_stdin |
| 315 | win32_stdout |
| 316 | win32_stderr |
| 317 | win32_ferror |
| 318 | win32_feof |
| 319 | win32_strerror |
| 320 | win32_fprintf |
| 321 | win32_printf |
| 322 | win32_vfprintf |
| 323 | win32_vprintf |
| 324 | win32_fread |
| 325 | win32_fwrite |
| 326 | win32_fopen |
| 327 | win32_fdopen |
| 328 | win32_freopen |
| 329 | win32_fclose |
| 330 | win32_fputs |
| 331 | win32_fputc |
| 332 | win32_ungetc |
| 333 | win32_getc |
| 334 | win32_fileno |
| 335 | win32_clearerr |
| 336 | win32_fflush |
| 337 | win32_ftell |
| 338 | win32_fseek |
| 339 | win32_fgetpos |
| 340 | win32_fsetpos |
| 341 | win32_rewind |
| 342 | win32_tmpfile |
| 343 | win32_abort |
| 344 | win32_fstat |
| 345 | win32_stat |
| 346 | win32_pipe |
| 347 | win32_popen |
| 348 | win32_pclose |
| 349 | win32_setmode |
| 350 | win32_lseek |
| 351 | win32_tell |
| 352 | win32_dup |
| 353 | win32_dup2 |
| 354 | win32_open |
| 355 | win32_close |
| 356 | win32_eof |
| 357 | win32_read |
| 358 | win32_write |
| 359 | win32_spawnvp |
| 360 | win32_mkdir |
| 361 | win32_rmdir |
| 362 | win32_chdir |
| 363 | win32_flock |
| 364 | win32_execvp |
| 365 | win32_htons |
| 366 | win32_ntohs |
| 367 | win32_htonl |
| 368 | win32_ntohl |
| 369 | win32_inet_addr |
| 370 | win32_inet_ntoa |
| 371 | win32_socket |
| 372 | win32_bind |
| 373 | win32_listen |
| 374 | win32_accept |
| 375 | win32_connect |
| 376 | win32_send |
| 377 | win32_sendto |
| 378 | win32_recv |
| 379 | win32_recvfrom |
| 380 | win32_shutdown |
| 381 | win32_closesocket |
| 382 | win32_ioctlsocket |
| 383 | win32_setsockopt |
| 384 | win32_getsockopt |
| 385 | win32_getpeername |
| 386 | win32_getsockname |
| 387 | win32_gethostname |
| 388 | win32_gethostbyname |
| 389 | win32_gethostbyaddr |
| 390 | win32_getprotobyname |
| 391 | win32_getprotobynumber |
| 392 | win32_getservbyname |
| 393 | win32_getservbyport |
| 394 | win32_select |
| 395 | win32_endhostent |
| 396 | win32_endnetent |
| 397 | win32_endprotoent |
| 398 | win32_endservent |
| 399 | win32_getnetent |
| 400 | win32_getnetbyname |
| 401 | win32_getnetbyaddr |
| 402 | win32_getprotoent |
| 403 | win32_getservent |
| 404 | win32_sethostent |
| 405 | win32_setnetent |
| 406 | win32_setprotoent |
| 407 | win32_setservent |
| 408 | win32_getenv |
| 409 | win32_perror |
| 410 | win32_setbuf |
| 411 | win32_setvbuf |
| 412 | win32_flushall |
| 413 | win32_fcloseall |
| 414 | win32_fgets |
| 415 | win32_gets |
| 416 | win32_fgetc |
| 417 | win32_putc |
| 418 | win32_puts |
| 419 | win32_getchar |
| 420 | win32_putchar |
| 421 | win32_malloc |
| 422 | win32_calloc |
| 423 | win32_realloc |
| 424 | win32_free |
| 425 | win32_sleep |
| 426 | win32_times |
| 427 | win32_alarm |
| 428 | win32_open_osfhandle |
| 429 | win32_get_osfhandle |
| 430 | Perl_win32_init |
| 431 | Perl_init_os_extras |
| 432 | Perl_getTHR |
| 433 | Perl_setTHR |
| 434 | RunPerl |