Algorithm-ConsistentHash-Ketama
view release on metacpan or search on metacpan
inc/Module/Install/XSUtil.pm view on Meta::CPAN
99100101102103104105106107108109110111112113114115116117118119120121122123sub
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
231232233234235236237238239240241242243244245246247248249250
return
0
if
not
$self
->cc_available();
my
$tmpfile
= File::Temp->new(
SUFFIX
=>
'.c'
);
$tmpfile
->
(
<<'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.268 second using v1.01-cache-2.11-cpan-95122f20152 )