Acme-Hidek
view release on metacpan or search on metacpan
inc/Module/Install/XSUtil.pm view on Meta::CPAN
no warnings 'numeric', 'uninitialized';
return sprintf '%g', $version;
}
sub cc_warnings{
my($self) = @_;
$self->_xs_initialize();
if(_is_gcc()){
$self->cc_append_to_ccflags(qw(-Wall));
my $gccversion = _gccversion();
if($gccversion >= 4.0){
$self->cc_append_to_ccflags(qw(-Wextra));
if(!($UseC99 or $UseCplusplus)) {
# Note: MSVC++ doesn't support C99,
# so -Wdeclaration-after-statement helps
# ensure C89 specs.
$self->cc_append_to_ccflags(qw(-Wdeclaration-after-statement));
}
if($gccversion >= 4.1 && !$UseCplusplus) {
$self->cc_append_to_ccflags(qw(-Wc++-compat));
}
}
else{
$self->cc_append_to_ccflags(qw(-W -Wno-comment));
}
}
elsif(_is_msvc()){
$self->cc_append_to_ccflags(qw(-W3));
}
else{
# TODO: support other compilers
}
return;
}
sub c99_available {
my($self) = @_;
inc/Module/Install/XSUtil.pm view on Meta::CPAN
}
$self->{xsu_loaded_checklib}++;
$self->configure_requires( "Devel::CheckLib" => "0.4" );
$self->build_requires( "Devel::CheckLib" => "0.4" );
}
Devel::CheckLib::check_lib_or_exit(@dcl_args);
}
sub cc_append_to_ccflags{
my($self, @ccflags) = @_;
$self->_xs_initialize();
my $mm = $self->makemaker_args;
$mm->{CCFLAGS} ||= $Config{ccflags};
$mm->{CCFLAGS} .= q{ } . join q{ }, @ccflags;
return;
}
sub cc_define{
my($self, @defines) = @_;
$self->_xs_initialize();
my $mm = $self->makemaker_args;
if(exists $mm->{DEFINE}){
inc/Module/Install/XSUtil.pm view on Meta::CPAN
my($self, $h_file) = @_;
my @functions;
($home_directory) = <~> unless defined $home_directory;
# get header file contents through cpp(1)
my $contents = do {
my $mm = $self->makemaker_args;
my $cppflags = q{"-I}. File::Spec->join($Config{archlib}, 'CORE') . q{"};
$cppflags =~ s/~/$home_directory/g;
$cppflags .= ' ' . $mm->{INC} if $mm->{INC};
$cppflags .= ' ' . ($mm->{CCFLAGS} || $Config{ccflags});
$cppflags .= ' ' . $mm->{DEFINE} if $mm->{DEFINE};
my $add_include = _is_msvc() ? '-FI' : '-include';
$cppflags .= ' ' . join ' ',
map{ qq{$add_include "$_"} } qw(EXTERN.h perl.h XSUB.h);
my $cppcmd = qq{$Config{cpprun} $cppflags $h_file};
# remove all the -arch options to workaround gcc errors:
# "-E, -S, -save-temps and -M options are not allowed
# with multiple -arch flags"
$cppcmd =~ s/ -arch \s* \S+ //xmsg;
_verbose("extract functions from: $cppcmd") if _VERBOSE;
`$cppcmd`;
};
unless(defined $contents){
die "Cannot call C pre-processor ($Config{cpprun}): $! ($?)";
}
# remove other include file contents
inc/Module/Install/XSUtil.pm view on Meta::CPAN
:#ifndef LIKELY /* they are just a compiler's hint */
:#define LIKELY(x) (!!(x))
:#define UNLIKELY(x) (!!(x))
:#endif
:
:#ifndef newSVpvs_share
:#define newSVpvs_share(s) Perl_newSVpvn_share(aTHX_ STR_WITH_LEN(s), 0U)
:#endif
:
:#ifndef get_cvs
:#define get_cvs(name, flags) get_cv(name, flags)
:#endif
:
:#ifndef GvNAME_get
:#define GvNAME_get GvNAME
:#endif
:#ifndef GvNAMELEN_get
:#define GvNAMELEN_get GvNAMELEN
:#endif
:
:#ifndef CvGV_set
( run in 5.658 seconds using v1.01-cache-2.11-cpan-94b05bcf43c )