man-pages/man1/xsubpp.1.html
2021-03-31 01:06:50 +01:00

204 lines
5.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of XSUBPP</TITLE>
</HEAD><BODY>
<H1>XSUBPP</H1>
Section: Perl Programmers Reference Guide (1)<BR>Updated: 2020-10-19<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
xsubpp - compiler to convert Perl XS code into C code
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>xsubpp</B> [<B>-v</B>] [<B>-except</B>] [<B>-s pattern</B>] [<B>-prototypes</B>] [<B>-noversioncheck</B>] [<B>-nolinenumbers</B>] [<B>-nooptimize</B>] [<B>-typemap typemap</B>] [<B>-output filename</B>]... file.xs
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
This compiler is typically run by the makefiles created by ExtUtils::MakeMaker
or by Module::Build or other Perl module build tools.
<P>
<I>xsubpp</I> will compile <FONT SIZE="-1">XS</FONT> code into C code by embedding the constructs
necessary to let C functions manipulate Perl values and creates the glue
necessary to let Perl access those functions. The compiler uses typemaps to
determine how to map C function parameters and variables to Perl values.
<P>
The compiler will search for typemap files called <I>typemap</I>. It will use
the following search path to find default typemaps, with the rightmost
typemap taking precedence.
<P>
<PRE>
../../../typemap:../../typemap:../typemap:typemap
</PRE>
<P>
It will also use a default typemap installed as <TT>&quot;ExtUtils::typemap&quot;</TT>.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
Note that the <TT>&quot;XSOPT&quot;</TT> MakeMaker option may be used to add these options to
any makefiles generated by MakeMaker.
<DL COMPACT>
<DT id="1"><B>-hiertype</B><DD>
Retains '::' in type names so that C<FONT SIZE="-2">++</FONT> hierarchical types can be mapped.
<DT id="2"><B>-except</B><DD>
Adds exception handling stubs to the C code.
<DT id="3"><B>-typemap typemap</B><DD>
Indicates that a user-supplied typemap should take precedence over the
default typemaps. This option may be used multiple times, with the last
typemap having the highest precedence.
<DT id="4"><B>-output filename</B><DD>
Specifies the name of the output file to generate. If no file is
specified, output will be written to standard output.
<DT id="5"><B>-v</B><DD>
Prints the <I>xsubpp</I> version number to standard output, then exits.
<DT id="6"><B>-prototypes</B><DD>
By default <I>xsubpp</I> will not automatically generate prototype code for
all xsubs. This flag will enable prototypes.
<DT id="7"><B>-noversioncheck</B><DD>
Disables the run time test that determines if the object file (derived
from the <TT>&quot;.xs&quot;</TT> file) and the <TT>&quot;.pm&quot;</TT> files have the same version
number.
<DT id="8"><B>-nolinenumbers</B><DD>
Prevents the inclusion of '#line' directives in the output.
<DT id="9"><B>-nooptimize</B><DD>
Disables certain optimizations. The only optimization that is currently
affected is the use of <I>target</I>s by the output C code (see perlguts).
This may significantly slow down the generated code, but this is the way
<B>xsubpp</B> of 5.005 and earlier operated.
<DT id="10"><B>-noinout</B><DD>
Disable recognition of <TT>&quot;IN&quot;</TT>, <TT>&quot;OUT_LIST&quot;</TT> and <TT>&quot;INOUT_LIST&quot;</TT> declarations.
<DT id="11"><B>-noargtypes</B><DD>
Disable recognition of ANSI-like descriptions of function signature.
<DT id="12"><B>-C<FONT SIZE="-2">++</FONT></B><DD>
Currently doesn't do anything at all. This flag has been a no-op for
many versions of perl, at least as far back as perl5.003_07. It's
allowed here for backwards compatibility.
<DT id="13"><B>-s=...</B> or <B>-strip=...</B><DD>
<I>This option is obscure and discouraged.</I>
<P>
If specified, the given string will be stripped off from the beginning
of the C function name in the generated <FONT SIZE="-1">XS</FONT> functions (if it starts with that prefix).
This only applies to XSUBs without <TT>&quot;CODE&quot;</TT> or <TT>&quot;PPCODE&quot;</TT> blocks.
For example, the <FONT SIZE="-1">XS:</FONT>
<P>
<PRE>
void foo_bar(int i);
</PRE>
<P>
when <TT>&quot;xsubpp&quot;</TT> is invoked with <TT>&quot;-s foo_&quot;</TT> will install a <TT>&quot;foo_bar&quot;</TT>
function in Perl, but really call <TT>bar(i)</TT> in C. Most of the time,
this is the opposite of what you want and failure modes are somewhat
obscure, so please avoid this option where possible.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>ENVIRONMENT</H2>
No environment variables are used.
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHOR</H2>
Originally by Larry Wall. Turned into the <TT>&quot;ExtUtils::ParseXS&quot;</TT> module
by Ken Williams.
<A NAME="lbAH">&nbsp;</A>
<H2>MODIFICATION HISTORY</H2>
See the file <I>Changes</I>.
<A NAME="lbAI">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+perl">perl</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+perlxs">perlxs</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+perlxstut">perlxstut</A></B>(1), ExtUtils::ParseXS
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="14"><A HREF="#lbAB">NAME</A><DD>
<DT id="15"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="16"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="17"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="18"><A HREF="#lbAF">ENVIRONMENT</A><DD>
<DT id="19"><A HREF="#lbAG">AUTHOR</A><DD>
<DT id="20"><A HREF="#lbAH">MODIFICATION HISTORY</A><DD>
<DT id="21"><A HREF="#lbAI">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:31 GMT, March 31, 2021
</BODY>
</HTML>