Skip to content
Newer
Older
100644 109 lines (102 sloc) 3.17 KB
0ec02aa @stash initial commit; read GETs, send canned 200 response
authored
1 use 5.008007;
d67d1a0 @audreyt * Older ExtUtils::MakeMaker doesn't grok CONFIGURE_REQUIRES, so be ex…
audreyt authored
2 use ExtUtils::MakeMaker 6.51;
0ec02aa @stash initial commit; read GETs, send canned 200 response
authored
3 use EV::MakeMaker qw/ev_args/;
4
e48e3c4 @stash Call `perl Makefile.PL -PROFILE` to use gcov/gprov
authored
5 {
6 package MY;
7 sub test_via_harness {
8 my($self, $perl, $tests) = @_;
9 local $_ = $self->SUPER::test_via_harness($perl, $tests);
10 s/PERL_DL_NONLAZY=1//g;
11 return $_;
12 }
13 sub test_via_script {
14 my($self, $perl, $tests) = @_;
15 local $_ = $self->SUPER::test_via_script($perl, $tests);
16 s/PERL_DL_NONLAZY=1//g;
17 return $_;
18 }
19 }
20
21 my $otherldflags = '';
534860a @stash RT#65239 Promote Plack to a dependency if present
authored
22 my $convert_deps = 1;
4ee7da5 @stash Refcount the connection properly this time
authored
23 if ($ARGV[0] =~ /^-DEBUG=?(\d*)$/) {
24 my $n = $1 || 1;
6029b85 @stash Don't supply the DEBUGGING flag for >=5.12.1 under -DEBUG
authored
25 my $opt = "OPTIMIZE=-DDEBUG=$n -g";
26 # with 5.12.1 and the -DDEBUGGING flag:
27 # dyld: Symbol not found: _Perl_pad_sv
28 $opt .= ($] >= 5.012_001) ? '' : ' -DDEBUGGING';
29 $ARGV[0] = $opt;
e48e3c4 @stash Call `perl Makefile.PL -PROFILE` to use gcov/gprov
authored
30 }
31 elsif ($ARGV[0] eq '-PROFILE') {
32 shift @ARGV;
18cd6b5 @stash Hand-optimize branches.
authored
33 $ARGV[0] = "OPTIMIZE=-g -fprofile-arcs -ftest-coverage";
34 $otherldflags = '-lgcov';
c7861ee @stash Add more profiling Makefile opts
authored
35 }
36 elsif ($ARGV[0] eq '-PROFILEUSE') {
6029b85 @stash Don't supply the DEBUGGING flag for >=5.12.1 under -DEBUG
authored
37 $ARGV[0] = "OPTIMIZE=-g -O3 -fprofile-use";
c7861ee @stash Add more profiling Makefile opts
authored
38 $otherldflags = '-fprofile-use';
e48e3c4 @stash Call `perl Makefile.PL -PROFILE` to use gcov/gprov
authored
39 }
534860a @stash RT#65239 Promote Plack to a dependency if present
authored
40 elsif ($ARGV[0] eq '-CPAN') {
41 $convert_deps = 0;
42 }
43
fe4fa21 @stash Add LeakTrace test
authored
44 # Convert optional Plack and other dependencies to a real dependency if it's
45 # present at build-time. (Fix:
46 # https://rt.cpan.org/Public/Bug/Display.html?id=65239)
47 my %want = (
48 'Plack' => 0.995,
49 'JSON::XS' => 2.0,
50 'Test::LeakTrace' => 0.13,
51 'Test::TCP' => 1.12,
52 );
53 my %have;
54
534860a @stash RT#65239 Promote Plack to a dependency if present
authored
55 if ($convert_deps) {
fe4fa21 @stash Add LeakTrace test
authored
56 local $@;
57 while (my ($pkg,$ver) = each %want) {
58 $have{$pkg} = eval "require $pkg; \$$pkg\::VERSION >= $ver";
59 }
534860a @stash RT#65239 Promote Plack to a dependency if present
authored
60 }
e48e3c4 @stash Call `perl Makefile.PL -PROFILE` to use gcov/gprov
authored
61
a53ef9f @stash Clean up Makefile.PL, bump version.
authored
62 # Set this to false if you get core-dumps. Gives a pretty good perf boost for
63 # simple responses. Look for FEERSUM_STEAL in the code to see what this does.
64 # In a nutshell: certain temporary values passed in as the body of a response
8e8540f @stash Disable "PV stealing" under threaded perls
authored
65 # have their string-value "stolen". This very much doesn't work under threaded
66 # perl (5.8.7 and 5.12.1 were tested) and probably doesn't work prior to
67 # 5.12.0.
68 use Config;
69 my $steal = ($] >= 5.012 && !defined($Config{useithreads}));
1be0e98 @stash Work with PADTMP scalars.
authored
70
0ec02aa @stash initial commit; read GETs, send canned 200 response
authored
71 WriteMakefile(ev_args(
a53ef9f @stash Clean up Makefile.PL, bump version.
authored
72 NAME => 'Feersum',
73 VERSION_FROM => 'lib/Feersum.pm',
74 ABSTRACT_FROM => 'lib/Feersum.pm',
75 AUTHOR => 'Jeremy Stashewsky <stash@cpan.org>',
76 LICENSE => 'perl',
77 CONFIGURE_REQUIRES => {
e0b5584 @stash Require EV 4.00
authored
78 'EV' => 4.00,
7c23090 @stash EU:MM 6.51 or higher is needed
authored
79 'ExtUtils::MakeMaker' => 6.51,
a53ef9f @stash Clean up Makefile.PL, bump version.
authored
80 },
81 BUILD_REQUIRES => {
82 'AnyEvent' => 5.261,
7c23090 @stash EU:MM 6.51 or higher is needed
authored
83 'Guard' => 1.012,
a53ef9f @stash Clean up Makefile.PL, bump version.
authored
84 'Test::More' => 0.94,
8fc2f19 @stash Convert to use Test::Fatal from Test::Exception
authored
85 'Test::Fatal' => 0.003,
fe4fa21 @stash Add LeakTrace test
authored
86 map { $_ => $want{$_} } grep { /^Test::/ && $have{$_} } keys %want
a53ef9f @stash Clean up Makefile.PL, bump version.
authored
87 },
88 PREREQ_PM => {
e0b5584 @stash Require EV 4.00
authored
89 'EV' => 4.00,
534860a @stash RT#65239 Promote Plack to a dependency if present
authored
90 'Scalar::Util' => 1.19,
fe4fa21 @stash Add LeakTrace test
authored
91 map { $_ => $want{$_} } grep { !/^Test::/ && $have{$_} } keys %want
a53ef9f @stash Clean up Makefile.PL, bump version.
authored
92 },
93 META_MERGE => {
7c23090 @stash EU:MM 6.51 or higher is needed
authored
94 recommends => {
fe4fa21 @stash Add LeakTrace test
authored
95 map { $_ => $want{$_} } grep { !$have{$_} } keys %want
7c23090 @stash EU:MM 6.51 or higher is needed
authored
96 },
5bb12d3 @stash Add resources to META.yml
authored
97 resources => {
98 repository => 'git://github.com/stash/Feersum.git',
99 license => 'http://dev.perl.org/licenses/',
100 },
7c23090 @stash EU:MM 6.51 or higher is needed
authored
101 'no_index' => {directory => ['eg','picohttpparser-git']},
8b823cd @stash Rename to Feersum
authored
102 },
a53ef9f @stash Clean up Makefile.PL, bump version.
authored
103 LIBS => [''],
06a1c2b @stash Oops, install bin/feersum as a script
authored
104 EXE_FILES => ['bin/feersum'],
dcde0d6 @stash Move constants to top of Feersum.xs and POD them.
authored
105 DEFINE => ($steal ? '-DFEERSUM_STEAL' : ''),
a53ef9f @stash Clean up Makefile.PL, bump version.
authored
106 INC => '-I.',
e48e3c4 @stash Call `perl Makefile.PL -PROFILE` to use gcov/gprov
authored
107 dynamic_lib => {OTHERLDFLAGS => $otherldflags},
0ec02aa @stash initial commit; read GETs, send canned 200 response
authored
108 ));
Something went wrong with that request. Please try again.