]> Dogcows Code - chaz/p5-Alien-ZMQ/blob - lib/Alien/ZMQ.pm
add smarter shell-quoting in the cflags and libs functions
[chaz/p5-Alien-ZMQ] / lib / Alien / ZMQ.pm
1 package Alien::ZMQ;
2 # ABSTRACT: detect and/or install zeromq
3
4 use warnings;
5 use strict;
6
7 use String::ShellQuote qw/shell_quote/;
8
9 =head1 DESCRIPTION
10
11 Upon installation, the target system is probed for the presence of libzmq. If
12 it is not found, zeromq 3.2.2 is installed in a shared directory. In short,
13 modules that need libzmq can depend on this module to make sure that it is
14 available.
15
16 =head1 SYNOPSIS
17
18 use Alien::ZMQ;
19
20 my $version = Alien::ZMQ::lib_version;
21
22 =head1 OPTIONS
23
24 These options to F<Build.PL> affect the installation of this module.
25
26 =over 4
27
28 =item --zmq-skip-probe
29
30 By default, zeromq is not compiled and installed if it is detected to already
31 be on the system. Use this to skip those checks and always install zeromq.
32
33 =item --zmq-config=...
34
35 Pass extra flags to zeromq's F<configure> script. You may want to consider
36 passing either C<--with-pgm> or C<--with-system-pgm> if you need support for
37 PGM; this is not enabled by default because it is not supported by every
38 system.
39
40 =item --zmq-libs=...
41
42 Pass extra flags to the linker when probing for an existing installation of
43 zeromq. In particular, if your F<libzmq.so> file is installed to a special
44 location, you may pass flags such as C<-L/opt/libzmq2/lib -lzmq>.
45
46 =item --zmq-cflags=...
47
48 Pass extra flags to the compiler when probing for an existing installation of
49 zeromq. These flags will not be used when actually compiling zeromq from
50 source. For that, just use the C<CFLAGS> environment variable.
51
52 =back
53
54 =head1 CAVEATS
55
56 Probing is only done upon installation, so if you are using a system-installed
57 version of libzmq and you uninstall or upgrade it, you will also need to
58 reinstall this module.
59
60 =head1 BUGS
61
62 Windows is not yet supported. Patches are welcome.
63
64 =head1 SEE ALSO
65
66 =over 4
67
68 =item * L<GitHub project|https://github.com/chazmcgarvey/p5-Alien-ZMQ>
69
70 =item * L<ZMQ> - good perl bindings for zeromq
71
72 =item * L<ZeroMQ|http://www.zeromq.org/> - official libzmq website
73
74 =back
75
76 =head1 ACKNOWLEDGEMENTS
77
78 The design and implementation of this module were influenced by other L<Alien>
79 modules, including L<Alien::GMP> and L<Alien::Tidyp>.
80
81 =method inc_version
82
83 Get the version number of libzmq as a dotted version string according to the
84 F<zmq.h> header file.
85
86 =cut
87
88 sub inc_version { }
89
90 =method lib_version
91
92 Get the version number of libzmq as a dotted version string according to the
93 F<libzmq.so> file.
94
95 =cut
96
97 sub lib_version { }
98
99 =method inc_dir
100
101 Get the directory containing the F<zmq.h> header file.
102
103 =cut
104
105 sub inc_dir { }
106
107 =method lib_dir
108
109 Get the directory containing the F<libzmq.so> file.
110
111 =cut
112
113 sub lib_dir { }
114
115 =method cflags
116
117 Get the C compiler flags required to compile a program that uses libzmq. This
118 is a shortcut for constructing a C<-I> flag using C<inc_dir>.
119
120 =cut
121
122 sub cflags {
123 "-I" . shell_quote(inc_dir);
124 }
125
126 =method libs
127
128 Get the linker flags required to link a program against libzmq. This is
129 a shortcut for constructing a C<-L> flag using C<lib_dir>, plus C<-lzmq>.
130
131 =cut
132
133 sub libs {
134 "-L" . shell_quote(lib_dir) . " -lzmq";
135 }
136
137 1;
This page took 0.040655 seconds and 4 git commands to generate.