FFI::Build::MM - FFI::Build installer code for ExtUtils::MakeMaker
version 0.02
In your Makefile.PL:
use ExtUtils::MakeMaker; use FFI::Build::MM; my $fbmm = Alien::Build::MM->new; WriteMakefile($fbmm->mm_args( ABSTRACT => 'My FFI extension', DISTNAME => 'Foo-Bar-Baz-FFI', NAME => 'Foo::Bar::Baz::FFI', VERSION_FROM => 'lib/Foo/Bar/Baz/FFI.pm', ... )); sub MY::postamble { $fbmm->mm_postamble; }
Then put the C, C++ or Fortran files in ./ffi for your runtime library and ./t/ffi for your test time library.
./ffi
./t/ffi
This module provides a thin layer between FFI::Build and ExtUtils::MakeMaker. Its interface is influenced by the design of Alien::Build::MM. The idea is that for your distribution you throw some C, C++ or Fortran source files into a directory called ffi and these files will be compiled and linked into a library that can be used by your module. There is a control file ffi/*.fbx which can be used to control the compiler and linker options. (options passed directly into FFI::Build). The interface for this file is still under development.
ffi
ffi/*.fbx
my $fbmm = FFI::Build::MM->new;
Create a new instance of FFI::Build::MM.
my %new_args = $fbmm->mm_args(%old_args);
This method does two things:
my $postamble = $fbmm->mm_postamble;
This returns the Makefile postamble used by ExtUtils::MakeMaker. The synopsis above for how to invoke it properly. It adds the following Make targets:
build the main runtime library in ./ffi.
Build the test library in ./t/ffi.
Clean any runtime or test libraries already built.
Normally you do not need to build these targets manually, they will be built automatically at the appropriate stage.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2018 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.
To install FFI::Build, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FFI::Build
CPAN shell
perl -MCPAN -e shell install FFI::Build
For more information on module installation, please visit the detailed CPAN module installation guide.