Alien-FFI
view release on metacpan or search on metacpan
0.20_05 2018-05-30 20:51:57 -0400
- Diagnostic release
0.20_04 2018-05-30 07:49:31 -0400
- Diagnostic release
0.20_03 2018-05-29 15:25:11 -0400
- Added additional tests
0.20_02 2018-05-29 12:41:38 -0400
- Add some simple minded detection for avx and aes flags on i386
Only works on systems with /proc/cpuinfo
0.20_01 2018-05-29 10:02:17 -0400
- Disable avx and aes instructions on i386
0.19 2018-05-19 09:40:13 -0400
- Identical to 0.18_01 release except for the hardcoded RC0
- Moved git repository to
https://github.com/Perl5-FFI/Alien-FFI
0.11 2015-04-24 12:41:12 -0400
- require Alien::Base 0.017 for bug fixes
0.10 2015-04-22 07:20:59 -0400
- use alien_stage_install
0.09 2015-03-18 13:00:16 -0400
- Use older version 3.1 when building from source with Microsoft Visual C++
newer versions seem to be broken with that compiler
- Build with same -arch flags as Perl on Darwin / OS X
0.08 2015-02-24 12:25:47 -0500
- Turn off Alien::Base blib detection
- Make libs and cflags class methods should work correctly
before or after ./Build install
0.07 2015-02-16 18:16:54 -0500
- Promote to production
0.06_05 2015-02-16 10:07:27 -0500
- Fixed MSWin32 logic, removed MB requirement of 0.4202
0.06_04 2015-02-15 08:17:38 -0500
- Bump MB requirement up to 0.4202
$build->log('edit libffi.pc.in');
$libffi_pc->copy('libffi.pc.in.orig');
$libffi_pc->edit_lines(sub {
s/^toolexeclibdir=.*$/toolexeclibdir=\${libdir\}/;
});
}
};
meta->after_hook( gather_share => sub {
my($build) = @_;
$build->runtime_prop->{$_} .= " -DFFI_BUILDING" for qw( cflags cflags_static );
$build->runtime_prop->{$_} =~ s{-L}{-LIBPATH:}g for qw( libs libs_static );
$build->runtime_prop->{$_} =~ s{-l([A-Za-z]+)}{$1.LIB}g for qw( libs libs_static );
});
}
}
if($^O eq 'darwin')
{
my @ldflags = shellwords $Config{ldflags};
my @arch;
while(@ldflags)
{
my $arg = shift @ldflags;
next unless $arg eq "-arch";
push @arch, $arg, shift @ldflags;
}
if(@arch)
{
$configure .= " LDFLAGS='@arch'";
$configure .= " CFLAGS='@arch'";
}
}
if($^O eq 'openbsd')
{
grep { $_->{version} ne '3.4.3' }
@{ $ret->{list} }
];
$ret;
});
}
if($Config{archname} =~ /^i[3456]86/)
{
my %flags;
# TODO: This probe will not work on systems without /proc
if(-f '/proc/cpuinfo')
{
my $fh;
open($fh, '<', '/proc/cpuinfo');
my($flags) = map { my $x = $_; $x =~ s/^.*:\s+//; $x } grep /^flags/, <$fh>;
close $fh;
chomp $flags;
%flags = map { $_ => 1 } split /\s+/, $flags;
}
if($flags{avx} && $flags{aes})
{
log "You seem to have avx and aes flags, allowing libffi to detect the CPU";
log "see https://github.com/PerlFFI/Alien-FFI/issues/6"
}
else
{
# disable avx and aes instructions as the detection logic for libffi seems
# to be broken. See https://github.com/PerlFFI/Alien-FFI/issues/6
log "Could not detect avx and aes flags. The detection logic is pretty dumb, and may be wrong.";
log "Please let us know if we got it wrong, and how we can improve it.";
log "see https://github.com/PerlFFI/Alien-FFI/issues/6";
$configure .= " --with-gcc-arch=pentium4";
}
}
build [
sub {
my($build) = @_;
$build->runtime_prop->{my_configure} = "%{configure} $configure";
workflow = static
workflow = linux
workflow = windows
workflow = macos
workflow = msys2-mingw
diag_preamble = | $post_diag = sub {
diag_preamble = | require Alien::FFI;
diag_preamble = | diag "version = ", Alien::FFI->config('version');
diag_preamble = | diag "cflags = ", Alien::FFI->cflags;
diag_preamble = | diag "cflags_static = ", Alien::FFI->cflags_static;
diag_preamble = | diag "libs = ", Alien::FFI->libs;
diag_preamble = | diag "libs_static = ", Alien::FFI->libs_static;
diag_preamble = | diag "my_configure = ", Alien::FFI->runtime_prop->{my_configure} if defined Alien::FFI->runtime_prop->{my_configure};
diag_preamble = | require IPC::Cmd;
diag_preabmle = | require Capture::Tiny;
diag_preamble = | if(IPC::Cmd::can_run('lsb_release'))
diag_preamble = | {
diag_preamble = | spacer();
diag_preamble = | diag Capture::Tiny::capture_merged(sub {
diag_preamble = | system 'lsb_release', '-a';
t/00_diag.t view on Meta::CPAN
Capture::Tiny
ExtUtils::MakeMaker
IPC::Cmd
Test2::V0
Test::Alien
);
$post_diag = sub {
require Alien::FFI;
diag "version = ", Alien::FFI->config('version');
diag "cflags = ", Alien::FFI->cflags;
diag "cflags_static = ", Alien::FFI->cflags_static;
diag "libs = ", Alien::FFI->libs;
diag "libs_static = ", Alien::FFI->libs_static;
diag "my_configure = ", Alien::FFI->runtime_prop->{my_configure} if defined Alien::FFI->runtime_prop->{my_configure};
require IPC::Cmd;
if(IPC::Cmd::can_run('lsb_release'))
{
spacer();
diag Capture::Tiny::capture_merged(sub {
system 'lsb_release', '-a';
();
( run in 5.941 seconds using v1.01-cache-2.11-cpan-94b05bcf43c )