Initial Commit
This commit is contained in:
357
database/perl/vendor/lib/FFI/Build/File/Base.pm
vendored
Normal file
357
database/perl/vendor/lib/FFI/Build/File/Base.pm
vendored
Normal file
@@ -0,0 +1,357 @@
|
||||
package FFI::Build::File::Base;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use 5.008004;
|
||||
use Carp ();
|
||||
use FFI::Temp;
|
||||
use File::Basename ();
|
||||
use FFI::Build::Platform;
|
||||
use overload '""' => sub { $_[0]->path }, bool => sub { 1 }, fallback => 1;
|
||||
|
||||
# ABSTRACT: Base class for File::Build files
|
||||
our $VERSION = '1.34'; # VERSION
|
||||
|
||||
|
||||
sub new
|
||||
{
|
||||
my($class, $content, %config) = @_;
|
||||
|
||||
my $base = $config{base} || 'ffi_build_';
|
||||
my $dir = $config{dir};
|
||||
my $build = $config{build};
|
||||
my $platform = $config{platform} || FFI::Build::Platform->new;
|
||||
|
||||
my $self = bless {
|
||||
platform => $platform,
|
||||
build => $build,
|
||||
}, $class;
|
||||
|
||||
if(!defined $content)
|
||||
{
|
||||
Carp::croak("content is required");
|
||||
}
|
||||
elsif(ref($content) eq 'ARRAY')
|
||||
{
|
||||
$self->{path} = File::Spec->catfile(@$content);
|
||||
}
|
||||
elsif(ref($content) eq 'SCALAR')
|
||||
{
|
||||
my %args;
|
||||
$args{TEMPLATE} = "${base}XXXXXX";
|
||||
$args{DIR} = $dir if $dir;
|
||||
$args{SUFFIX} = $self->default_suffix;
|
||||
$args{UNLINK} = 0;
|
||||
|
||||
my $fh = $self->{fh} = FFI::Temp->new(%args);
|
||||
|
||||
binmode( $fh, $self->default_encoding );
|
||||
print $fh $$content;
|
||||
close $fh;
|
||||
|
||||
$self->{path} = $fh->filename;
|
||||
$self->{temp} = 1;
|
||||
}
|
||||
elsif(ref($content) eq '')
|
||||
{
|
||||
$self->{path} = $content;
|
||||
}
|
||||
|
||||
if($self->platform->osname eq 'MSWin32')
|
||||
{
|
||||
$self->{native} = File::Spec->catfile($self->{path});
|
||||
$self->{path} =~ s{\\}{/}g;
|
||||
}
|
||||
|
||||
$self;
|
||||
}
|
||||
|
||||
|
||||
sub default_suffix { die "must define a default extension in subclass" }
|
||||
sub default_encoding { die "must define an encoding" }
|
||||
sub accept_suffix { () }
|
||||
|
||||
|
||||
sub path { shift->{path} }
|
||||
sub basename { File::Basename::basename shift->{path} }
|
||||
sub dirname { File::Basename::dirname shift->{path} }
|
||||
sub is_temp { shift->{temp} }
|
||||
sub platform { shift->{platform} }
|
||||
sub build { shift->{build} }
|
||||
|
||||
|
||||
sub native {
|
||||
my($self) = @_;
|
||||
$self->platform->osname eq 'MSWin32'
|
||||
? $self->{native}
|
||||
: $self->{path};
|
||||
}
|
||||
|
||||
|
||||
sub slurp
|
||||
{
|
||||
my($self) = @_;
|
||||
my $fh;
|
||||
open($fh, '<', $self->path) || Carp::croak "Error opening @{[ $self->path ]} for read $!";
|
||||
binmode($fh, $self->default_encoding);
|
||||
my $content = do { local $/; <$fh> };
|
||||
close $fh;
|
||||
$content;
|
||||
}
|
||||
|
||||
|
||||
sub keep
|
||||
{
|
||||
delete shift->{temp};
|
||||
}
|
||||
|
||||
|
||||
sub build_item
|
||||
{
|
||||
Carp::croak("Not implemented!");
|
||||
}
|
||||
|
||||
|
||||
sub needs_rebuild
|
||||
{
|
||||
my($self, @source) = @_;
|
||||
# if the target doesn't exist, then we definitely
|
||||
# need a rebuild.
|
||||
return 1 unless -f $self->path;
|
||||
my $target_time = [stat $self->path]->[9];
|
||||
foreach my $source (@source)
|
||||
{
|
||||
my $source_time = [stat "$source"]->[9];
|
||||
return 1 if ! defined $source_time;
|
||||
return 1 if $source_time > $target_time;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
sub ld
|
||||
{
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub DESTROY
|
||||
{
|
||||
my($self) = @_;
|
||||
|
||||
if($self->{temp})
|
||||
{
|
||||
unlink($self->path);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=encoding UTF-8
|
||||
|
||||
=head1 NAME
|
||||
|
||||
FFI::Build::File::Base - Base class for File::Build files
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
version 1.34
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
Create your own file class
|
||||
|
||||
package FFI::Build::File::Foo;
|
||||
use base qw( FFI::Build::File::Base );
|
||||
use constant default_suffix => '.foo';
|
||||
use constant default_encoding => ':utf8';
|
||||
|
||||
Use it:
|
||||
|
||||
# use an existing file in the filesystem
|
||||
my $file = FFI::Build::File::Foo->new('src/myfile.foo');
|
||||
|
||||
# generate a temp file with provided content
|
||||
# file will be deletd when $file falls out of scope.
|
||||
my $file = FFI::Build::File::Foo->new(\'content for a temp foo');
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This class is the base class for other L<FFI::Build::File> classes.
|
||||
|
||||
=head1 CONSTRUCTOR
|
||||
|
||||
=head2 new
|
||||
|
||||
my $file = FFI::Build::File::Base->new(\$content, %options);
|
||||
my $file = FFI::Build::File::Base->new($filename, %options);
|
||||
|
||||
Create a new instance of the file class. You may provide either the
|
||||
content of the file as a scalar reference, or the path to an existing
|
||||
filename. Options:
|
||||
|
||||
=over 4
|
||||
|
||||
=item base
|
||||
|
||||
The base name for any temporary file C<ffi_build_> by default.
|
||||
|
||||
=item build
|
||||
|
||||
The L<FFI::Build> instance to use.
|
||||
|
||||
=item dir
|
||||
|
||||
The directory to store any temporary file.
|
||||
|
||||
=item platform
|
||||
|
||||
The L<FFI::Build::Platform> instance to use.
|
||||
|
||||
=back
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=head2 default_suffix
|
||||
|
||||
my $suffix = $file->default_suffix;
|
||||
|
||||
B<MUST> be overridden in the subclass. This is the standard extension for the file type. C<.c> for a C file, C<.o> or C<.obj> for an object file depending on platform. etc.
|
||||
|
||||
=head2 default_encoding
|
||||
|
||||
my $encoding = $file->default_encoding;
|
||||
|
||||
B<MUST> be overridden in the subclass. This is the passed to C<binmode> when the file is opened for reading or writing.
|
||||
|
||||
=head2 accept_suffix
|
||||
|
||||
my @suffix_list = $file->accept_suffix;
|
||||
|
||||
Returns a list of regexes that recognize the file type.
|
||||
|
||||
=head2 path
|
||||
|
||||
my $path = $file->path;
|
||||
|
||||
The full or relative path to the file.
|
||||
|
||||
=head2 basename
|
||||
|
||||
my $basename = $file->basename;
|
||||
|
||||
The base filename part of the path.
|
||||
|
||||
=head2 dirname
|
||||
|
||||
my $dir = $file->dirname;
|
||||
|
||||
The directory part of the path.
|
||||
|
||||
=head2 is_temp
|
||||
|
||||
my $bool = $file->is_temp;
|
||||
|
||||
Returns true if the file is temporary, that is, it will be deleted when the file object falls out of scope.
|
||||
You can call C<keep>, to keep the file.
|
||||
|
||||
=head2 platform
|
||||
|
||||
my $platform = $file->platform;
|
||||
|
||||
The L<FFI::Build::Platform> instance used for this file object.
|
||||
|
||||
=head2 build
|
||||
|
||||
my $build = $file->build;
|
||||
|
||||
The L<FFI::Build> instance used for this file object, if any.
|
||||
|
||||
=head2 native
|
||||
|
||||
my $path = $file->native;
|
||||
|
||||
Returns the operating system native version of the filename path. On Windows, this means that forward slash C<\> is
|
||||
used instead of backslash C</>.
|
||||
|
||||
=head2 slurp
|
||||
|
||||
my $content = $file->slurp;
|
||||
|
||||
Returns the content of the file.
|
||||
|
||||
=head2 keep
|
||||
|
||||
$file->keep;
|
||||
|
||||
Turns off the temporary flag on the file object, meaning it will not automatically be deleted when the
|
||||
file object is deallocated or falls out of scope.
|
||||
|
||||
=head2 build_item
|
||||
|
||||
$file->build_item;
|
||||
|
||||
Builds the file into its natural output type, usually an object file. It returns a new file instance,
|
||||
or if the file is an object file then it returns empty list.
|
||||
|
||||
=head2 build_all
|
||||
|
||||
$file->build_all;
|
||||
|
||||
If implemented the file in question can directly create a shared or dynamic library
|
||||
without needing a link step. This is useful for languages that have their own build
|
||||
systems.
|
||||
|
||||
=head2 needs_rebuild
|
||||
|
||||
my $bool = $file->needs_rebuild
|
||||
|
||||
=head2 ld
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Author: Graham Ollis E<lt>plicease@cpan.orgE<gt>
|
||||
|
||||
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 Pisar (ppisar)
|
||||
|
||||
Mohammad S Anwar (MANWAR)
|
||||
|
||||
Håkon Hægland (hakonhagland, HAKONH)
|
||||
|
||||
Meredith (merrilymeredith, MHOWARD)
|
||||
|
||||
Diab Jerius (DJERIUS)
|
||||
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
This software is copyright (c) 2015,2016,2017,2018,2019,2020 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.
|
||||
|
||||
=cut
|
||||
244
database/perl/vendor/lib/FFI/Build/File/C.pm
vendored
Normal file
244
database/perl/vendor/lib/FFI/Build/File/C.pm
vendored
Normal file
@@ -0,0 +1,244 @@
|
||||
package FFI::Build::File::C;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use 5.008004;
|
||||
use base qw( FFI::Build::File::Base );
|
||||
use constant default_suffix => '.c';
|
||||
use constant default_encoding => ':utf8';
|
||||
use Capture::Tiny ();
|
||||
use File::Path ();
|
||||
use FFI::Build::File::Object;
|
||||
|
||||
# ABSTRACT: Class to track C source file in FFI::Build
|
||||
our $VERSION = '1.34'; # VERSION
|
||||
|
||||
|
||||
sub accept_suffix
|
||||
{
|
||||
(qr/\.(c|i)$/)
|
||||
}
|
||||
|
||||
sub build_item
|
||||
{
|
||||
my($self) = @_;
|
||||
|
||||
my $oname = $self->basename;
|
||||
$oname =~ s/\.(c(xx|pp)|i)?$//;
|
||||
$oname .= $self->platform->object_suffix;
|
||||
|
||||
my $buildname = '_build';
|
||||
$buildname = $self->build->buildname if $self->build;
|
||||
|
||||
my $object = FFI::Build::File::Object->new(
|
||||
[ $self->dirname, $buildname, $oname ],
|
||||
platform => $self->platform,
|
||||
build => $self->build,
|
||||
);
|
||||
|
||||
return $object if -f $object->path && !$object->needs_rebuild($self->_deps);
|
||||
|
||||
File::Path::mkpath($object->dirname, { verbose => 0, mode => oct(700) });
|
||||
|
||||
my @cmd = (
|
||||
$self->_base_args,
|
||||
-c => $self->path,
|
||||
$self->platform->flag_object_output($object->path),
|
||||
);
|
||||
|
||||
my($out, $exit) = Capture::Tiny::capture_merged(sub {
|
||||
$self->platform->run(@cmd);
|
||||
});
|
||||
|
||||
if($exit || !-f $object->path)
|
||||
{
|
||||
print $out;
|
||||
die "error building $object from $self";
|
||||
}
|
||||
elsif($self->build && $self->build->verbose >= 2)
|
||||
{
|
||||
print $out;
|
||||
}
|
||||
elsif($self->build && $self->build->verbose >= 1)
|
||||
{
|
||||
print "CC @{[ $self->path ]}\n";
|
||||
}
|
||||
|
||||
$object;
|
||||
}
|
||||
|
||||
sub cc
|
||||
{
|
||||
my($self) = @_;
|
||||
$self->platform->cc;
|
||||
}
|
||||
|
||||
sub _base_args
|
||||
{
|
||||
my($self) = @_;
|
||||
my @cmd = ($self->cc);
|
||||
push @cmd, $self->build->cflags_I if $self->build;
|
||||
push @cmd, $self->platform->ccflags;
|
||||
push @cmd, @{ $self->build->cflags } if $self->build;
|
||||
@cmd;
|
||||
}
|
||||
|
||||
sub _base_args_cpp
|
||||
{
|
||||
my($self) = @_;
|
||||
my @cmd = ($self->platform->cpp);
|
||||
push @cmd, $self->build->cflags_I if $self->build;
|
||||
push @cmd, grep /^-[DI]/, $self->platform->ccflags;
|
||||
push @cmd, grep /^-D/, @{ $self->build->cflags } if $self->build;
|
||||
@cmd;
|
||||
}
|
||||
|
||||
sub build_item_cpp
|
||||
{
|
||||
my($self) = @_;
|
||||
|
||||
my $oname = $self->basename;
|
||||
$oname =~ s/\.(c(xx|pp)|i)$?$//;
|
||||
$oname .= '.i';
|
||||
|
||||
my $buildname = '_build';
|
||||
$buildname = $self->build->buildname if $self->build;
|
||||
|
||||
my $ifile = FFI::Build::File::C->new(
|
||||
[ $self->dirname, $buildname, $oname ],
|
||||
platform => $self->platform,
|
||||
build => $self->build,
|
||||
);
|
||||
|
||||
File::Path::mkpath($ifile->dirname, { verbose => 0, mode => oct(700) });
|
||||
|
||||
my @cmd = (
|
||||
$self->_base_args_cpp,
|
||||
$self->path,
|
||||
);
|
||||
|
||||
my($out, $err, $exit) = Capture::Tiny::capture(sub {
|
||||
$self->platform->run(@cmd);
|
||||
});
|
||||
|
||||
if($exit)
|
||||
{
|
||||
print "[out]\n$out\n" if defined $out && $out ne '';
|
||||
print "[err]\n$err\n" if defined $err && $err ne '';
|
||||
die "error building $ifile from $self";
|
||||
}
|
||||
else
|
||||
{
|
||||
my $fh;
|
||||
open($fh, '>', $ifile->path);
|
||||
print $fh $out;
|
||||
close $fh;
|
||||
}
|
||||
|
||||
$ifile;
|
||||
}
|
||||
|
||||
sub _deps
|
||||
{
|
||||
my($self) = @_;
|
||||
|
||||
return $self->path unless $self->platform->cc_mm_works;
|
||||
|
||||
my @cmd = (
|
||||
$self->_base_args,
|
||||
'-MM',
|
||||
$self->path,
|
||||
);
|
||||
|
||||
my($out,$err,$exit) = Capture::Tiny::capture(sub {
|
||||
$self->platform->run(@cmd);
|
||||
});
|
||||
|
||||
if($exit)
|
||||
{
|
||||
print $out;
|
||||
print $err;
|
||||
warn "error computing dependencies for $self";
|
||||
return ($self->path);
|
||||
}
|
||||
else
|
||||
{
|
||||
$out =~ s/^\+.*\n//; # remove the command line
|
||||
# which on windows could have an confusing :
|
||||
my(undef, $deps) = split /:/, $out, 2;
|
||||
$deps =~ s/^\s+//;
|
||||
$deps =~ s/\s+$//;
|
||||
return grep !/^\\$/, split /\s+/, $deps;
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=encoding UTF-8
|
||||
|
||||
=head1 NAME
|
||||
|
||||
FFI::Build::File::C - Class to track C source file in FFI::Build
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
version 1.34
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use FFI::Build::File::C;
|
||||
|
||||
my $c = FFI::Build::File::C->new('src/foo.c');
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
File class for C source files.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Author: Graham Ollis E<lt>plicease@cpan.orgE<gt>
|
||||
|
||||
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 Pisar (ppisar)
|
||||
|
||||
Mohammad S Anwar (MANWAR)
|
||||
|
||||
Håkon Hægland (hakonhagland, HAKONH)
|
||||
|
||||
Meredith (merrilymeredith, MHOWARD)
|
||||
|
||||
Diab Jerius (DJERIUS)
|
||||
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
This software is copyright (c) 2015,2016,2017,2018,2019,2020 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.
|
||||
|
||||
=cut
|
||||
100
database/perl/vendor/lib/FFI/Build/File/CXX.pm
vendored
Normal file
100
database/perl/vendor/lib/FFI/Build/File/CXX.pm
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
package FFI::Build::File::CXX;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use 5.008004;
|
||||
use base qw( FFI::Build::File::C );
|
||||
use constant default_suffix => '.cxx';
|
||||
use constant default_encoding => ':utf8';
|
||||
|
||||
# ABSTRACT: Class to track C source file in FFI::Build
|
||||
our $VERSION = '1.34'; # VERSION
|
||||
|
||||
|
||||
sub accept_suffix
|
||||
{
|
||||
(qr/\.c(xx|pp)$/)
|
||||
}
|
||||
|
||||
sub cc
|
||||
{
|
||||
my($self) = @_;
|
||||
$self->platform->cxx;
|
||||
}
|
||||
|
||||
sub ld
|
||||
{
|
||||
my($self) = @_;
|
||||
$self->platform->cxx;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=encoding UTF-8
|
||||
|
||||
=head1 NAME
|
||||
|
||||
FFI::Build::File::CXX - Class to track C source file in FFI::Build
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
version 1.34
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use FFI::Build::File::CXX;
|
||||
|
||||
my $c = FFI::Build::File::CXX->new('src/foo.cxx');
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
File class for C++ source files.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Author: Graham Ollis E<lt>plicease@cpan.orgE<gt>
|
||||
|
||||
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 Pisar (ppisar)
|
||||
|
||||
Mohammad S Anwar (MANWAR)
|
||||
|
||||
Håkon Hægland (hakonhagland, HAKONH)
|
||||
|
||||
Meredith (merrilymeredith, MHOWARD)
|
||||
|
||||
Diab Jerius (DJERIUS)
|
||||
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
This software is copyright (c) 2015,2016,2017,2018,2019,2020 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.
|
||||
|
||||
=cut
|
||||
101
database/perl/vendor/lib/FFI/Build/File/Library.pm
vendored
Normal file
101
database/perl/vendor/lib/FFI/Build/File/Library.pm
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
package FFI::Build::File::Library;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use 5.008004;
|
||||
use base qw( FFI::Build::File::Base );
|
||||
use constant default_encoding => ':raw';
|
||||
|
||||
# ABSTRACT: Class to track object file in FFI::Build
|
||||
our $VERSION = '1.34'; # VERSION
|
||||
|
||||
|
||||
sub default_suffix
|
||||
{
|
||||
shift->platform->library_suffix;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=encoding UTF-8
|
||||
|
||||
=head1 NAME
|
||||
|
||||
FFI::Build::File::Library - Class to track object file in FFI::Build
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
version 1.34
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use FFI::Build;
|
||||
|
||||
my $build = FFI::Build->new(source => 'src/*.c');
|
||||
# $lib is an instance of FFI::Build::File::Library
|
||||
my $lib = $build->build;
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This is a class to track a library generated by L<FFI::Build>.
|
||||
This is returned by L<FFI::Build>'s build method. This class
|
||||
is a subclass of L<FFI::Build::File::Base>. The most important
|
||||
method is probably C<path>, which returns the path to the library
|
||||
which can be passed into L<FFI::Platypus> for immediate use.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=head2 path
|
||||
|
||||
my $path = $lib->path;
|
||||
|
||||
Returns the path of the library.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Author: Graham Ollis E<lt>plicease@cpan.orgE<gt>
|
||||
|
||||
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 Pisar (ppisar)
|
||||
|
||||
Mohammad S Anwar (MANWAR)
|
||||
|
||||
Håkon Hægland (hakonhagland, HAKONH)
|
||||
|
||||
Meredith (merrilymeredith, MHOWARD)
|
||||
|
||||
Diab Jerius (DJERIUS)
|
||||
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
This software is copyright (c) 2015,2016,2017,2018,2019,2020 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.
|
||||
|
||||
=cut
|
||||
98
database/perl/vendor/lib/FFI/Build/File/Object.pm
vendored
Normal file
98
database/perl/vendor/lib/FFI/Build/File/Object.pm
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
package FFI::Build::File::Object;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use 5.008004;
|
||||
use base qw( FFI::Build::File::Base );
|
||||
use constant default_encoding => ':raw';
|
||||
use Carp ();
|
||||
|
||||
# ABSTRACT: Class to track object file in FFI::Build
|
||||
our $VERSION = '1.34'; # VERSION
|
||||
|
||||
|
||||
sub default_suffix
|
||||
{
|
||||
shift->platform->object_suffix;
|
||||
}
|
||||
|
||||
sub build_item
|
||||
{
|
||||
my($self) = @_;
|
||||
unless(-f $self->path)
|
||||
{
|
||||
Carp::croak "File not built"
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=encoding UTF-8
|
||||
|
||||
=head1 NAME
|
||||
|
||||
FFI::Build::File::Object - Class to track object file in FFI::Build
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
version 1.34
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use FFI::Build::File::Object;
|
||||
my $o = FFI::Build::File::Object->new('src/_build/foo.o');
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This class represents an object file. You normally do not need
|
||||
to use it directly.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Author: Graham Ollis E<lt>plicease@cpan.orgE<gt>
|
||||
|
||||
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 Pisar (ppisar)
|
||||
|
||||
Mohammad S Anwar (MANWAR)
|
||||
|
||||
Håkon Hægland (hakonhagland, HAKONH)
|
||||
|
||||
Meredith (merrilymeredith, MHOWARD)
|
||||
|
||||
Diab Jerius (DJERIUS)
|
||||
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
This software is copyright (c) 2015,2016,2017,2018,2019,2020 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.
|
||||
|
||||
=cut
|
||||
Reference in New Issue
Block a user