/
Makefile.PL
74 lines (63 loc) · 1.79 KB
/
Makefile.PL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
use 5.008_007;
use ExtUtils::MakeMaker;
use strict;
use warnings;
use Config;
use File::Temp();
use Getopt::Long 'GetOptions';
GetOptions(
'meta' => \my $meta,
'no-build-spvm-modules' => \my $no_build_spvm_modules,
);
if ($meta) {
$no_build_spvm_modules = 1;
}
# Check supported environment
unless ($meta) {
require SPVM::Builder::Config;
# Need a compiler supporting c++11
my $config = SPVM::Builder::Config->new_cpp(file_optional => 1);
my $cc = $config->cc;
my $tmp_dir = File::Temp->newdir;
unless (system("$cc -o $tmp_dir/cpp11_check.o --std=c++11 t/support/cpp11_check.cpp") == 0) {
warn "Need a compiler supporting c++11\n";
die "OS unsupported\n";
}
}
my %spvm_requires = ('SPVM' => '0.9670');
WriteMakefile(
NAME => 'SPVM::Resource::Re2::V2022_06_01',
VERSION_FROM => 'lib/SPVM/Resource/Re2/V2022_06_01.pm',
PREREQ_PM => {}, # e.g., Module::Name => 1.1
LICENSE => 'perl_5',
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/SPVM/Resource/Re2/V2022_06_01.pm',
AUTHOR => 'Yuki Kimoto<kimoto.yuki@gmail.com>') : ()),
test => {TESTS => 't/*.t'},
clean => {FILES => ['.spvm_build', 't/.spvm_build']},
META_MERGE => {
'meta-spec' => { version => 2 },
resources => {
repository => {
type => 'git',
url => 'https://github.com/yuki-kimoto/SPVM-Resource-Re2-V2022_06_01.git',
web => 'https://github.com/yuki-kimoto/SPVM-Resource-Re2-V2022_06_01',
},
},
},
CONFIGURE_REQUIRES => {
%spvm_requires,
},
PREREQ_PM => {
%spvm_requires,
},
NORECURS => 1,
);
sub MY::postamble {
my $make_rule = '';
unless ($no_build_spvm_modules) {
require SPVM::Builder::Util::API;
}
return $make_rule;
}
1;