perl

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')
waflib.Tools.perl.init_perlext(self)[source]

Task generator method

Change the values of cshlib_PATTERN and cxxshlib_PATTERN to remove the lib prefix from library names.

Feature:perlext
waflib.Tools.perl.xsubpp_file(self, node)[source]

Create waflib.Tools.perl.xsubpp tasks to process .xs files

class waflib.Tools.perl.xsubpp(*k, **kw)[source]

Bases: waflib.Task.Task

Process .xs files

color = 'BLUE'
ext_out = ['.h']
hcode = '${PERL} ${XSUBPP} -noprototypes -typemap ${EXTUTILS_TYPEMAP} ${SRC} > ${TGT}'
orig_run_str = '${PERL} ${XSUBPP} -noprototypes -typemap ${EXTUTILS_TYPEMAP} ${SRC} > ${TGT}'
vars = ['EXTUTILS_TYPEMAP', 'PERL', 'XSUBPP']
waflib.Tools.perl.check_perl_version(self, minver=None)[source]

Configuration Method bound to waflib.Configure.ConfigurationContext

Check if Perl is installed, and set the variable PERL. minver is supposed to be a tuple

waflib.Tools.perl.check_perl_module(self, module)[source]

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")
waflib.Tools.perl.check_perl_ext_devel(self)[source]

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.

waflib.Tools.perl.options(opt)[source]

Add the --with-perl-archdir and --with-perl-binary command-line options.

waflib.Tools.perl.conf(f)

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
waflib.Tools.perl.feature(*k)

Decorator that registers 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
waflib.Tools.perl.before_method(*k)[source]

Decorator that registera 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
waflib.Tools.perl.extension(*k)

Decorator that registers 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')

Features defined in this module: