get extutils.t working on VMS (again)
[p5sagit/p5-mst-13.2.git] / miniperlmain.c
CommitLineData
a0d0e21e 1/*
2 * "The Road goes ever on and on, down from the door where it began."
3 */
4
60e4866f 5#ifdef OEMVS
9133bbab 6#ifdef MYMALLOC
7/* sbrk is limited to first heap segement so make it big */
8#pragma runopts(HEAP(8M,500K,ANYWHERE,KEEP,8K,4K) STACK(,,ANY,) ALL31(ON))
9#else
10#pragma runopts(HEAP(2M,500K,ANYWHERE,KEEP,8K,4K) STACK(,,ANY,) ALL31(ON))
11#endif
60e4866f 12#endif
13
4633a7c4 14
ecfc5424 15#include "EXTERN.h"
864dbfa3 16#define PERL_IN_MINIPERLMAIN_C
2304df62 17#include "perl.h"
18
864dbfa3 19static void xs_init (pTHX);
a0d0e21e 20static PerlInterpreter *my_perl;
21
61ae2fbf 22#if defined (__MINT__) || defined (atarist)
23/* The Atari operating system doesn't have a dynamic stack. The
24 stack size is determined from this value. */
25long _stksize = 64 * 1024;
26#endif
27
c07a80fd 28int
dc6439a4 29main(int argc, char **argv, char **env)
2304df62 30{
31 int exitstatus;
2304df62 32
22239a37 33#ifdef PERL_GLOBAL_STRUCT
34#define PERLVAR(var,type) /**/
51371543 35#define PERLVARA(var,type) /**/
533c011a 36#define PERLVARI(var,type,init) PL_Vars.var = init;
37#define PERLVARIC(var,type,init) PL_Vars.var = init;
22239a37 38#include "perlvars.h"
39#undef PERLVAR
51371543 40#undef PERLVARA
22239a37 41#undef PERLVARI
0f3f18a6 42#undef PERLVARIC
22239a37 43#endif
44
2c4f7f0e 45 /* if user wants control of gprof profiling off by default */
46 /* noop unless Configure is given -Accflags=-DPERL_GPROF_CONTROL */
47 PERL_GPROF_MONCONTROL(0);
48
ed344e4f 49 PERL_SYS_INIT3(&argc,&argv,&env);
4633a7c4 50
3280af22 51 if (!PL_do_undump) {
a0d0e21e 52 my_perl = perl_alloc();
53 if (!my_perl)
54 exit(1);
642f9deb 55 perl_construct(my_perl);
3280af22 56 PL_perl_destruct_level = 0;
a0d0e21e 57 }
2304df62 58
642f9deb 59 exitstatus = perl_parse(my_perl, xs_init, argc, argv, (char **)NULL);
b5dd7652 60 if (!exitstatus) {
642f9deb 61 exitstatus = perl_run(my_perl);
b5dd7652 62 }
2304df62 63
642f9deb 64 perl_destruct(my_perl);
65 perl_free(my_perl);
2304df62 66
a91be337 67 PERL_SYS_TERM();
68
642f9deb 69 exit(exitstatus);
4e35701f 70 return exitstatus;
2304df62 71}
72
73/* Register any extra external extensions */
74
4633a7c4 75/* Do not delete this line--writemain depends on it */
76
a0d0e21e 77static void
864dbfa3 78xs_init(pTHX)
2304df62 79{
642f9deb 80 dXSUB_SYS;
2304df62 81}