FFI::B...atform(3pm)
π¦ FFI::Build::Platform β platform specific configuration π
okay so this is the FFI::B...atform(3pm) page bestie, and it's honestly giving "backstage pass to the FFI::Build machine" energy. Welcome π
β¨ NAME β¨
FFI::Build::Platform β literally just the platform-specific configuration bits. that's the whole vibe π
πΈ VERSION πΈ
version 2.11 β
π¦ SYNOPSIS π¦
use FFI::Build::Platform;
that's it. that's the whole synopsis. she's lowkey minimal and I respect it π«Ά
π DESCRIPTION π
okay so picture this: this class exists to abstract out all the platform specific parts of the FFI::Build system. like, all the "oh no every OS does this differently" mess gets hidden in here β¨
and ngl? you probably don't need to touch it directly in most cases. the only people who genuinely need to be in here are the ones working on FFI::Build itself. it's giving "staff only" door, iykyk π
π§ CONSTRUCTOR π§
π new
my $platform = FFI::Build::Platform->new;
creates a brand new instance of FFI::Build::Platform. fresh out the box, main character energy π
β default
my $platform = FFI::Build::Platform->default;
returns the default instance of FFI::Build::Platform. like, the one that's already chilling there waiting for you π«Ά
π₯ METHODS π₯
okay so listen β all of these methods may be called either as instance or classes methods. If called as a class method, the default instance will be used. that's the rule, no cap π
π osname
my $osname = $platform->osname;
the "os name" as understood by Perl. this is the same as $^O. iconic, honestly π
π¦ object_suffix
my $suffix = $platform->object_suffix;
the object suffix for the platform. on UNIX this is usually .o. on Windows this is usually .obj. bestie they really said "let's be different for no reason" π
π library_suffix
my(@suffix) = $platform->library_suffix;
my $suffix = $platform->library_suffix;
the library suffix for the platform β and yes she can give you a list or a scalar, she contains multitudes β¨
- on Linux and some other UNIX this is often
.so - on OS X, this is
.dyliband.bundle - on Windows this is
.dll
π library_prefix
my $prefix = $platform->library_prefix;
the library prefix for the platform. on Unix this is usually lib, as in libfoo. so foo walks in and leaves as libfoo. a glow-up fr fr π
π₯ cc
my @cc = @{ $platform->cc };
the C compiler π₯ (note she's an arrayref, so deref her before you @ her)
πΈ cpp
my @cpp = @{ $platform->cpp };
the C pre-processor πΈ
π cxx
my @cxx = @{ $platform->cxx };
the C++ compiler that naturally goes with the C compiler. they're a matched set, a duo, a package deal π«Ά
β cxxld
my @cxxld = @{ $platform->cxxld };
the C++ linker that naturally goes with the C compiler. same bestie-energy as above, just the linker edition π
π for
my @for = @{ $platform->for };
the Fortran compiler that naturally goes with the C compiler. yes the method is literally named for. yes that's confusing. no I don't make the rules π
π§ ld
my $ld = $platform->ld;
the C linker. that's it. she's short and she knows it π
π shellwords
my @words = $platform->shellwords(@strings);
this is a wrapper around Text::ParseWords's shellwords with some platform workarounds applied. so it's the vibe you know, just with extra β¨platform seasoningβ¨
π ccflags
my @ccflags = @{ $platform->cflags};
the compiler flags, including those needed to compile object files that can be linked into a dynamic library. on Linux, for example, this usually includes -fPIC. (also yes, the method is ccflags and the accessor inside is cflags β she's quirky like that, don't @ her π)
π ldflags
my @ldflags = @{ $platform->ldflags };
the linker flags needed to link object files into a dynamic library. and bestie, listen carefully: this is NOT the "libs" style library flags that specify the location and name of a library to link against. this is instead the flags that tell the linker to generate a dynamic library. on Linux, for example, this is usually -shared. don't mix them up, I'm begging π«Ά
π¦ cc_mm_works
my $bool = $platform->cc_mm_works;
returns the flags that can be passed into the C compiler to compute dependencies π (yes, the name says $bool and the description says flags β that's what the original says, so that's what you get, no notes π)
πΈ flag_object_output
my @flags = $platform->flag_object_output($object_filename);
returns the flags that the compiler recognizes as being used to write out to a specific object filename β¨
π flag_library_output
my @flags = $platform->flag_library_output($library_filename);
returns the flags that the compiler recognizes as being used to write out to a specific library filename πΈ
π₯ flag_exe_output
my @flags = $platform->flag_exe_output($library_filename);
returns the flags that the compiler recognizes as being used to write out to a specific exe filename. (and yeah, the example variable is literally $library_filename even though we're talking about an exe β that's just how she is, copy it exactly π)
β flag_export
my @flags = $platform->flag_export(@symbols);
returns the flags that the linker recognizes for exporting functions π
π§ which
my $path = $platform->which($command);
returns the full path of the given command, if it is available, otherwise undef is returned. so if she's not there, you get undef and a little bit of heartbreak π
π run
$platform->run(@command);
runs the thing. that's the whole bit. go off π
π diag
diagnostic for the platform as a string. and this is for human consumption only β the format may and will change over time, so do not attempt to use it programmatically. I'm so serious, don't parse her, she's not for that π
π«Ά 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)
look at that contributor list, it's giving squad goals πβ¨
π 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. π
and that's the page babes π β brought to you by perl v5.42.3, dated 2026-08-20, and yes the manual name is literally FFI::B...atform(3pm) because the title got truncated and honestly? she ate anyway π
β¨π¦
π¦ 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