.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "FFI::Build::Platform 3pm" .TH FFI::Build::Platform 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME FFI::Build::Platform \- Platform specific configuration. .SH VERSION .IX Header "VERSION" version 2.08 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use FFI::Build::Platform; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This class is used to abstract out the platform specific parts of the FFI::Build system. You shouldn't need to use it directly in most cases, unless you are working on FFI::Build itself. .SH CONSTRUCTOR .IX Header "CONSTRUCTOR" .SS new .IX Subsection "new" .Vb 1 \& my $platform = FFI::Build::Platform\->new; .Ve .PP Create a new instance of FFI::Build::Platform. .SS default .IX Subsection "default" .Vb 1 \& my $platform = FFI::Build::Platform\->default; .Ve .PP Returns the default instance of FFI::Build::Platform. .SH METHODS .IX Header "METHODS" 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. .SS osname .IX Subsection "osname" .Vb 1 \& my $osname = $platform\->osname; .Ve .PP The "os name" as understood by Perl. This is the same as \f(CW$^O\fR. .SS object_suffix .IX Subsection "object_suffix" .Vb 1 \& my $suffix = $platform\->object_suffix; .Ve .PP The object suffix for the platform. On UNIX this is usually \f(CW\*(C`.o\*(C'\fR. On Windows this is usually \f(CW\*(C`.obj\*(C'\fR. .SS library_suffix .IX Subsection "library_suffix" .Vb 2 \& my(@suffix) = $platform\->library_suffix; \& my $suffix = $platform\->library_suffix; .Ve .PP The library suffix for the platform. On Linux and some other UNIX this is often \f(CW\*(C`.so\*(C'\fR. On OS X, this is \f(CW\*(C`.dylib\*(C'\fR and \f(CW\*(C`.bundle\*(C'\fR. On Windows this is \f(CW\*(C`.dll\*(C'\fR. .SS library_prefix .IX Subsection "library_prefix" .Vb 1 \& my $prefix = $platform\->library_prefix; .Ve .PP The library prefix for the platform. On Unix this is usually \f(CW\*(C`lib\*(C'\fR, as in \f(CW\*(C`libfoo\*(C'\fR. .SS cc .IX Subsection "cc" .Vb 1 \& my @cc = @{ $platform\->cc }; .Ve .PP The C compiler .SS cpp .IX Subsection "cpp" .Vb 1 \& my @cpp = @{ $platform\->cpp }; .Ve .PP The C pre-processor .SS cxx .IX Subsection "cxx" .Vb 1 \& my @cxx = @{ $platform\->cxx }; .Ve .PP The C++ compiler that naturally goes with the C compiler. .SS cxxld .IX Subsection "cxxld" .Vb 1 \& my @cxxld = @{ $platform\->cxxld }; .Ve .PP The C++ linker that naturally goes with the C compiler. .SS for .IX Subsection "for" .Vb 1 \& my @for = @{ $platform\->for }; .Ve .PP The Fortran compiler that naturally goes with the C compiler. .SS ld .IX Subsection "ld" .Vb 1 \& my $ld = $platform\->ld; .Ve .PP The C linker .SS shellwords .IX Subsection "shellwords" .Vb 1 \& my @words = $platform\->shellwords(@strings); .Ve .PP This is a wrapper around Text::ParseWords's \f(CW\*(C`shellwords\*(C'\fR with some platform workarounds applied. .SS ccflags .IX Subsection "ccflags" .Vb 1 \& my @ccflags = @{ $platform\->cflags}; .Ve .PP The compiler flags, including those needed to compile object files that can be linked into a dynamic library. On Linux, for example, this is usually includes \f(CW\*(C`\-fPIC\*(C'\fR. .SS ldflags .IX Subsection "ldflags" .Vb 1 \& my @ldflags = @{ $platform\->ldflags }; .Ve .PP The linker flags needed to link object files into a dynamic library. This is NOT the \f(CW\*(C`libs\*(C'\fR 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 \f(CW\*(C`\-shared\*(C'\fR. .SS cc_mm_works .IX Subsection "cc_mm_works" .Vb 1 \& my $bool = $platform\->cc_mm_works; .Ve .PP Returns the flags that can be passed into the C compiler to compute dependencies. .SS flag_object_output .IX Subsection "flag_object_output" .Vb 1 \& my @flags = $platform\->flag_object_output($object_filename); .Ve .PP Returns the flags that the compiler recognizes as being used to write out to a specific object filename. .SS flag_library_output .IX Subsection "flag_library_output" .Vb 1 \& my @flags = $platform\->flag_library_output($library_filename); .Ve .PP Returns the flags that the compiler recognizes as being used to write out to a specific library filename. .SS flag_exe_output .IX Subsection "flag_exe_output" .Vb 1 \& my @flags = $platform\->flag_exe_output($library_filename); .Ve .PP Returns the flags that the compiler recognizes as being used to write out to a specific exe filename. .SS flag_export .IX Subsection "flag_export" .Vb 1 \& my @flags = $platform\->flag_export(@symbols); .Ve .PP Returns the flags that the linker recognizes for exporting functions. .SS which .IX Subsection "which" .Vb 1 \& my $path = $platform\->which($command); .Ve .PP Returns the full path of the given command, if it is available, otherwise \f(CW\*(C`undef\*(C'\fR is returned. .SS run .IX Subsection "run" .Vb 1 \& $platform\->run(@command); .Ve .SS diag .IX Subsection "diag" Diagnostic for the platform as a string. This is for human consumption only, and the format may and will change over time so do not attempt to use is programmatically. .SH AUTHOR .IX Header "AUTHOR" Author: Graham Ollis .PP Contributors: .PP Bakkiaraj Murugesan (bakkiaraj) .PP Dylan Cali (calid) .PP pipcet .PP Zaki Mughal (zmughal) .PP Fitz Elliott (felliott) .PP Vickenty Fesunov (vyf) .PP Gregor Herrmann (gregoa) .PP Shlomi Fish (shlomif) .PP Damyan Ivanov .PP Ilya Pavlov (Ilya33) .PP Petr Písař (ppisar) .PP Mohammad S Anwar (MANWAR) .PP Håkon Hægland (hakonhagland, HAKONH) .PP Meredith (merrilymeredith, MHOWARD) .PP Diab Jerius (DJERIUS) .PP Eric Brine (IKEGAMI) .PP szTheory .PP José Joaquín Atria (JJATRIA) .PP Pete Houston (openstrike, HOUSTON) .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2015\-2022 by Graham Ollis. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.