]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libevent/Makefile.am
libevent: Import libevent 2.1.12
[FreeBSD/FreeBSD.git] / contrib / 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 # 'foreign' means that we're not enforcing GNU package rules strictly.
8 # '1.13' means that we need automake 1.13 or later (and we do).
9 AUTOMAKE_OPTIONS = foreign 1.13 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:1: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 #  2.1.12-stable--    2.1        7:1:0 (No ABI change)
79
80 # ABI version history for this package effectively restarts every time
81 # we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
82 #
83 # Ideally, we would not be using RELEASE at all; instead we could just
84 # use the VERSION_INFO field to label our backward-incompatible ABI
85 # changes, and those would be few and far between.  Unfortunately,
86 # Libevent still exposes far too many volatile structures in its
87 # headers, so we pretty much have to assume that most development
88 # series will break ABI compatibility.  For now, it's simplest just to
89 # keep incrementing the RELEASE between series and resetting VERSION_INFO.
90 #
91 # Eventually, when we get to the point where the structures in the
92 # headers are all non-changing (or not there at all!), we can shift to
93 # a more normal worldview where backward-incompatible ABI changes are
94 # nice and rare.  For the next couple of years, though, 'struct event'
95 # is user-visible, and so we can pretty much guarantee that release
96 # series won't be binary-compatible.
97
98 if INSTALL_LIBEVENT
99 dist_bin_SCRIPTS = event_rpcgen.py
100 endif
101
102 pkgconfigdir=$(libdir)/pkgconfig
103 LIBEVENT_PKGCONFIG=libevent.pc libevent_core.pc libevent_extra.pc
104
105 # These sources are conditionally added by configure.ac or conditionally
106 # included from other files.
107 PLATFORM_DEPENDENT_SRC = \
108         arc4random.c \
109         epoll_sub.c
110
111 CMAKE_FILES = \
112         cmake/AddCompilerFlags.cmake \
113         cmake/AddEventLibrary.cmake \
114         cmake/CheckConstExists.cmake \
115         cmake/CheckFileOffsetBits.c \
116         cmake/CheckFileOffsetBits.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/LibeventConfig.cmake.in \
125         cmake/LibeventConfigVersion.cmake.in \
126         cmake/Macros.cmake \
127         cmake/Uninstall.cmake.in \
128         cmake/UseDoxygen.cmake \
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_CORE_LIBS = -liphlpapi
181 SYS_LIBS = -lws2_32 -lshell32 -ladvapi32
182 SYS_SRC = win32select.c buffer_iocp.c event_iocp.c \
183         bufferevent_async.c
184 SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake
185
186 if THREADS
187 SYS_SRC += evthread_win32.c
188 endif
189
190 else
191
192 SYS_CORE_LIBS =
193 SYS_LIBS =
194 SYS_SRC =
195 SYS_INCLUDES =
196
197 endif
198
199 if STRLCPY_IMPL
200 SYS_SRC += strlcpy.c
201 endif
202 if SELECT_BACKEND
203 SYS_SRC += select.c
204 endif
205 if POLL_BACKEND
206 SYS_SRC += poll.c
207 endif
208 if DEVPOLL_BACKEND
209 SYS_SRC += devpoll.c
210 endif
211 if KQUEUE_BACKEND
212 SYS_SRC += kqueue.c
213 endif
214 if EPOLL_BACKEND
215 SYS_SRC += epoll.c
216 endif
217 if EVPORT_BACKEND
218 SYS_SRC += evport.c
219 endif
220 if SIGNAL_SUPPORT
221 SYS_SRC += signal.c
222 endif
223
224 BUILT_SOURCES += include/event2/event-config.h
225
226 include/event2/event-config.h: config.h make-event-config.sed
227         $(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2
228         $(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T
229         $(AM_V_at)mv -f $@T $@
230
231 CORE_SRC =                                      \
232         buffer.c                                \
233         bufferevent.c                           \
234         bufferevent_filter.c                    \
235         bufferevent_pair.c                      \
236         bufferevent_ratelim.c                   \
237         bufferevent_sock.c                      \
238         event.c                                 \
239         evmap.c                                 \
240         evthread.c                              \
241         evutil.c                                \
242         evutil_rand.c                           \
243         evutil_time.c                           \
244         listener.c                              \
245         log.c                                   \
246         $(SYS_SRC)
247
248 EXTRAS_SRC =                                    \
249         evdns.c                                 \
250         event_tagging.c                         \
251         evrpc.c                                 \
252         http.c
253
254 if BUILD_WITH_NO_UNDEFINED
255 NO_UNDEFINED = -no-undefined
256 MAYBE_CORE = libevent_core.la
257 else
258 NO_UNDEFINED =
259 MAYBE_CORE =
260 endif
261
262 AM_CFLAGS = $(LIBEVENT_CFLAGS)
263 AM_CPPFLAGS = -I$(srcdir)/compat -I./include -I$(srcdir)/include $(SYS_INCLUDES) $(LIBEVENT_CPPFLAGS)
264 AM_LDFLAGS = $(LIBEVENT_LDFLAGS)
265
266 GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED) $(AM_LDFLAGS)
267
268 libevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC)
269 libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) $(SYS_CORE_LIBS)
270 libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
271
272 libevent_core_la_SOURCES = $(CORE_SRC)
273 libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) $(SYS_CORE_LIBS)
274 libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
275
276 if PTHREADS
277 libevent_pthreads_la_SOURCES = evthread_pthread.c
278 libevent_pthreads_la_LIBADD = $(MAYBE_CORE)
279 libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
280 endif
281
282 libevent_extra_la_SOURCES = $(EXTRAS_SRC)
283 libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
284 libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
285
286 if OPENSSL
287 libevent_openssl_la_SOURCES = bufferevent_openssl.c
288 libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
289 libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
290 libevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS)
291 endif
292
293 noinst_HEADERS +=                               \
294         WIN32-Code/nmake/evconfig-private.h     \
295         WIN32-Code/nmake/event2/event-config.h  \
296         WIN32-Code/getopt.h                     \
297         WIN32-Code/getopt.c                     \
298         WIN32-Code/getopt_long.c        \
299         WIN32-Code/tree.h                       \
300         bufferevent-internal.h          \
301         changelist-internal.h           \
302         compat/sys/queue.h                      \
303         defer-internal.h                        \
304         epolltable-internal.h           \
305         evbuffer-internal.h                     \
306         event-internal.h                        \
307         evmap-internal.h                        \
308         evrpc-internal.h                        \
309         evsignal-internal.h                     \
310         evthread-internal.h                     \
311         ht-internal.h                           \
312         http-internal.h                         \
313         iocp-internal.h                         \
314         ipv6-internal.h                         \
315         kqueue-internal.h                       \
316         log-internal.h                          \
317         minheap-internal.h                      \
318         mm-internal.h                           \
319         ratelim-internal.h                      \
320         ratelim-internal.h                      \
321         strlcpy-internal.h                      \
322         time-internal.h                         \
323         util-internal.h                         \
324         openssl-compat.h
325
326 EVENT1_HDRS = \
327         include/evdns.h \
328         include/event.h \
329         include/evhttp.h \
330         include/evrpc.h \
331         include/evutil.h
332
333 if INSTALL_LIBEVENT
334 include_HEADERS = $(EVENT1_HDRS)
335 else
336 noinst_HEADERS += $(EVENT1_HDRS)
337 endif
338
339 verify: check
340
341 include doxygen.am
342
343 DISTCLEANFILES += *~ libevent.pc libevent_core.pc libevent_extra.pc ./include/event2/event-config.h
344