Imported Upstream version 2.1.10
[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.9' means that we need automake 1.9 or later (and we do).
9 AUTOMAKE_OPTIONS = foreign 1.9 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 = 6:4: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)
77
78 # ABI version history for this package effectively restarts every time
79 # we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
80 #
81 # Ideally, we would not be using RELEASE at all; instead we could just
82 # use the VERSION_INFO field to label our backward-incompatible ABI
83 # changes, and those would be few and far between.  Unfortunately,
84 # Libevent still exposes far too many volatile structures in its
85 # headers, so we pretty much have to assume that most development
86 # series will break ABI compatibility.  For now, it's simplest just to
87 # keep incrementing the RELEASE between series and resetting VERSION_INFO.
88 #
89 # Eventually, when we get to the point where the structures in the
90 # headers are all non-changing (or not there at all!), we can shift to
91 # a more normal worldview where backward-incompatible ABI changes are
92 # nice and rare.  For the next couple of years, though, 'struct event'
93 # is user-visible, and so we can pretty much guarantee that release
94 # series won't be binary-compatible.
95
96 if INSTALL_LIBEVENT
97 dist_bin_SCRIPTS = event_rpcgen.py
98 endif
99
100 pkgconfigdir=$(libdir)/pkgconfig
101 LIBEVENT_PKGCONFIG=libevent.pc libevent_core.pc libevent_extra.pc
102
103 # These sources are conditionally added by configure.ac or conditionally
104 # included from other files.
105 PLATFORM_DEPENDENT_SRC = \
106         arc4random.c \
107         epoll_sub.c
108
109 CMAKE_FILES = \
110         cmake/AddCompilerFlags.cmake \
111         cmake/AddEventLibrary.cmake \
112         cmake/CheckConstExists.cmake \
113         cmake/CheckFileOffsetBits.c \
114         cmake/CheckFileOffsetBits.cmake \
115         cmake/CheckFunctionExistsEx.c \
116         cmake/CheckFunctionExistsEx.cmake \
117         cmake/CheckFunctionKeywords.cmake \
118         cmake/CheckPrototypeDefinition.c.in \
119         cmake/CheckPrototypeDefinition.cmake \
120         cmake/CheckWorkingKqueue.cmake \
121         cmake/CodeCoverage.cmake \
122         cmake/COPYING-CMAKE-SCRIPTS \
123         cmake/Copyright.txt \
124         cmake/FindGit.cmake \
125         cmake/LibeventConfigBuildTree.cmake.in \
126         cmake/LibeventConfig.cmake.in \
127         cmake/LibeventConfigVersion.cmake.in \
128         cmake/VersionViaGit.cmake \
129         event-config.h.cmake \
130         evconfig-private.h.cmake \
131         CMakeLists.txt
132
133 EXTRA_DIST = \
134         ChangeLog-1.4 \
135         ChangeLog-2.0 \
136         Doxyfile \
137         LICENSE \
138         Makefile.nmake test/Makefile.nmake \
139         autogen.sh \
140         event_rpcgen.py \
141         libevent.pc.in \
142         make-event-config.sed \
143         whatsnew-2.0.txt \
144         whatsnew-2.1.txt \
145         $(CMAKE_FILES) \
146         $(PLATFORM_DEPENDENT_SRC)
147
148 LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la
149 if PTHREADS
150 LIBEVENT_LIBS_LA += libevent_pthreads.la
151 LIBEVENT_PKGCONFIG += libevent_pthreads.pc
152 endif
153 if OPENSSL
154 LIBEVENT_LIBS_LA += libevent_openssl.la
155 LIBEVENT_PKGCONFIG += libevent_openssl.pc
156 endif
157
158 if INSTALL_LIBEVENT
159 lib_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
160 pkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
161 else
162 noinst_LTLIBRARIES =  $(LIBEVENT_LIBS_LA)
163 endif
164
165 EXTRA_SOURCE=
166 noinst_HEADERS=
167 noinst_PROGRAMS=
168 EXTRA_PROGRAMS=
169 CLEANFILES=
170 DISTCLEANFILES=
171 BUILT_SOURCES =
172 include include/include.am
173 include sample/include.am
174 include test/include.am
175
176 if BUILD_WIN32
177
178 SYS_LIBS = -lws2_32 -lshell32 -ladvapi32
179 SYS_SRC = win32select.c buffer_iocp.c event_iocp.c \
180         bufferevent_async.c
181 SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake
182
183 if THREADS
184 SYS_SRC += evthread_win32.c
185 endif
186
187 else
188
189 SYS_LIBS =
190 SYS_SRC =
191 SYS_INCLUDES =
192
193 endif
194
195 if STRLCPY_IMPL
196 SYS_SRC += strlcpy.c
197 endif
198 if SELECT_BACKEND
199 SYS_SRC += select.c
200 endif
201 if POLL_BACKEND
202 SYS_SRC += poll.c
203 endif
204 if DEVPOLL_BACKEND
205 SYS_SRC += devpoll.c
206 endif
207 if KQUEUE_BACKEND
208 SYS_SRC += kqueue.c
209 endif
210 if EPOLL_BACKEND
211 SYS_SRC += epoll.c
212 endif
213 if EVPORT_BACKEND
214 SYS_SRC += evport.c
215 endif
216 if SIGNAL_SUPPORT
217 SYS_SRC += signal.c
218 endif
219
220 BUILT_SOURCES += include/event2/event-config.h
221
222 include/event2/event-config.h: config.h make-event-config.sed
223         $(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2
224         $(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T
225         $(AM_V_at)mv -f $@T $@
226
227 CORE_SRC =                                      \
228         buffer.c                                \
229         bufferevent.c                           \
230         bufferevent_filter.c                    \
231         bufferevent_pair.c                      \
232         bufferevent_ratelim.c                   \
233         bufferevent_sock.c                      \
234         event.c                                 \
235         evmap.c                                 \
236         evthread.c                              \
237         evutil.c                                \
238         evutil_rand.c                           \
239         evutil_time.c                           \
240         listener.c                              \
241         log.c                                   \
242         $(SYS_SRC)
243
244 EXTRAS_SRC =                                    \
245         evdns.c                                 \
246         event_tagging.c                         \
247         evrpc.c                                 \
248         http.c
249
250 if BUILD_WITH_NO_UNDEFINED
251 NO_UNDEFINED = -no-undefined
252 MAYBE_CORE = libevent_core.la
253 else
254 NO_UNDEFINED =
255 MAYBE_CORE =
256 endif
257
258 AM_CFLAGS = $(LIBEVENT_CFLAGS)
259 AM_CPPFLAGS = -I$(srcdir)/compat -I./include -I$(srcdir)/include $(SYS_INCLUDES) $(LIBEVENT_CPPFLAGS)
260 AM_LDFLAGS = $(LIBEVENT_LDFLAGS)
261
262 GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED) $(AM_LDFLAGS)
263
264 libevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC)
265 libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
266 libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
267
268 libevent_core_la_SOURCES = $(CORE_SRC)
269 libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
270 libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
271
272 if PTHREADS
273 libevent_pthreads_la_SOURCES = evthread_pthread.c
274 libevent_pthreads_la_LIBADD = $(MAYBE_CORE)
275 libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
276 endif
277
278 libevent_extra_la_SOURCES = $(EXTRAS_SRC)
279 libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
280 libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
281
282 if OPENSSL
283 libevent_openssl_la_SOURCES = bufferevent_openssl.c
284 libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
285 libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
286 libevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS)
287 endif
288
289 noinst_HEADERS +=                               \
290         WIN32-Code/nmake/evconfig-private.h     \
291         WIN32-Code/nmake/event2/event-config.h  \
292         WIN32-Code/getopt.h                     \
293         WIN32-Code/getopt.c                     \
294         WIN32-Code/getopt_long.c        \
295         WIN32-Code/tree.h                       \
296         bufferevent-internal.h          \
297         changelist-internal.h           \
298         compat/sys/queue.h                      \
299         defer-internal.h                        \
300         epolltable-internal.h           \
301         evbuffer-internal.h                     \
302         event-internal.h                        \
303         evmap-internal.h                        \
304         evrpc-internal.h                        \
305         evsignal-internal.h                     \
306         evthread-internal.h                     \
307         ht-internal.h                           \
308         http-internal.h                         \
309         iocp-internal.h                         \
310         ipv6-internal.h                         \
311         kqueue-internal.h                       \
312         log-internal.h                          \
313         minheap-internal.h                      \
314         mm-internal.h                           \
315         ratelim-internal.h                      \
316         ratelim-internal.h                      \
317         strlcpy-internal.h                      \
318         time-internal.h                         \
319         util-internal.h                         \
320         openssl-compat.h
321
322 EVENT1_HDRS = \
323         include/evdns.h \
324         include/event.h \
325         include/evhttp.h \
326         include/evrpc.h \
327         include/evutil.h
328
329 if INSTALL_LIBEVENT
330 include_HEADERS = $(EVENT1_HDRS)
331 else
332 noinst_HEADERS += $(EVENT1_HDRS)
333 endif
334
335 verify: check
336
337 doxygen: FORCE
338         doxygen $(srcdir)/Doxyfile
339 FORCE:
340
341 DISTCLEANFILES += *~ libevent.pc libevent_core.pc libevent_extra.pc ./include/event2/event-config.h
342