Alien::FFI(3)

πŸ“¦
version 0.27 Β· 3 versions
, in fedora 43

πŸ’– Alien::FFI β€” bestie, it's giving "build libffi and hand it over" πŸ’–

This is a page from the User Contributed Perl Documentation πŸŽ€ the manual name is Alien::FFI and section 3, if you were wondering. We're in the perl manpages, babes. Let's go πŸ¦‹


✨ NAME ✨

Alien::FFI β€” it builds libffi and makes it available. That's the whole job. Iconic behavior honestly. πŸ‘‘


🌸 VERSION 🌸

version 0.27 ✨


πŸŽ€ SYNOPSIS πŸŽ€

okay so first, in your Makefile.PL, you're gonna do this:

use ExtUtils::MakeMaker;
use Alien::Base::Wrapper ();

WriteMakefile(
  Alien::Base::Wrapper->new('Alien::FFI')->mm_args2(
    # MakeMaker args
    NAME => 'My::XS',
    ...
  ),
);

and then, in your Build.PL, the vibe shifts slightly and you do this instead:

use Module::Build;
use Alien::Base::Wrapper qw( Alien::FFI !export );

my $builder = Module::Build->new(
  ...
  configure_requires => {
    'Alien::FFI' => '0',
    ...
  },
  Alien::Base::Wrapper->mb_args,
  ...
);

$build->create_build_script;

no cap, that's it. copy-paste era πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so like. This distribution installs libffi so that other Perl distributions can use it. It's the friend who brings the snacks to the group hang. πŸ“

and here's the part where it's lowkey smart: if libffi is already installed for your operating system, and it can actually be found, then this distribution will just use the libffi that comes with your OS. periodt. no extra work.

but if it's not there? 😭 then it goes and downloads it from the Internet, builds it, and installs it for you. main character energy: it handles its own business so you don't have to. πŸ”₯


🌈 SEE ALSO 🌈

  • FFI::Platypus β€” write Perl bindings to non-Perl libraries, and you get to skip C and skip XS. literally the dream. ✨
  • FFI::CheckLib β€” checks that a library is actually available for FFI. the vibe check, but for libraries. πŸ’œ

πŸ‘‘ AUTHOR πŸ‘‘

Author: Graham Ollis <plicease@cpan.org> 🫢

Contributors:

  • Petr PΓ­saΕ™ (ppisar) 🌸

This software is copyright (c) 2014-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. slay, legally speaking. πŸ’…


and that's the whole page bestie!! πŸ¦‹ this cutie was rendered by perl v5.42.0 back on 2025-09-08, and yeah the footer says Alien::FFI(3) again because manpages love a little encore. mwah πŸ’‹ bye!! 🌟

πŸ“¦ where this page comes from