2 // Code to statically rebuild perl5.
6 %subsection "perlmain.i"
8 This module provides support for building a new version of the
9 Perl executable. This will be necessary on systems that do
10 not support shared libraries and may be necessary with C++
13 This module may only build a stripped down version of the
14 Perl executable. Thus, it may be necessary (or desirable)
15 to hand-edit this file for your particular application. To
16 do this, simply copy this file from swig_lib/perl5/perlmain.i
17 to your working directory and make the appropriate modifications.
19 This library file works with Perl 5.003. It may work with earlier
20 versions, but it hasn't been tested. As far as I know, this
27 static void xs_init _((void));
28 static PerlInterpreter *my_perl;
30 int perl_eval(char *string) {
34 return perl_call_argv("eval",0,argv);
38 main(int argc, char **argv, char **env)
42 my_perl = perl_alloc();
45 perl_construct( my_perl );
47 exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
51 /* Initialize all of the module variables */
53 exitstatus = perl_run( my_perl );
55 perl_destruct( my_perl );
61 /* Register any extra external extensions */
63 /* Do not delete this line--writemain depends on it */
64 /* EXTERN_C void boot_DynaLoader _((CV* cv)); */
70 char *file = __FILE__;
72 /* newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); */
73 newXS(SWIG_name, SWIG_init, file);