1 /* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
7 * Code to statically rebuild perl5.
8 * ----------------------------------------------------------------------------- */
11 %subsection "perlmain.i"
13 This module provides support for building a new version of the
14 Perl executable. This will be necessary on systems that do
15 not support shared libraries and may be necessary with C++
18 This module may only build a stripped down version of the
19 Perl executable. Thus, it may be necessary (or desirable)
20 to hand-edit this file for your particular application. To
21 do this, simply copy this file from swig_lib/perl5/perlmain.i
22 to your working directory and make the appropriate modifications.
24 This library file works with Perl 5.003. It may work with earlier
25 versions, but it hasn't been tested. As far as I know, this
32 static void xs_init _((pTHX));
33 static PerlInterpreter *my_perl;
35 int perl_eval(char *string) {
39 return perl_call_argv("eval",0,argv);
43 main(int argc, char **argv, char **env)
47 my_perl = perl_alloc();
50 perl_construct( my_perl );
52 exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
56 /* Initialize all of the module variables */
58 exitstatus = perl_run( my_perl );
60 perl_destruct( my_perl );
66 /* Register any extra external extensions */
68 /* Do not delete this line--writemain depends on it */
69 /* EXTERN_C void boot_DynaLoader _((CV* cv)); */
75 char *file = __FILE__;
77 /* newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); */
78 newXS(SWIG_name, SWIG_init, file);