]> granicus.if.org Git - libevent/blob - Makefile.am
epoll: use epoll_pwait2() if available
[libevent] / Makefile.am
1 # Makefile.am for libevent
2 # Copyright 2000-2007 Niels Provos
3 # Copyright 2007-2012 Niels Provos and Nick Mathewson
4 #
5 # See LICENSE for copying information.
6
7 ACLOCAL_AMFLAGS = -I m4
8
9 # This is the "Release" of the Libevent ABI.  It takes precedence over
10 # the VERSION_INFO, so that two versions of Libevent with the same
11 # "Release" are never binary-compatible.
12 #
13 # This number incremented once for the 2.0 release candidate, and
14 # will increment for each series until we revise our interfaces enough
15 # that we can seriously expect ABI compatibility between series.
16 #
17 RELEASE = -release 2.2
18
19 # This is the version info for the libevent binary API.  It has three
20 # numbers:
21 #   Current  -- the number of the binary API that we're implementing
22 #   Revision -- which iteration of the implementation of the binary
23 #               API are we supplying?
24 #   Age      -- How many previous binary API versions do we also
25 #               support?
26 #
27 # To increment a VERSION_INFO (current:revision:age):
28 #    If the ABI didn't change:
29 #        Return (current:revision+1:age)
30 #    If the ABI changed, but it's backward-compatible:
31 #        Return (current+1:0:age+1)
32 #    If the ABI changed and it isn't backward-compatible:
33 #        Return (current+1:0:0)
34 #
35 # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
36 # UNLESS YOU REALLY REALLY HAVE TO.
37 VERSION_INFO = 1:0:0
38
39 # History:          RELEASE    VERSION_INFO
40 #  2.0.1-alpha --     2.0        1:0:0
41 #  2.0.2-alpha --                2:0:0
42 #  2.0.3-alpha --                2:0:0  (should have incremented; didn't.)
43 #  2.0.4-alpha --                3:0:0
44 #  2.0.5-beta  --                4:0:0
45 #  2.0.6-rc    --     2.0        2:0:0
46 #  2.0.7-rc    --     2.0        3:0:1
47 #  2.0.8-rc    --     2.0        4:0:2
48 #  2.0.9-rc    --     2.0        5:0:0 (ABI changed slightly)
49 #  2.0.10-stable--    2.0        5:1:0 (No ABI change)
50 #  2.0.11-stable--    2.0        6:0:1 (ABI changed, backward-compatible)
51 #  2.0.12-stable--    2.0        6:1:1 (No ABI change)
52 #  2.0.13-stable--    2.0        6:2:1 (No ABI change)
53 #  2.0.14-stable--    2.0        6:3:1 (No ABI change)
54 #  2.0.15-stable--    2.0        6:3:1 (Forgot to update :( )
55 #  2.0.16-stable--    2.0        6:4:1 (No ABI change)
56 #  2.0.17-stable--    2.0        6:5:1 (No ABI change)
57 #  2.0.18-stable--    2.0        6:6:1 (No ABI change)
58 #  2.0.19-stable--    2.0        6:7:1 (No ABI change)
59 #  2.0.20-stable--    2.0        6:8:1 (No ABI change)
60 #  2.0.21-stable--    2.0        6:9:1 (No ABI change)
61 #
62 # For Libevent 2.1:
63 #  2.1.1-alpha --     2.1        1:0:0
64 #  2.1.2-alpha --     2.1        1:0:0 (should have been 2:0:1)
65 #  2.1.3-alpha --     2.1        3:0:0 (ABI changed slightly)
66 #  2.1.4-alpha --     2.1        4:0:0 (ABI changed slightly)
67 #  2.1.5-beta  --     2.1        5:0:0 (ABI changed slightly)
68 #  2.1.6-beta  --     2.1        6:0:0 (ABI changed slightly)
69 #  2.1.7-beta  --     2.1        6:1:0 (ABI changed slightly)
70 #  2.1.8-stable--     2.1        6:2:0 (ABI changed slightly)
71 #
72 # For Libevent 2.2:
73 #  2.2.0-alpha --     2.2        1:0:0
74
75 # ABI version history for this package effectively restarts every time
76 # we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
77 #
78 # Ideally, we would not be using RELEASE at all; instead we could just
79 # use the VERSION_INFO field to label our backward-incompatible ABI
80 # changes, and those would be few and far between.  Unfortunately,
81 # Libevent still exposes far too many volatile structures in its
82 # headers, so we pretty much have to assume that most development
83 # series will break ABI compatibility.  For now, it's simplest just to
84 # keep incrementing the RELEASE between series and resetting VERSION_INFO.
85 #
86 # Eventually, when we get to the point where the structures in the
87 # headers are all non-changing (or not there at all!), we can shift to
88 # a more normal worldview where backward-incompatible ABI changes are
89 # nice and rare.  For the next couple of years, though, 'struct event'
90 # is user-visible, and so we can pretty much guarantee that release
91 # series won't be binary-compatible.
92
93 if INSTALL_LIBEVENT
94 dist_bin_SCRIPTS = event_rpcgen.py
95 endif
96
97 pkgconfigdir=$(libdir)/pkgconfig
98 LIBEVENT_PKGCONFIG=libevent.pc libevent_core.pc libevent_extra.pc
99
100 # These sources are conditionally added by configure.ac or conditionally
101 # included from other files.
102 PLATFORM_DEPENDENT_SRC = \
103         arc4random.c \
104         epoll_sub.c \
105         bufferevent_ssl.c \
106         test/regress_ssl.c
107
108 CMAKE_FILES = \
109         cmake/AddCompilerFlags.cmake \
110         cmake/AddEventLibrary.cmake \
111         cmake/CheckConstExists.cmake \
112         cmake/CheckFileOffsetBits.c \
113         cmake/CheckFileOffsetBits.cmake \
114         cmake/CheckFunctionKeywords.cmake \
115         cmake/CheckPrototypeDefinition.c.in \
116         cmake/CheckPrototypeDefinition.cmake \
117         cmake/CheckWorkingKqueue.cmake \
118         cmake/CodeCoverage.cmake \
119         cmake/COPYING-CMAKE-SCRIPTS \
120         cmake/Copyright.txt \
121         cmake/FindMbedTLS.cmake \
122         cmake/LibeventConfig.cmake.in \
123         cmake/LibeventConfigVersion.cmake.in \
124         cmake/Macros.cmake \
125         cmake/Uninstall.cmake.in \
126         cmake/UseDoxygen.cmake \
127         cmake/VersionViaGit.cmake \
128         event-config.h.cmake \
129         evconfig-private.h.cmake \
130         CMakeLists.txt
131
132 DOCUMENTATION_FILES = \
133         Documentation/Building.md
134
135 EXTRA_DIST = \
136         ChangeLog-1.4 \
137         ChangeLog-2.0 \
138         Doxyfile \
139         LICENSE \
140         autogen.sh \
141         event_rpcgen.py \
142         libevent.pc.in \
143         make-event-config.sed \
144         whatsnew-2.0.txt \
145         whatsnew-2.1.txt \
146         README.md \
147         $(CMAKE_FILES) \
148         $(DOCUMENTATION_FILES) \
149         $(PLATFORM_DEPENDENT_SRC)
150
151 LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la
152 if PTHREADS
153 LIBEVENT_LIBS_LA += libevent_pthreads.la
154 LIBEVENT_PKGCONFIG += libevent_pthreads.pc
155 endif
156 if OPENSSL
157 LIBEVENT_LIBS_LA += libevent_openssl.la
158 LIBEVENT_PKGCONFIG += libevent_openssl.pc
159 endif
160 if MBEDTLS
161 LIBEVENT_LIBS_LA += libevent_mbedtls.la
162 LIBEVENT_PKGCONFIG += libevent_mbedtls.pc
163 endif
164
165 if INSTALL_LIBEVENT
166 lib_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
167 pkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
168 else
169 noinst_LTLIBRARIES =  $(LIBEVENT_LIBS_LA)
170 endif
171
172 EXTRA_SOURCE=
173 noinst_HEADERS=
174 noinst_PROGRAMS=
175 EXTRA_PROGRAMS=
176 CLEANFILES=
177 DISTCLEANFILES=
178 BUILT_SOURCES =
179 include include/include.am
180 include sample/include.am
181 include test/include.am
182
183 if BUILD_WIN32
184
185 SYS_CORE_LIBS = -liphlpapi
186 SYS_LIBS = -lws2_32 -lshell32 -ladvapi32 -lbcrypt
187 SYS_SRC = win32select.c buffer_iocp.c event_iocp.c \
188         bufferevent_async.c
189 SYS_INCLUDES = -IWIN32-Code
190
191 if THREADS
192 SYS_SRC += evthread_win32.c
193 endif
194
195 else
196
197 SYS_CORE_LIBS =
198 SYS_LIBS =
199 SYS_SRC =
200 SYS_INCLUDES =
201
202 endif
203
204 if STRLCPY_IMPL
205 SYS_SRC += strlcpy.c
206 endif
207 if SELECT_BACKEND
208 SYS_SRC += select.c
209 endif
210 if POLL_BACKEND
211 SYS_SRC += poll.c
212 endif
213 if DEVPOLL_BACKEND
214 SYS_SRC += devpoll.c
215 endif
216 if KQUEUE_BACKEND
217 SYS_SRC += kqueue.c
218 endif
219 if EPOLL_BACKEND
220 SYS_SRC += epoll.c
221 endif
222 if EVPORT_BACKEND
223 SYS_SRC += evport.c
224 endif
225 if WEPOLL_BACKEND
226 SYS_SRC += epoll.c
227 SYS_SRC += wepoll.c
228 endif
229 if SIGNAL_SUPPORT
230 SYS_SRC += signal.c
231 endif
232
233 BUILT_SOURCES += include/event2/event-config.h
234
235 include/event2/event-config.h: config.h make-event-config.sed
236         $(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2
237         $(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T
238         $(AM_V_at)mv -f $@T $@
239
240 CORE_SRC =                                      \
241         buffer.c                                \
242         bufferevent.c                           \
243         bufferevent_filter.c                    \
244         bufferevent_pair.c                      \
245         bufferevent_ratelim.c                   \
246         bufferevent_sock.c                      \
247         event.c                                 \
248         evmap.c                                 \
249         evthread.c                              \
250         evutil.c                                \
251         evutil_rand.c                           \
252         evutil_time.c                           \
253         watch.c                                 \
254         listener.c                              \
255         log.c                                   \
256         $(SYS_SRC)
257
258 EXTRAS_SRC =                                    \
259         evdns.c                                 \
260         event_tagging.c                         \
261         evrpc.c                                 \
262         sha1.c                                  \
263         ws.c                                    \
264         http.c
265
266 if BUILD_WITH_NO_UNDEFINED
267 NO_UNDEFINED = -no-undefined
268 MAYBE_CORE = libevent_core.la
269 else
270 NO_UNDEFINED =
271 MAYBE_CORE =
272 endif
273
274 AM_CFLAGS = $(LIBEVENT_CFLAGS)
275 AM_CPPFLAGS = -I$(srcdir)/compat -I./include -I$(srcdir)/include $(SYS_INCLUDES) $(LIBEVENT_CPPFLAGS)
276 AM_LDFLAGS = $(LIBEVENT_LDFLAGS)
277
278 GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED) $(AM_LDFLAGS)
279
280 libevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC)
281 libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) $(SYS_CORE_LIBS)
282 libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
283
284 libevent_core_la_SOURCES = $(CORE_SRC)
285 libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) $(SYS_CORE_LIBS)
286 libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
287
288 if PTHREADS
289 libevent_pthreads_la_SOURCES = evthread_pthread.c
290 libevent_pthreads_la_LIBADD = $(MAYBE_CORE)
291 libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
292 endif
293
294 libevent_extra_la_SOURCES = $(EXTRAS_SRC)
295 libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
296 libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
297
298 if OPENSSL
299 libevent_openssl_la_SOURCES = bufferevent_openssl.c bufferevent_ssl.c
300 libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
301 libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
302 libevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS)
303 endif
304
305 if MBEDTLS
306 libevent_mbedtls_la_SOURCES = bufferevent_mbedtls.c bufferevent_ssl.c
307 libevent_mbedtls_la_LIBADD = $(MAYBE_CORE) $(MBEDTLS_LIBS)
308 libevent_mbedtls_la_LDFLAGS = $(GENERIC_LDFLAGS)
309 libevent_mbedtls_la_CPPFLAGS = $(AM_CPPFLAGS) $(MBEDTLS_INCS)
310 endif
311
312 noinst_HEADERS +=                               \
313         WIN32-Code/getopt.h                     \
314         WIN32-Code/getopt.c                     \
315         WIN32-Code/getopt_long.c        \
316         WIN32-Code/tree.h                       \
317         bufferevent-internal.h          \
318         changelist-internal.h           \
319         compat/sys/queue.h                      \
320         defer-internal.h                        \
321         epolltable-internal.h           \
322         evbuffer-internal.h                     \
323         event-internal.h                        \
324         evmap-internal.h                        \
325         evrpc-internal.h                        \
326         evsignal-internal.h                     \
327         evthread-internal.h                     \
328         ht-internal.h                           \
329         http-internal.h                         \
330         iocp-internal.h                         \
331         ipv6-internal.h                         \
332         kqueue-internal.h                       \
333         log-internal.h                          \
334         minheap-internal.h                      \
335         mm-internal.h                           \
336         ratelim-internal.h                      \
337         ratelim-internal.h                      \
338         strlcpy-internal.h                      \
339         time-internal.h                         \
340         util-internal.h                         \
341         openssl-compat.h                        \
342         mbedtls-compat.h                        \
343         sha1.h                                          \
344         ssl-compat.h                        \
345         wepoll.h
346
347 EVENT1_HDRS = \
348         include/evdns.h \
349         include/event.h \
350         include/evhttp.h \
351         include/evrpc.h \
352         include/evutil.h
353
354 if INSTALL_LIBEVENT
355 include_HEADERS = $(EVENT1_HDRS)
356 else
357 noinst_HEADERS += $(EVENT1_HDRS)
358 endif
359
360 verify: check
361
362 include doxygen.am
363
364 DISTCLEANFILES += *~ libevent.pc libevent_core.pc libevent_extra.pc ./include/event2/event-config.h
365