Support for Perl extensions. A C/C++ compiler is required:
def options(opt):
opt.load('compiler_c perl')
def configure(conf):
conf.load('compiler_c perl')
conf.check_perl_version((5,6,0))
conf.check_perl_ext_devel()
conf.check_perl_module('Cairo')
conf.check_perl_module('Devel::PPPort 4.89')
def build(bld):
bld(
features = 'c cshlib perlext',
source = 'Mytest.xs',
target = 'Mytest',
install_path = '${ARCHDIR_PERL}/auto')
bld.install_files('${ARCHDIR_PERL}', 'Mytest.pm')
Task generator method
Change the values of cshlib_PATTERN and cxxshlib_PATTERN to remove the lib prefix from library names.
Feature : | perlext |
---|
Create waflib.Tools.perl.xsubpp tasks to process .xs files
Bases: waflib.Task.Task
Process .xs files
Configuration Method bound to waflib.Configure.ConfigurationContext
Check if Perl is installed, and set the variable PERL. minver is supposed to be a tuple
Configuration Method bound to waflib.Configure.ConfigurationContext
Check if specified perlmodule is installed.
The minimum version can be specified by specifying it after modulename like this:
def configure(conf):
conf.check_perl_module("Some::Module 2.92")
Configuration Method bound to waflib.Configure.ConfigurationContext
Check for configuration needed to build perl extensions.
Sets different xxx_PERLEXT variables in the environment.
Also sets the ARCHDIR_PERL variable useful as installation path, which can be overridden by --with-perl-archdir option.
Add the --with-perl-archdir and --with-perl-binary command-line options.
Decorator: register a task generator method which will be invoked during the processing of source files for the extension given:
from waflib import Task
class mytask(Task):
run_str = 'cp ${SRC} ${TGT}'
@extension('.moo')
def create_maa_file(self, node):
self.create_task('mytask', node, node.change_ext('.maa'))
def build(bld):
bld(source='foo.moo')
Decorator: register a task generator method that will be executed when the object attribute ‘feature’ contains the corresponding key(s):
from waflib.Task import feature
@feature('myfeature')
def myfunction(self):
print('that is my feature!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – feature names |
---|
Decorator: attach new configuration functions to waflib.Build.BuildContext and waflib.Configure.ConfigurationContext. The methods bound will accept a parameter named ‘mandatory’ to disable the configuration errors:
def configure(conf):
conf.find_program('abc', mandatory=False)
Parameters: | f (function) – method to bind |
---|
Decorator: register a task generator method which will be executed before the functions of given name(s):
from waflib.TaskGen import feature, before
@feature('myfeature')
@before_method('fun2')
def fun1(self):
print('feature 1!')
@feature('myfeature')
def fun2(self):
print('feature 2!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – method names |
---|
Features defined in this module: