]> arthur.barton.de Git - netatalk.git/blob - libevent/Makefile.am
Merge pull request #17 from hat001/staticlibevent
[netatalk.git] / 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.7' means that we need automake 1.7 or later (and we do).
9 AUTOMAKE_OPTIONS = foreign 1.7
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.0
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:6:1
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 #
63 # For Libevent 2.1:
64 #  2.1.1-alpha --     2.1        1:0:0
65
66
67 # ABI version history for this package effectively restarts every time
68 # we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
69 #
70 # Ideally, we would not be using RELEASE at all; instead we could just
71 # use the VERSION_INFO field to label our backward-incompatible ABI
72 # changes, and those would be few and far between.  Unfortunately,
73 # Libevent still exposes far too many volatile structures in its
74 # headers, so we pretty much have to assume that most development
75 # series will break ABI compatibility.  For now, it's simplest just to
76 # keep incrementing the RELEASE between series and resetting VERSION_INFO.
77 #
78 # Eventually, when we get to the point where the structures in the
79 # headers are all non-changing (or not there at all!), we can shift to
80 # a more normal worldview where backward-incompatible ABI changes are
81 # nice and rare.  For the next couple of years, though, 'struct event'
82 # is user-visible, and so we can pretty much guarantee that release
83 # series won't be binary-compatible.
84
85 if INSTALL_LIBEVENT
86 dist_bin_SCRIPTS = event_rpcgen.py
87 endif
88
89 pkgconfigdir=$(libdir)/pkgconfig
90 LIBEVENT_PKGCONFIG=libevent.pc
91
92 # These sources are conditionally added by configure.in or conditionally
93 # included from other files.
94 PLATFORM_DEPENDENT_SRC = \
95         epoll_sub.c \
96         arc4random.c
97
98 EXTRA_DIST = \
99         LICENSE \
100         autogen.sh \
101         event_rpcgen.py \
102         libevent.pc.in \
103         Doxyfile \
104         whatsnew-2.0.txt \
105         Makefile.nmake test/Makefile.nmake \
106         $(PLATFORM_DEPENDENT_SRC)
107
108 LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la
109 if PTHREADS
110 LIBEVENT_LIBS_LA += libevent_pthreads.la
111 LIBEVENT_PKGCONFIG += libevent_pthreads.pc
112 endif
113 if OPENSSL
114 LIBEVENT_LIBS_LA += libevent_openssl.la
115 LIBEVENT_PKGCONFIG += libevent_openssl.pc
116 endif
117
118 if INSTALL_LIBEVENT
119 lib_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
120 pkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
121 else
122 noinst_LTLIBRARIES =  $(LIBEVENT_LIBS_LA)
123 endif
124
125 SUBDIRS = . include sample test
126
127 if BUILD_WIN32
128
129 SYS_LIBS = -lws2_32 -lshell32 -ladvapi32
130 SYS_SRC = win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \
131         bufferevent_async.c
132 SYS_INCLUDES = -IWIN32-Code
133
134 else
135
136 SYS_LIBS =
137 SYS_SRC =
138 SYS_INCLUDES =
139
140 endif
141
142 if SELECT_BACKEND
143 SYS_SRC += select.c
144 endif
145 if POLL_BACKEND
146 SYS_SRC += poll.c
147 endif
148 if DEVPOLL_BACKEND
149 SYS_SRC += devpoll.c
150 endif
151 if KQUEUE_BACKEND
152 SYS_SRC += kqueue.c
153 endif
154 if EPOLL_BACKEND
155 SYS_SRC += epoll.c
156 endif
157 if EVPORT_BACKEND
158 SYS_SRC += evport.c
159 endif
160 if SIGNAL_SUPPORT
161 SYS_SRC += signal.c
162 endif
163
164 BUILT_SOURCES = ./include/event2/event-config.h
165
166 ./include/event2/event-config.h: config.h
167         @MKDIR_P@ ./include/event2
168         echo '/* event2/event-config.h' > $@
169         echo ' *' >> $@
170         echo ' * This file was generated by autoconf when libevent was built, and post-' >> $@
171         echo ' * processed by Libevent so that its macros would have a uniform prefix.' >> $@
172         echo ' *' >> $@
173         echo ' * DO NOT EDIT THIS FILE.' >> $@
174         echo ' *' >> $@
175         echo ' * Do not rely on macros in this file existing in later versions.'>> $@
176         echo ' */' >> $@
177         echo '#ifndef _EVENT2_EVENT_CONFIG_H_' >> $@
178         echo '#define _EVENT2_EVENT_CONFIG_H_' >> $@
179
180         sed -e 's/#define /#define _EVENT_/' \
181             -e 's/#undef /#undef _EVENT_/' \
182             -e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@
183         echo "#endif" >> $@
184
185 CORE_SRC = event.c evthread.c buffer.c \
186         bufferevent.c bufferevent_sock.c bufferevent_filter.c \
187         bufferevent_pair.c listener.c bufferevent_ratelim.c \
188         evmap.c log.c evutil.c evutil_rand.c strlcpy.c $(SYS_SRC)
189 EXTRA_SRC = event_tagging.c http.c evdns.c evrpc.c
190
191 if BUILD_WITH_NO_UNDEFINED
192 NO_UNDEFINED = -no-undefined
193 MAYBE_CORE = libevent_core.la
194 else
195 NO_UNDEFINED =
196 MAYBE_CORE =
197 endif
198
199 GENERIC_LDFLAGS = -static
200
201 libevent_la_SOURCES = $(CORE_SRC) $(EXTRA_SRC)
202 libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
203 libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
204
205 libevent_core_la_SOURCES = $(CORE_SRC)
206 libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
207 libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
208
209 if PTHREADS
210 libevent_pthreads_la_SOURCES = evthread_pthread.c
211 libevent_pthreads_la_LIBADD = $(MAYBE_CORE)
212 libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
213 endif
214
215 libevent_extra_la_SOURCES = $(EXTRA_SRC)
216 libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
217 libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
218
219 if OPENSSL
220 libevent_openssl_la_SOURCES = bufferevent_openssl.c
221 libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
222 libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
223 endif
224
225 noinst_HEADERS = util-internal.h mm-internal.h ipv6-internal.h \
226         evrpc-internal.h strlcpy-internal.h evbuffer-internal.h \
227         bufferevent-internal.h http-internal.h event-internal.h \
228         evthread-internal.h ht-internal.h defer-internal.h \
229         minheap-internal.h log-internal.h evsignal-internal.h evmap-internal.h \
230         changelist-internal.h iocp-internal.h \
231         ratelim-internal.h \
232         WIN32-Code/event2/event-config.h \
233         WIN32-Code/tree.h \
234         compat/sys/queue.h
235
236 EVENT1_HDRS = event.h evhttp.h evdns.h evrpc.h evutil.h
237
238 if INSTALL_LIBEVENT
239 include_HEADERS = $(EVENT1_HDRS)
240 else
241 noinst_HEADERS += $(EVENT1_HDRS)
242 endif
243
244 AM_CPPFLAGS = -I$(srcdir)/compat -I$(srcdir)/include -I./include $(SYS_INCLUDES)
245
246 verify: check
247
248 doxygen: FORCE
249         doxygen $(srcdir)/Doxyfile
250 FORCE:
251
252 DISTCLEANFILES = *~ libevent.pc ./include/event2/event-config.h
253
254 install:
255