Revision: | 1.1 |
Committed: | Mon Oct 29 08:52:29 2007 UTC (16 years, 7 months ago) by root |
Branch: | MAIN |
CVS Tags: | rel-0_7, rel-1_71, rel-0_5, rel-0_6, rel-1_85, rel-0_8, rel-0_9, rel-1_8, rel-1_72, rel-1_1, rel-1_3, rel-1_2, rel-1_5, rel-1_4, rel-1_6, rel-0_03, rel-1_81, rel-1_86, rel-0_51 |
Log Message: | *** empty log message *** |
# | Content |
---|---|
1 | package EV::MakeMaker; |
2 | |
3 | BEGIN { eval { require warnings } && warnings->unimport ("uninitialized") } |
4 | |
5 | use Config; |
6 | use base 'Exporter'; |
7 | |
8 | @EXPORT_OK = qw(&ev_args $installsitearch); |
9 | |
10 | my %opt; |
11 | |
12 | for my $opt (split /:+/, $ENV{PERL_MM_OPT}) { |
13 | my ($k,$v) = split /=/, $opt; |
14 | $opt{$k} = $v; |
15 | } |
16 | |
17 | my $extra = $Config{sitearch}; |
18 | |
19 | $extra =~ s/$Config{prefix}/$opt{PREFIX}/ if |
20 | exists $opt{PREFIX}; |
21 | |
22 | for my $d ($extra, @INC) { |
23 | if (-e "$d/EV/EVAPI.h") { |
24 | $installsitearch = $d; |
25 | last; |
26 | } |
27 | } |
28 | |
29 | sub ev_args { |
30 | my %arg = @_; |
31 | $arg{INC} .= " -I$installsitearch/EV"; |
32 | %arg; |
33 | } |
34 | |
35 | 1; |
36 | __END__ |
37 | |
38 | =head1 NAME |
39 | |
40 | EV::MakeMaker - MakeMaker glue for the C-level EV API |
41 | |
42 | =head1 SYNOPSIS |
43 | |
44 | This allows you to access some libevent functionality from other perl |
45 | modules. |
46 | |
47 | =head1 DESCRIPTION |
48 | |
49 | For optimal performance, hook into EV at the C-level. You'll need |
50 | to make changes to your C<Makefile.PL> and add code to your C<xs> / |
51 | C<c> file(s). |
52 | |
53 | =head1 HOW TO |
54 | |
55 | =head2 Makefile.PL |
56 | |
57 | use EV::MakeMaker qw(ev_args); |
58 | |
59 | # ... set up %args ... |
60 | |
61 | WriteMakefile (ev_args (%args)); |
62 | |
63 | =head2 XS |
64 | |
65 | #include "EVAPI.h" |
66 | |
67 | BOOT: |
68 | I_EV_API ("YourModule"); |
69 | |
70 | =head2 API |
71 | |
72 | See the EVAPI.h header. |
73 | |
74 | =cut |