/
Makefile.PL
114 lines (108 loc) · 3.82 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
use 5.008007;
use ExtUtils::MakeMaker 6.51;
use EV::MakeMaker qw/ev_args/;
{
package MY;
sub test_via_harness {
my($self, $perl, $tests) = @_;
local $_ = $self->SUPER::test_via_harness($perl, $tests);
s/PERL_DL_NONLAZY=1//g;
return $_;
}
sub test_via_script {
my($self, $perl, $tests) = @_;
local $_ = $self->SUPER::test_via_script($perl, $tests);
s/PERL_DL_NONLAZY=1//g;
return $_;
}
}
my $otherldflags = '';
my $convert_deps = 1;
if ($ARGV[0] =~ /^-DEBUG=?(\d*)$/) {
my $n = $1 || 1;
my $opt = "OPTIMIZE=-DDEBUG=$n -g";
# with 5.12.1 and the -DDEBUGGING flag:
# dyld: Symbol not found: _Perl_pad_sv
$opt .= ($] >= 5.012_001) ? '' : ' -DDEBUGGING';
$ARGV[0] = $opt;
}
elsif ($ARGV[0] eq '-PROFILE') {
shift @ARGV;
$ARGV[0] = "OPTIMIZE=-g -fprofile-arcs -ftest-coverage";
$otherldflags = '-lgcov';
}
elsif ($ARGV[0] eq '-PROFILEUSE') {
$ARGV[0] = "OPTIMIZE=-g -O3 -fprofile-use";
$otherldflags = '-fprofile-use';
}
elsif ($ARGV[0] eq '-CPAN') {
$convert_deps = 0;
}
# Convert optional Plack dependency to a real dependency if it's present at
# build-time. (Fix: https://rt.cpan.org/Public/Bug/Display.html?id=65239)
my $plack_req = 0.995;
my $json_xs_req = 2.0;
my $have_plack, $have_json_xs;
if ($convert_deps) {
$have_plack = eval 'require Plack; $Plack::VERSION >= 0.995';
$have_json_xs = eval 'require JSON::XS; $JSON::XS::VERSION >= 2.0';
}
# Set this to false if you get core-dumps. Gives a pretty good perf boost for
# simple responses. Look for FEERSUM_STEAL in the code to see what this does.
# In a nutshell: certain temporary values passed in as the body of a response
# have their string-value "stolen". This very much doesn't work under threaded
# perl (5.8.7 and 5.12.1 were tested) and probably doesn't work prior to
# 5.12.0.
use Config;
my $steal = ($] >= 5.012 && !defined($Config{useithreads}));
# Control the size of the main write-buffer structure in feersum. Making this
# value lower will use slightly less memory per connection at the cost of
# speed and vice-versa. It's most noticeable when you're app is buffering a
# lot of sparce writes. The default of 64 generally keeps usage under 4k per
# connection on full 64-bit when you take into account the other connection
# and request structures.
# NOTE: If your OS defines IOV_MAX or UIO_MAXIOV then this value will be
# forced to be at most that size with a #define. Solaris defines IOV_MAX to
# be 16. Linux and OSX generally have IOV_MAX as 1024.
my $iomatrix_size = 64;
WriteMakefile(ev_args(
NAME => 'Feersum',
VERSION_FROM => 'lib/Feersum.pm',
ABSTRACT_FROM => 'lib/Feersum.pm',
AUTHOR => 'Jeremy Stashewsky <stash@cpan.org>',
LICENSE => 'perl',
CONFIGURE_REQUIRES => {
'EV' => 4.00,
'ExtUtils::MakeMaker' => 6.51,
},
BUILD_REQUIRES => {
'AnyEvent' => 5.261,
'Guard' => 1.012,
'Test::More' => 0.94,
'Test::Fatal' => 0.003,
'Test::TCP' => 1.12,
},
PREREQ_PM => {
'EV' => 4.00,
'Scalar::Util' => 1.19,
($have_plack ? (Plack => $plack_req) : ()),
($have_json_xs ? ('JSON::XS' => $json_xs_req) : ()),
},
META_MERGE => {
recommends => {
($have_plack ? () : (Plack => $plack_req)),
($have_json_xs ? () : ('JSON::XS' => $json_xs_req)),
},
resources => {
repository => 'git://github.com/stash/Feersum.git',
license => 'http://dev.perl.org/licenses/',
},
'no_index' => {directory => ['eg','picohttpparser-git']},
},
LIBS => [''],
EXE_FILES => ['bin/feersum'],
DEFINE => "-DFEERSUM_IOMATRIX_SIZE=$iomatrix_size ".
($steal ? '-DFEERSUM_STEAL' : ''),
INC => '-I.',
dynamic_lib => {OTHERLDFLAGS => $otherldflags},
));