FFI::Build::MM(3pm)
πΈ FFI::Build::MM(3pm) β NAME πΈ
Okay so bestie, meet FFI::Build::MM β literally the FFI::Build installer code for ExtUtils::MakeMaker. It's the glue that lets your FFI extension build in a MakeMaker world, and yes, she's iconic. π
π VERSION π
Version 2.11. Periodt.
β¨ SYNOPSIS β¨
In your Makefile.PL, do the thing:
use ExtUtils::MakeMaker;
use FFI::Build::MM;
my $fbmm = FFI::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. π«Ά
π¦ DESCRIPTION π¦
This module is a thin layer between FFI::Build and ExtUtils::MakeMaker. Its interface is influenced by the design of Alien::Build::MM. The idea is literally: for your distribution, you throw some C, C++ or Fortran source files into a directory called ffi, and those files get compiled and linked into a library that your module can use. β¨
There's 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 β so bestie, consider that a work-in-progress vibe. π
π CONSTRUCTOR π
new
my $fbmm = FFI::Build::MM->new;
Create a new instance of FFI::Build::MM. Boom. Object acquired. π
π₯ METHODS π₯
mm_args
my %new_args = $fbmm->mm_args(%old_args);
This method does two things:
- reads the arguments to determine sensible defaults (library name, install location, etc).
- adjusts the arguments as necessary and returns an updated set of arguments.
Lowkey magic, highkey useful. π
mm_postamble
my $postamble = $fbmm->mm_postamble;
This returns the Makefile postamble used by ExtUtils::MakeMaker. The synopsis above shows how to invoke it properly. It adds the following Make targets:
fbx_build/ffiβ build the main runtime library in./ffi.fbx_test/ffi-testβ Build the test library in./t/ffi.fbx_clean/ffi-cleanβ 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. No cap. π
π AUTHOR π
Author: Graham Ollis <plicease@cpan.org>
Contributors:
- Bakkiaraj Murugesan (bakkiaraj)
- Dylan Cali (calid)
- pipcet
- Zaki Mughal (zmughal)
- Fitz Elliott (felliott)
- Vickenty Fesunov (vyf)
- Gregor Herrmann (gregoa)
- Shlomi Fish (shlomif)
- Damyan Ivanov
- Ilya Pavlov (Ilya33)
- Petr PΓsaΕ (ppisar)
- Mohammad S Anwar (MANWAR)
- HΓ₯kon HΓ¦gland (hakonhagland, HAKONH)
- Meredith (merrilymeredith, MHOWARD)
- Diab Jerius (DJERIUS)
- Eric Brine (IKEGAMI)
- szTheory
- JosΓ© JoaquΓn Atria (JJATRIA)
- Pete Houston (openstrike, HOUSTON)
- Lukas Mai (MAUKE)
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2015-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.
Okay bye bestie π β this page is from perl v5.42.3, dated 2026-08-20, and the module itself is version 2.11. Slay. π
π¦ where this page comes from
- ubuntu stonking: libffi-platypus-perl 2.11-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms