4 use ExtUtils::ParseXS qw(process_file);
9 my $usage = "Usage: xsubpp [-v] [-csuffix csuffix] [-except] [-prototypes] [-noversioncheck] [-nolinenumbers] [-nooptimize] [-noinout] [-noargtypes] [-s pattern] [-typemap typemap]... file.xs\n";
11 Getopt::Long::Configure qw(no_auto_abbrev no_ignore_case);
13 @ARGV = grep {$_ ne '-C++'} @ARGV; # Allow -C++ for backward compatibility
14 GetOptions(\%args, qw(hiertype!
32 print "xsubpp version $ExtUtils::ParseXS::VERSION\n";
36 @ARGV == 1 or die $usage;
38 $args{filename} = shift @ARGV;
41 exit( ExtUtils::ParseXS::errors() ? 1 : 0 );
47 xsubpp - compiler to convert Perl XS code into C code
51 B<xsubpp> [B<-v>] [B<-except>] [B<-s pattern>] [B<-prototypes>] [B<-noversioncheck>] [B<-nolinenumbers>] [B<-nooptimize>] [B<-typemap typemap>] [B<-output filename>]... file.xs
55 This compiler is typically run by the makefiles created by L<ExtUtils::MakeMaker>.
57 I<xsubpp> will compile XS code into C code by embedding the constructs
58 necessary to let C functions manipulate Perl values and creates the glue
59 necessary to let Perl access those functions. The compiler uses typemaps to
60 determine how to map C function parameters and variables to Perl values.
62 The compiler will search for typemap files called I<typemap>. It will use
63 the following search path to find default typemaps, with the rightmost
64 typemap taking precedence.
66 ../../../typemap:../../typemap:../typemap:typemap
68 It will also use a default typemap installed as C<ExtUtils::typemap>.
72 Note that the C<XSOPT> MakeMaker option may be used to add these options to
73 any makefiles generated by MakeMaker.
79 Retains '::' in type names so that C++ hierarchical types can be mapped.
83 Adds exception handling stubs to the C code.
85 =item B<-typemap typemap>
87 Indicates that a user-supplied typemap should take precedence over the
88 default typemaps. This option may be used multiple times, with the last
89 typemap having the highest precedence.
91 =item B<-output filename>
93 Specifies the name of the output file to generate. If no file is
94 specified, output will be written to standard output.
98 Prints the I<xsubpp> version number to standard output, then exits.
102 By default I<xsubpp> will not automatically generate prototype code for
103 all xsubs. This flag will enable prototypes.
105 =item B<-noversioncheck>
107 Disables the run time test that determines if the object file (derived
108 from the C<.xs> file) and the C<.pm> files have the same version
111 =item B<-nolinenumbers>
113 Prevents the inclusion of `#line' directives in the output.
117 Disables certain optimizations. The only optimization that is currently
118 affected is the use of I<target>s by the output C code (see L<perlguts>).
119 This may significantly slow down the generated code, but this is the way
120 B<xsubpp> of 5.005 and earlier operated.
124 Disable recognition of C<IN>, C<OUT_LIST> and C<INOUT_LIST> declarations.
128 Disable recognition of ANSI-like descriptions of function signature.
132 Currently doesn't do anything at all. This flag has been a no-op for
133 many versions of perl, at least as far back as perl5.003_07. It's
134 allowed here for backwards compatibility.
140 No environment variables are used.
144 Originally by Larry Wall. Turned into the C<ExtUtils::ParseXS> module
147 =head1 MODIFICATION HISTORY
149 See the file F<Changes>.
153 perl(1), perlxs(1), perlxstut(1), ExtUtils::ParseXS