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