Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / share / swig / 1.3.26 / perl5 / perlmain.i
CommitLineData
920dae64
AT
1// $Header: /cvsroot/swig/SWIG/Lib/perl5/perlmain.i,v 1.2 2003/09/01 18:13:33 beazley Exp $
2// Code to statically rebuild perl5.
3//
4
5#ifdef AUTODOC
6%subsection "perlmain.i"
7%text %{
8This module provides support for building a new version of the
9Perl executable. This will be necessary on systems that do
10not support shared libraries and may be necessary with C++
11extensions.
12
13This module may only build a stripped down version of the
14Perl executable. Thus, it may be necessary (or desirable)
15to hand-edit this file for your particular application. To
16do this, simply copy this file from swig_lib/perl5/perlmain.i
17to your working directory and make the appropriate modifications.
18
19This library file works with Perl 5.003. It may work with earlier
20versions, but it hasn't been tested. As far as I know, this
21library is C++ safe.
22%}
23#endif
24
25%{
26
27static void xs_init _((pTHX));
28static PerlInterpreter *my_perl;
29
30int perl_eval(char *string) {
31 char *argv[2];
32 argv[0] = string;
33 argv[1] = (char *) 0;
34 return perl_call_argv("eval",0,argv);
35}
36
37int
38main(int argc, char **argv, char **env)
39{
40 int exitstatus;
41
42 my_perl = perl_alloc();
43 if (!my_perl)
44 exit(1);
45 perl_construct( my_perl );
46
47 exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
48 if (exitstatus)
49 exit( exitstatus );
50
51 /* Initialize all of the module variables */
52
53 exitstatus = perl_run( my_perl );
54
55 perl_destruct( my_perl );
56 perl_free( my_perl );
57
58 exit( exitstatus );
59}
60
61/* Register any extra external extensions */
62
63/* Do not delete this line--writemain depends on it */
64/* EXTERN_C void boot_DynaLoader _((CV* cv)); */
65
66static void
67xs_init(pTHX)
68{
69/* dXSUB_SYS; */
70 char *file = __FILE__;
71 {
72 /* newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); */
73 newXS(SWIG_name, SWIG_init, file);
74#ifdef SWIGMODINIT
75 SWIGMODINIT
76#endif
77 }
78}
79
80%}