InlineX::CPP2XS is a Perl module to convert from Inline C++ code to XS.
SYNOPSIS
#USAGE:
#cpp2xs($module_name, $package_name [, $build_dir] [, $config_opts])
use InlineX::CPP2XS qw(cpp2xs);
my $module_name = 'MY::XS_MOD';
my $package_name = 'MY::XS_MOD';
# $build_dir is an optional third arg.
# If omitted it defaults to '.' (the cwd).
my $build_dir = '/some/where/else';
# $config_opts is an optional fourth arg (hash reference)
my $config_opts = {'WRITE_PM' => 1,
'WRITE_MAKEFILE_PL' => 1,
'VERSION' => 0.42,
};
# Create /some/where/else/XS_MOD.xs from ./src/XS_MOD.cpp
# Will also create the typemap file /some/where/else/CPP.map
# if that file is going to be needed to build the module:
cpp2xs($module_name, $package_name, $build_dir);
# Or create XS_MOD.xs (and CPP.map, if needed) in the cwd:
cpp2xs($module_name, $package_name);
The optional fourth arg (a reference to a hash) is to enable the
passing of additional information and configuration options that
Inline may need - and also to enable the creation of the
Makefile.PL and .pm file(if desired).
See the "Recognised Hash Keys" section below.
# Create XS_MOD.xs in the cwd, and generate the Makefile.PL
# and XS_MOD.pm :
cpp2xs($module_name, $package_name, $config_opts);
NOTE: If you wish to supply the $config_opts argument, but not the
$build_dir argument then you simply omit the $build_dir argument.
That is, the following are equivalent:
cpp2xs($module_name, $package_name, '.', $config_opts);
cpp2xs($module_name, $package_name, $config_opts);
If a third argument is given, it's deemed to be the build directory
unless it's a hash reference (in which case it's deemed to be the
hash reference containing the additional config options).
Product's homepage
Requirements:
· Perl