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