Acme-Hidek
view release on metacpan or search on metacpan
inc/Module/Install/XSUtil.pm view on Meta::CPAN
sub want_xs {
my($self, $default) = @_;
return $want_xs if defined $want_xs;
# you're using this module, you must want XS by default
# unless PERL_ONLY is true.
$default = !$ENV{PERL_ONLY} if not defined $default;
foreach my $arg(@ARGV){
my ($k, $v) = split '=', $arg; # MM-style named args
if ($k eq 'PUREPERL_ONLY' && defined $v) {
return $want_xs = !$v;
}
elsif($arg eq '--pp'){ # old-style
return $want_xs = 0;
}
elsif($arg eq '--xs'){
return $want_xs = 1;
}
}
if ($ENV{PERL_MM_OPT}) {
my($v) = $ENV{PERL_MM_OPT} =~ /\b PUREPERL_ONLY = (\S+) /xms;
if (defined $v) {
inc/Module/Install/XSUtil.pm view on Meta::CPAN
return 0 if not $self->cc_available();
require File::Temp;
require File::Basename;
my $tmpfile = File::Temp->new(SUFFIX => '.c');
$tmpfile->print(<<'C99');
// include a C99 header
#include <stdbool.h>
inline // a C99 keyword with C99 style comments
int test_c99() {
int i = 0;
i++;
int j = i - 1; // another C99 feature: declaration after statement
return j;
}
C99
$tmpfile->close();
( run in 0.603 second using v1.01-cache-2.11-cpan-49f99fa48dc )