Groonga-API
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
use strict;
use warnings;
use FindBin;
use ExtUtils::MakeMaker;
my $win32 = ($^O eq 'MSWin32');
# use Devel::CheckLib for sure?
my ($groonga_h, $inc, $libs) = check_env() or do {
warn "groonga.h is not found; install groonga and/or set GROONGA_INC/GROONGA_LIBS environmental variables if necessary\n";
exit(0); # N/A
};
my @export_ok;
extract_constants($groonga_h);
extract_apis($groonga_h);
extract_bulk($groonga_h);
write_export(\@export_ok);
my %params = (
NAME => 'Groonga::API',
AUTHOR => 'Kenichi Ishigaki <ishigaki@cpan.org>',
VERSION_FROM => 'lib/Groonga/API.pm',
ABSTRACT_FROM => 'lib/Groonga/API.pm',
LICENSE => 'perl',
OBJECT => '$(O_FILES)',
PREREQ_PM => {
'Exporter' => 0,
'JSON::XS' => 0,
'Path::Extended' => 0,
'Test::Differences' => 0,
'Test::More' => '0.88',
'Test::UseAllModules' => '0.10',
'version' => '0.77',
},
META_MERGE => {
resources => {
repository => 'https://github.com/charsbar/groonga-api',
},
},
test => {TESTS => 't/*.t t/*/*.t'},
clean => {FILES => '*.inc *.old *.log'},
);
$params{INC} = $inc if $inc;
$params{LIBS} = $libs if $libs;
my $eumm = eval $ExtUtils::MakeMaker::VERSION;
delete $params{LICENSE} if $eumm < 6.31;
delete $params{META_MERGE} if $eumm < 6.46;
WriteMakefile(%params);
#------------
# utilities
#------------
sub check_env {
my ($groonga_h, $inc, $libs);
my @incpath = qw(/usr/local/include /usr/include);
if ($win32 && eval {require Win32}) {
my $path = Win32::GetShortPathName('c:\Program Files\groonga\include');
push @incpath, $path if $path;
}
if ($ENV{GROONGA_INC}) {
$inc = $ENV{GROONGA_INC};
$inc =~ s|^["']||;
$inc =~ s|["']$||;
$inc =~ s/^\-I//;
$inc =~ s|\\|/|g;
$inc =~ s|/$||g;
unshift @incpath, $inc;
}
for (@incpath) {
if (-e "$_/groonga/groonga.h") {
$groonga_h = "$_/groonga/groonga.h";
$inc = $_;
last;
}
}
return unless $groonga_h;
(my $lib = $inc) =~ s|include$|lib|;
$libs = $ENV{GROONGA_LIBS} || "-L$lib -l" . ($win32 ? "libgroonga.dll" : "groonga");
$inc = $ENV{GROONGA_INC} || "-I$inc";
return ($groonga_h, $inc, $libs);
}
sub extract_constants {
( run in 2.258 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )