Alien-libmaxminddb
view release on metacpan or search on metacpan
libmaxminddb.PL view on Meta::CPAN
use 5.014;
use warnings;
use utf8;
my $DIST_NAME = 'Alien-libmaxminddb';
my $BUNDLED_VERSION = '1.13.3';
package PgkConf;
use File::Spec qw();
sub new {
my ($class, %attrs) = @_;
my $self = bless \%attrs, $class;
$self->{pkgconf} = $self->find_pkgconf(qw(pkgconf pkg-config));
return $self;
}
sub find_pkgconf {
my ($self, @programs) = @_;
my $devnull = File::Spec->devnull;
for my $pkgconf (@programs) {
my $output = `$pkgconf --version 2>$devnull`;
if ($? == 0) {
return $pkgconf;
}
}
return;
}
sub pkgconf {
my ($self, @options) = @_;
my $module = $self->{module};
my $devnull = File::Spec->devnull;
my $pkgconf = $self->{pkgconf};
if (defined $pkgconf) {
my $cmd = $pkgconf . q{ } . join(q{ }, @options) . q{ } . $module;
my $output = `$cmd 2>$devnull`;
if ($? == 0) {
chomp $output;
return 1, $output;
}
}
return 0, undef;
}
sub cflags {
my ($self) = @_;
return $self->pkgconf('--cflags');
}
sub libs {
( run in 1.415 second using v1.01-cache-2.11-cpan-fa01517f264 )