NAME

Dist::Zilla::Plugin::FFI::CheckLib - FFI::CheckLib alternative to Dist::Zilla::Plugin::CheckLib

VERSION

version 1.07

SYNOPSIS

In your dist.ini:

[FFI::CheckLib]
lib = zmq

DESCRIPTION

This is a Dist::Zilla plugin that modifies the Makefile.PL or Build.PL in your distribution to check for a dynamic library FFI::Platypus (or similar) can access; uses FFI::CheckLib to perform the check.

If the library is not available, the program exits with a status of zero, which will result in a NA result on a CPAN test reporter.

This module is adapted directly from Dist::Zilla::Plugin::CheckLib, copyright (c) 2014 by Karen Etheridge (CPAN: ETHER). Look there for XS modules.

CONFIGURATION OPTIONS

All options are as documented in FFI::CheckLib:

lib

The name of a single dynamic library (for example, zmq). Can be used more than once.

FFI::CheckLib will prepend lib and append an appropriate dynamic library suffix as needed.

symbol

A symbol that must be found. Can be used more than once.

systempath

The system search path to use (instead of letting FFI::CheckLib determine paths). Can be used more than once.

libpath

Additional path to search for libraries. Can be used more than once.

alien

The name of an Alien class that provides the Alien::Base interface for dynamic libraries.

Can be used more than once.

recursive

If set to true, directories specified in libpath will be searched recursively.

Defaults to false.

try_linker_script

If set to true, uses the linker command to attempt to resolve .so files for platforms where .so files are linker scripts.

Defaults to false.

verify

The verify function body to use. For each usage, is one line of the function body. You can prefix with the pipe | character to get proper indentation.

verify = | my($name, $libpath) = @_;
verify = | my $ffi = FFI::Platypus->new;
verify = | $ffi->lib($libpath);
verify = | my $f = $ffi->function('foo_version', [] => 'int');
verify = | if($f) {
verify = |   return $f->call() >= 500; # we accept version 500 or better
verify = | } else {
verify = |   return;
verify = | }

If you use any modules, such as FFI::Platypus in this example, be sure that you declare them as configure requires.

SEE ALSO

AUTHOR

Author: Graham Ollis <plicease@cpan.org>

Contributors:

Zaki Mughal (zmughal)

COPYRIGHT AND LICENSE

This software is copyright (c) 2018-2022 by Graham Ollis.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.