]> arthur.barton.de Git - netatalk.git/blob - libevent/Makefile.am
Add libevent
[netatalk.git] / libevent / Makefile.am
1 # 'foreign' means that we're not enforcing GNU package rules strictly.
2 # '1.7' means that we need automake 1.7 or later (and we do).
3 AUTOMAKE_OPTIONS = foreign 1.7
4
5 ACLOCAL_AMFLAGS = -I m4
6
7 # This is the "Release" of the Libevent ABI.  It takes precedence over
8 # the VERSION_INFO, so that two versions of Libevent with the same
9 # "Release" are never binary-compatible.
10 #
11 # This number incremented once for the 2.0 release candidate, and
12 # will increment for each series until we revise our interfaces enough
13 # that we can seriously expect ABI compatibility between series.
14 #
15 RELEASE = -release 2.0
16
17 # This is the version info for the libevent binary API.  It has three
18 # numbers:
19 #   Current  -- the number of the binary API that we're implementing
20 #   Revision -- which iteration of the implementation of the binary
21 #               API are we supplying?
22 #   Age      -- How many previous binary API versions do we also
23 #               support?
24 #
25 # To increment a VERSION_INFO (current:revision:age):
26 #    If the ABI didn't change:
27 #        Return (current:revision+1:age)
28 #    If the ABI changed, but it's backward-compatible:
29 #        Return (current+1:0:age+1)
30 #    If the ABI changed and it isn't backward-compatible:
31 #        Return (current+1:0:0)
32 #
33 # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
34 # UNLESS YOU REALLY REALLY HAVE TO.
35 VERSION_INFO = 5:1:0
36
37 # History:          RELEASE    VERSION_INFO
38 #  2.0.1-alpha --     2.0        1:0:0
39 #  2.0.2-alpha --                2:0:0
40 #  2.0.3-alpha --                2:0:0  (should have incremented; didn't.)
41 #  2.0.4-alpha --                3:0:0
42 #  2.0.5-beta  --                4:0:0
43 #  2.0.6-rc    --     2.0        2:0:0
44 #  2.0.7-rc    --     2.0        3:0:1
45 #  2.0.8-rc    --     2.0        4:0:2
46 #  2.0.9-rc    --     2.0        5:0:0 (ABI changed slightly)
47 # Planned:
48 #  2.0.10-stable--    2.0        5:1:0 (No ABI change)
49 #
50 # For Libevent 2.1:
51 #  2.1.1-alpha --     2.1        1:0:0
52
53
54 # ABI version history for this package effectively restarts every time
55 # we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
56 #
57 # Ideally, we would not be using RELEASE at all; instead we could just
58 # use the VERSION_INFO field to label our backward-incompatible ABI
59 # changes, and those would be few and far between.  Unfortunately,
60 # Libevent still exposes far too many volatile structures in its
61 # headers, so we pretty much have to assume that most development
62 # series will break ABI compatibility.  For now, it's simplest just to
63 # keep incrementing the RELEASE between series and resetting VERSION_INFO.
64 #
65 # Eventually, when we get to the point where the structures in the
66 # headers are all non-changing (or not there at all!), we can shift to
67 # a more normal worldview where backward-incompatible ABI changes are
68 # nice and rare.  For the next couple of years, though, 'struct event'
69 # is user-visible, and so we can pretty much guarantee that release
70 # series won't be binary-compatible.
71
72 dist_bin_SCRIPTS = event_rpcgen.py
73
74 pkgconfigdir=$(libdir)/pkgconfig
75 pkgconfig_DATA=libevent.pc
76
77 # These sources are conditionally added by configure.in or conditionally
78 # included from other files.
79 PLATFORM_DEPENDENT_SRC = \
80         epoll_sub.c \
81         arc4random.c
82
83 EXTRA_DIST = \
84         LICENSE \
85         autogen.sh \
86         libevent.pc.in \
87         Doxyfile \
88         whatsnew-2.0.txt \
89         Makefile.nmake test/Makefile.nmake \
90         $(PLATFORM_DEPENDENT_SRC)
91
92 lib_LTLIBRARIES = libevent.la libevent_core.la libevent_extra.la
93 if PTHREADS
94 lib_LTLIBRARIES += libevent_pthreads.la
95 pkgconfig_DATA += libevent_pthreads.pc
96 endif
97 if OPENSSL
98 lib_LTLIBRARIES += libevent_openssl.la
99 pkgconfig_DATA += libevent_openssl.pc
100 endif
101
102 SUBDIRS = . include sample test
103
104 if BUILD_WIN32
105
106 SYS_LIBS = -lws2_32
107 SYS_SRC = win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \
108         bufferevent_async.c
109 SYS_INCLUDES = -IWIN32-Code
110
111 else
112
113 SYS_LIBS =
114 SYS_SRC =
115 SYS_INCLUDES =
116
117 endif
118
119 if SELECT_BACKEND
120 SYS_SRC += select.c
121 endif
122 if POLL_BACKEND
123 SYS_SRC += poll.c
124 endif
125 if DEVPOLL_BACKEND
126 SYS_SRC += devpoll.c
127 endif
128 if KQUEUE_BACKEND
129 SYS_SRC += kqueue.c
130 endif
131 if EPOLL_BACKEND
132 SYS_SRC += epoll.c
133 endif
134 if EVPORT_BACKEND
135 SYS_SRC += evport.c
136 endif
137 if SIGNAL_SUPPORT
138 SYS_SRC += signal.c
139 endif
140
141 BUILT_SOURCES = ./include/event2/event-config.h
142
143 ./include/event2/event-config.h: config.h
144         @MKDIR_P@ ./include/event2
145         echo '/* event2/event-config.h' > $@
146         echo ' *' >> $@
147         echo ' * This file was generated by autoconf when libevent was built, and post-' >> $@
148         echo ' * processed by Libevent so that its macros would have a uniform prefix.' >> $@
149         echo ' *' >> $@
150         echo ' * DO NOT EDIT THIS FILE.' >> $@
151         echo ' *' >> $@
152         echo ' * Do not rely on macros in this file existing in later versions.'>> $@
153         echo ' */' >> $@
154         echo '#ifndef _EVENT2_EVENT_CONFIG_H_' >> $@
155         echo '#define _EVENT2_EVENT_CONFIG_H_' >> $@
156
157         sed -e 's/#define /#define _EVENT_/' \
158             -e 's/#undef /#undef _EVENT_/' \
159             -e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@
160         echo "#endif" >> $@
161
162 CORE_SRC = event.c evthread.c buffer.c \
163         bufferevent.c bufferevent_sock.c bufferevent_filter.c \
164         bufferevent_pair.c listener.c bufferevent_ratelim.c \
165         evmap.c log.c evutil.c evutil_rand.c strlcpy.c $(SYS_SRC)
166 EXTRA_SRC = event_tagging.c http.c evdns.c evrpc.c
167
168 if BUILD_WIN32
169 NO_UNDEFINED = -no-undefined
170 MAYBE_CORE = libevent_core.la
171 else
172 NO_UNDEFINED =
173 MAYBE_CORE =
174 endif
175
176 GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED)
177
178 libevent_la_SOURCES = $(CORE_SRC) $(EXTRA_SRC)
179 libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
180 libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
181
182 libevent_core_la_SOURCES = $(CORE_SRC)
183 libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
184 libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
185
186 if PTHREADS
187 libevent_pthreads_la_SOURCES = evthread_pthread.c
188 libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
189 endif
190
191 libevent_extra_la_SOURCES = $(EXTRA_SRC)
192 libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
193 libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
194
195 if OPENSSL
196 libevent_openssl_la_SOURCES = bufferevent_openssl.c
197 libevent_openssl_la_LIBADD = $(MAYBE_CORE) -lcrypto -lssl
198 libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
199 endif
200
201 noinst_HEADERS = util-internal.h mm-internal.h ipv6-internal.h \
202         evrpc-internal.h strlcpy-internal.h evbuffer-internal.h \
203         bufferevent-internal.h http-internal.h event-internal.h \
204         evthread-internal.h ht-internal.h defer-internal.h \
205         minheap-internal.h log-internal.h evsignal-internal.h evmap-internal.h \
206         changelist-internal.h iocp-internal.h \
207         ratelim-internal.h \
208         WIN32-Code/event2/event-config.h \
209         WIN32-Code/tree.h \
210         compat/sys/queue.h
211
212 include_HEADERS = event.h evhttp.h evdns.h evrpc.h evutil.h
213
214 INCLUDES = -I$(srcdir)/compat -I$(srcdir)/include -I./include $(SYS_INCLUDES)
215
216 verify: check
217
218 doxygen: FORCE
219         doxygen $(srcdir)/Doxyfile
220 FORCE:
221
222 DISTCLEANFILES = *~ libevent.pc ./include/event2/event-config.h
223