3 * Copyright (c) 1997-2002, Larry Wall
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
11 * "The Road goes ever on and on, down from the door where it began."
16 /* sbrk is limited to first heap segement so make it big */
17 #pragma runopts(HEAP(8M,500K,ANYWHERE,KEEP,8K,4K) STACK(,,ANY,) ALL31(ON))
19 #pragma runopts(HEAP(2M,500K,ANYWHERE,KEEP,8K,4K) STACK(,,ANY,) ALL31(ON))
25 #define PERL_IN_MINIPERLMAIN_C
28 static void xs_init (pTHX);
29 static PerlInterpreter *my_perl;
31 #if defined (__MINT__) || defined (atarist)
32 /* The Atari operating system doesn't have a dynamic stack. The
33 stack size is determined from this value. */
34 long _stksize = 64 * 1024;
38 main(int argc, char **argv, char **env)
42 #ifdef PERL_GLOBAL_STRUCT
43 #define PERLVAR(var,type) /**/
44 #define PERLVARA(var,type) /**/
45 #define PERLVARI(var,type,init) PL_Vars.var = init;
46 #define PERLVARIC(var,type,init) PL_Vars.var = init;
54 /* if user wants control of gprof profiling off by default */
55 /* noop unless Configure is given -Accflags=-DPERL_GPROF_CONTROL */
56 PERL_GPROF_MONCONTROL(0);
58 PERL_SYS_INIT3(&argc,&argv,&env);
60 #if defined(USE_5005THREADS) || defined(USE_ITHREADS)
61 /* XXX Ideally, this should really be happening in perl_alloc() or
62 * perl_construct() to keep libperl.a transparently fork()-safe.
63 * It is currently done here only because Apache/mod_perl have
64 * problems due to lack of a call to cancel pthread_atfork()
65 * handlers when shared objects that contain the handlers may
66 * be dlclose()d. This forces applications that embed perl to
67 * call PTHREAD_ATFORK() explicitly, but if and only if it hasn't
68 * been called at least once before in the current process.
69 * --GSAR 2001-07-20 */
70 PTHREAD_ATFORK(Perl_atfork_lock,
76 my_perl = perl_alloc();
79 perl_construct(my_perl);
80 PL_perl_destruct_level = 0;
82 PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
83 exitstatus = perl_parse(my_perl, xs_init, argc, argv, (char **)NULL);
87 exitstatus = perl_destruct(my_perl);
97 /* Register any extra external extensions */
99 /* Do not delete this line--writemain depends on it */