Makefile.am revision 285612
152419Sjulian# Makefile.am for libevent
252419Sjulian# Copyright 2000-2007 Niels Provos
379727Sschweikh# Copyright 2007-2012 Niels Provos and Nick Mathewson
452419Sjulian#
552419Sjulian# See LICENSE for copying information.
652419Sjulian
752419Sjulian# 'foreign' means that we're not enforcing GNU package rules strictly.
852419Sjulian# '1.9' means that we need automake 1.9 or later (and we do).
952419SjulianAUTOMAKE_OPTIONS = foreign 1.9 subdir-objects
1052419Sjulian
1152419SjulianACLOCAL_AMFLAGS = -I m4
1252419Sjulian
1352419Sjulian# This is the "Release" of the Libevent ABI.  It takes precedence over
1479727Sschweikh# the VERSION_INFO, so that two versions of Libevent with the same
1552419Sjulian# "Release" are never binary-compatible.
1652419Sjulian#
1752419Sjulian# This number incremented once for the 2.0 release candidate, and
1852419Sjulian# will increment for each series until we revise our interfaces enough
1952419Sjulian# that we can seriously expect ABI compatibility between series.
2052419Sjulian#
2152419SjulianRELEASE = -release 2.1
2252419Sjulian
2352419Sjulian# This is the version info for the libevent binary API.  It has three
2452419Sjulian# numbers:
2552419Sjulian#   Current  -- the number of the binary API that we're implementing
2652419Sjulian#   Revision -- which iteration of the implementation of the binary
2752419Sjulian#               API are we supplying?
2852419Sjulian#   Age      -- How many previous binary API versions do we also
2952419Sjulian#               support?
3052419Sjulian#
3152419Sjulian# To increment a VERSION_INFO (current:revision:age):
3279727Sschweikh#    If the ABI didn't change:
3367627Sasmodai#        Return (current:revision+1:age)
3452419Sjulian#    If the ABI changed, but it's backward-compatible:
3552419Sjulian#        Return (current+1:0:age+1)
3652419Sjulian#    If the ABI changed and it isn't backward-compatible:
3752419Sjulian#        Return (current+1:0:0)
38129441Sru#
3959982Sarchie# Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
4079538Sru# UNLESS YOU REALLY REALLY HAVE TO.
4152419SjulianVERSION_INFO = 5:0:0
4252419Sjulian
4352419Sjulian# History:          RELEASE    VERSION_INFO
4452419Sjulian#  2.0.1-alpha --     2.0        1:0:0
45141350Sru#  2.0.2-alpha --                2:0:0
4684306Sru#  2.0.3-alpha --                2:0:0  (should have incremented; didn't.)
4752419Sjulian#  2.0.4-alpha --                3:0:0
4852419Sjulian#  2.0.5-beta  --                4:0:0
4952419Sjulian#  2.0.6-rc    --     2.0        2:0:0
5052419Sjulian#  2.0.7-rc    --     2.0        3:0:1
5152419Sjulian#  2.0.8-rc    --     2.0        4:0:2
5252419Sjulian#  2.0.9-rc    --     2.0        5:0:0 (ABI changed slightly)
5354927Sjulian#  2.0.10-stable--    2.0        5:1:0 (No ABI change)
5454927Sjulian#  2.0.11-stable--    2.0        6:0:1 (ABI changed, backward-compatible)
5554927Sjulian#  2.0.12-stable--    2.0        6:1:1 (No ABI change)
5652419Sjulian#  2.0.13-stable--    2.0        6:2:1 (No ABI change)
5752419Sjulian#  2.0.14-stable--    2.0        6:3:1 (No ABI change)
58129441Sru#  2.0.15-stable--    2.0        6:3:1 (Forgot to update :( )
59129441Sru#  2.0.16-stable--    2.0        6:4:1 (No ABI change)
60242997Sjoel#  2.0.17-stable--    2.0        6:5:1 (No ABI change)
61242997Sjoel#  2.0.18-stable--    2.0        6:6:1 (No ABI change)
62129441Sru#  2.0.19-stable--    2.0        6:7:1 (No ABI change)
63129441Sru#  2.0.20-stable--    2.0        6:8:1 (No ABI change)
64129441Sru#  2.0.21-stable--    2.0        6:9:1 (No ABI change)
65129441Sru#
66129441Sru# For Libevent 2.1:
67242997Sjoel#  2.1.1-alpha --     2.1        1:0:0
68129441Sru#  2.1.2-alpha --     2.1        1:0:0 (should have been 2:0:1)
69129441Sru#  2.1.3-alpha --     2.1        3:0:0 (ABI changed slightly)
70129441Sru#  2.1.4-alpha --     2.1        4:0:0 (ABI changed slightly)
71129441Sru#  2.1.5-beta  --     2.1        5:0:0 (ABI changed slightly)
72242997Sjoel
73129441Sru# ABI version history for this package effectively restarts every time
74191682Smaxim# we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
75129441Sru#
76129441Sru# Ideally, we would not be using RELEASE at all; instead we could just
7752419Sjulian# use the VERSION_INFO field to label our backward-incompatible ABI
7852419Sjulian# changes, and those would be few and far between.  Unfortunately,
7952419Sjulian# Libevent still exposes far too many volatile structures in its
8052419Sjulian# headers, so we pretty much have to assume that most development
8152419Sjulian# series will break ABI compatibility.  For now, it's simplest just to
8252419Sjulian# keep incrementing the RELEASE between series and resetting VERSION_INFO.
8359982Sarchie#
8459982Sarchie# Eventually, when we get to the point where the structures in the
8554927Sjulian# headers are all non-changing (or not there at all!), we can shift to
8654927Sjulian# a more normal worldview where backward-incompatible ABI changes are
8754927Sjulian# nice and rare.  For the next couple of years, though, 'struct event'
8854927Sjulian# is user-visible, and so we can pretty much guarantee that release
8954927Sjulian# series won't be binary-compatible.
9054927Sjulian
9167627Sasmodaiif INSTALL_LIBEVENT
92dist_bin_SCRIPTS = event_rpcgen.py
93endif
94
95pkgconfigdir=$(libdir)/pkgconfig
96LIBEVENT_PKGCONFIG=libevent.pc
97
98# These sources are conditionally added by configure.ac or conditionally
99# included from other files.
100PLATFORM_DEPENDENT_SRC = \
101	arc4random.c \
102	epoll_sub.c
103
104EXTRA_DIST = \
105	ChangeLog-1.4 \
106	ChangeLog-2.0 \
107	Doxyfile \
108	LICENSE \
109	Makefile.nmake test/Makefile.nmake \
110	autogen.sh \
111	event_rpcgen.py \
112	libevent.pc.in \
113	make-event-config.sed \
114	whatsnew-2.0.txt \
115	whatsnew-2.1.txt \
116	$(PLATFORM_DEPENDENT_SRC)
117
118LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la
119if PTHREADS
120LIBEVENT_LIBS_LA += libevent_pthreads.la
121LIBEVENT_PKGCONFIG += libevent_pthreads.pc
122endif
123if OPENSSL
124LIBEVENT_LIBS_LA += libevent_openssl.la
125LIBEVENT_PKGCONFIG += libevent_openssl.pc
126endif
127
128if INSTALL_LIBEVENT
129lib_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
130pkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
131else
132noinst_LTLIBRARIES =  $(LIBEVENT_LIBS_LA)
133endif
134
135EXTRA_SOURCE=
136noinst_HEADERS=
137noinst_PROGRAMS=
138EXTRA_PROGRAMS=
139CLEANFILES=
140DISTCLEANFILES=
141BUILT_SOURCES =
142include include/include.am
143include sample/include.am
144include test/include.am
145
146if BUILD_WIN32
147
148SYS_LIBS = -lws2_32 -lshell32 -ladvapi32
149SYS_SRC = win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \
150	bufferevent_async.c
151SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake
152
153else
154
155SYS_LIBS =
156SYS_SRC =
157SYS_INCLUDES =
158
159endif
160
161if STRLCPY_IMPL
162SYS_SRC += strlcpy.c
163endif
164if SELECT_BACKEND
165SYS_SRC += select.c
166endif
167if POLL_BACKEND
168SYS_SRC += poll.c
169endif
170if DEVPOLL_BACKEND
171SYS_SRC += devpoll.c
172endif
173if KQUEUE_BACKEND
174SYS_SRC += kqueue.c
175endif
176if EPOLL_BACKEND
177SYS_SRC += epoll.c
178endif
179if EVPORT_BACKEND
180SYS_SRC += evport.c
181endif
182if SIGNAL_SUPPORT
183SYS_SRC += signal.c
184endif
185
186BUILT_SOURCES += include/event2/event-config.h
187
188include/event2/event-config.h: config.h make-event-config.sed
189	$(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2
190	$(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T
191	$(AM_V_at)mv -f $@T $@
192
193CORE_SRC =					\
194	buffer.c				\
195	bufferevent.c				\
196	bufferevent_filter.c			\
197	bufferevent_pair.c			\
198	bufferevent_ratelim.c			\
199	bufferevent_sock.c			\
200	event.c					\
201	evmap.c					\
202	evthread.c				\
203	evutil.c				\
204	evutil_rand.c				\
205	evutil_time.c				\
206	listener.c				\
207	log.c					\
208	$(SYS_SRC)
209
210EXTRAS_SRC =					\
211	evdns.c					\
212	event_tagging.c				\
213	evrpc.c					\
214	http.c
215
216if BUILD_WITH_NO_UNDEFINED
217NO_UNDEFINED = -no-undefined
218MAYBE_CORE = libevent_core.la
219else
220NO_UNDEFINED =
221MAYBE_CORE =
222endif
223
224GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED)
225
226libevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC)
227libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
228libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
229
230libevent_core_la_SOURCES = $(CORE_SRC)
231libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
232libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
233
234if PTHREADS
235libevent_pthreads_la_SOURCES = evthread_pthread.c
236libevent_pthreads_la_LIBADD = $(MAYBE_CORE)
237libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
238endif
239
240libevent_extra_la_SOURCES = $(EXTRAS_SRC)
241libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
242libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
243
244if OPENSSL
245libevent_openssl_la_SOURCES = bufferevent_openssl.c
246libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
247libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
248libevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS)
249endif
250
251noinst_HEADERS +=				\
252	WIN32-Code/nmake/evconfig-private.h	\
253	WIN32-Code/nmake/event2/event-config.h	\
254	WIN32-Code/tree.h			\
255	bufferevent-internal.h			\
256	changelist-internal.h			\
257	compat/sys/queue.h			\
258	defer-internal.h			\
259	epolltable-internal.h			\
260	evbuffer-internal.h			\
261	evconfig-private.h			\
262	event-internal.h			\
263	evmap-internal.h			\
264	evrpc-internal.h			\
265	evsignal-internal.h			\
266	evthread-internal.h			\
267	ht-internal.h				\
268	http-internal.h				\
269	iocp-internal.h				\
270	ipv6-internal.h				\
271	kqueue-internal.h			\
272	log-internal.h				\
273	minheap-internal.h			\
274	mm-internal.h				\
275	ratelim-internal.h			\
276	ratelim-internal.h			\
277	strlcpy-internal.h			\
278	time-internal.h				\
279	util-internal.h
280
281EVENT1_HDRS = \
282	include/evdns.h \
283	include/event.h \
284	include/evhttp.h \
285	include/evrpc.h \
286	include/evutil.h
287
288if INSTALL_LIBEVENT
289include_HEADERS = $(EVENT1_HDRS)
290else
291noinst_HEADERS += $(EVENT1_HDRS)
292endif
293
294AM_CPPFLAGS = -I$(srcdir)/compat -I$(srcdir)/include -I./include $(SYS_INCLUDES)
295
296verify: check
297
298doxygen: FORCE
299	doxygen $(srcdir)/Doxyfile
300FORCE:
301
302DISTCLEANFILES += *~ libevent.pc ./include/event2/event-config.h
303
304