1FFI::Build::Platform(3)User Contributed Perl DocumentatioFnFI::Build::Platform(3)
2
3
4
6 FFI::Build::Platform - Platform specific configuration.
7
9 version 1.32
10
12 use FFI::Build::Platform;
13
15 This class is used to abstract out the platform specific parts of the
16 FFI::Build system. You shouldn't need to use it directly in most
17 cases, unless you are working on FFI::Build itself.
18
20 new
21 my $platform = FFI::Build::Platform->new;
22
23 Create a new instance of FFI::Build::Platform.
24
25 default
26 my $platform = FFI::Build::Platform->default;
27
28 Returns the default instance of FFI::Build::Platform.
29
31 All of these methods may be called either as instance or classes
32 methods. If called as a class method, the default instance will be
33 used.
34
35 osname
36 my $osname = $platform->osname;
37
38 The "os name" as understood by Perl. This is the same as $^O.
39
40 object_suffix
41 my $suffix = $platform->object_suffix;
42
43 The object suffix for the platform. On UNIX this is usually ".o". On
44 Windows this is usually ".obj".
45
46 library_suffix
47 my(@suffix) = $platform->library_suffix;
48 my $suffix = $platform->library_suffix;
49
50 The library suffix for the platform. On Linux and some other UNIX this
51 is often ".so". On OS X, this is ".dylib" and ".bundle". On Windows
52 this is ".dll".
53
54 library_prefix
55 my $prefix = $platform->library_prefix;
56
57 The library prefix for the platform. On Unix this is usually "lib", as
58 in "libfoo".
59
60 cc
61 my @cc = @{ $platform->cc };
62
63 The C compiler
64
65 cpp
66 my @cpp = @{ $platform->cpp };
67
68 The C pre-processor
69
70 cxx
71 my @cxx = @{ $platform->cxx };
72
73 The C++ compiler that naturally goes with the C compiler.
74
75 for
76 my @for = @{ $platform->for };
77
78 The Fortran compiler that naturally goes with the C compiler.
79
80 ld
81 my $ld = $platform->ld;
82
83 The C linker
84
85 shellwords
86 my @words = $platform->shellwords(@strings);
87
88 This is a wrapper around Text::ParseWords's "shellwords" with some
89 platform workarounds applied.
90
91 ccflags
92 my @ccflags = @{ $platform->cflags};
93
94 The compiler flags, including those needed to compile object files that
95 can be linked into a dynamic library. On Linux, for example, this is
96 usually includes "-fPIC".
97
98 ldflags
99 my @ldflags = @{ $platform->ldflags };
100
101 The linker flags needed to link object files into a dynamic library.
102 This is NOT the "libs" style library flags that specify the location
103 and name of a library to link against, this is instead the flags that
104 tell the linker to generate a dynamic library. On Linux, for example,
105 this is usually "-shared".
106
107 cc_mm_works
108 my $bool = $platform->cc_mm_works;
109
110 Returns the flags that can be passed into the C compiler to compute
111 dependencies.
112
113 flag_object_output
114 my @flags = $platform->flag_object_output($object_filename);
115
116 Returns the flags that the compiler recognizes as being used to write
117 out to a specific object filename.
118
119 flag_library_output
120 my @flags = $platform->flag_library_output($library_filename);
121
122 Returns the flags that the compiler recognizes as being used to write
123 out to a specific library filename.
124
125 flag_exe_output
126 my @flags = $platform->flag_exe_output($library_filename);
127
128 Returns the flags that the compiler recognizes as being used to write
129 out to a specific exe filename.
130
131 flag_export
132 my @flags = $platform->flag_export(@symbols);
133
134 Returns the flags that the linker recognizes for exporting functions.
135
136 which
137 my $path = $platform->which($command);
138
139 Returns the full path of the given command, if it is available,
140 otherwise "undef" is returned.
141
142 run
143 $platform->run(@command);
144
145 diag
146 Diagnostic for the platform as a string. This is for human consumption
147 only, and the format may and will change over time so do not attempt to
148 use is programmatically.
149
151 Author: Graham Ollis <plicease@cpan.org>
152
153 Contributors:
154
155 Bakkiaraj Murugesan (bakkiaraj)
156
157 Dylan Cali (calid)
158
159 pipcet
160
161 Zaki Mughal (zmughal)
162
163 Fitz Elliott (felliott)
164
165 Vickenty Fesunov (vyf)
166
167 Gregor Herrmann (gregoa)
168
169 Shlomi Fish (shlomif)
170
171 Damyan Ivanov
172
173 Ilya Pavlov (Ilya33)
174
175 Petr Pisar (ppisar)
176
177 Mohammad S Anwar (MANWAR)
178
179 Håkon Hægland (hakonhagland, HAKONH)
180
181 Meredith (merrilymeredith, MHOWARD)
182
183 Diab Jerius (DJERIUS)
184
186 This software is copyright (c) 2015,2016,2017,2018,2019,2020 by Graham
187 Ollis.
188
189 This is free software; you can redistribute it and/or modify it under
190 the same terms as the Perl 5 programming language system itself.
191
192
193
194perl v5.32.0 2020-09-21 FFI::Build::Platform(3)