Makefile.am revision 316722
11638Srgrimes# Makefile.am for libevent
21638Srgrimes# Copyright 2000-2007 Niels Provos
31638Srgrimes# Copyright 2007-2012 Niels Provos and Nick Mathewson
41638Srgrimes#
51638Srgrimes# See LICENSE for copying information.
61638Srgrimes
71638Srgrimes# 'foreign' means that we're not enforcing GNU package rules strictly.
81638Srgrimes# '1.9' means that we need automake 1.9 or later (and we do).
91638SrgrimesAUTOMAKE_OPTIONS = foreign 1.9 subdir-objects
101638Srgrimes
111638SrgrimesACLOCAL_AMFLAGS = -I m4
121638Srgrimes
131638Srgrimes# This is the "Release" of the Libevent ABI.  It takes precedence over
141638Srgrimes# the VERSION_INFO, so that two versions of Libevent with the same
151638Srgrimes# "Release" are never binary-compatible.
161638Srgrimes#
171638Srgrimes# This number incremented once for the 2.0 release candidate, and
181638Srgrimes# will increment for each series until we revise our interfaces enough
191638Srgrimes# that we can seriously expect ABI compatibility between series.
201638Srgrimes#
211638SrgrimesRELEASE = -release 2.1
221638Srgrimes
231638Srgrimes# This is the version info for the libevent binary API.  It has three
241638Srgrimes# numbers:
251638Srgrimes#   Current  -- the number of the binary API that we're implementing
261638Srgrimes#   Revision -- which iteration of the implementation of the binary
271638Srgrimes#               API are we supplying?
281638Srgrimes#   Age      -- How many previous binary API versions do we also
291638Srgrimes#               support?
301638Srgrimes#
311638Srgrimes# To increment a VERSION_INFO (current:revision:age):
321638Srgrimes#    If the ABI didn't change:
331638Srgrimes#        Return (current:revision+1:age)
341638Srgrimes#    If the ABI changed, but it's backward-compatible:
351638Srgrimes#        Return (current+1:0:age+1)
361638Srgrimes#    If the ABI changed and it isn't backward-compatible:
371638Srgrimes#        Return (current+1:0:0)
381638Srgrimes#
391638Srgrimes# Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
401638Srgrimes# UNLESS YOU REALLY REALLY HAVE TO.
411638SrgrimesVERSION_INFO = 5:0:0
421638Srgrimes
431638Srgrimes# History:          RELEASE    VERSION_INFO
441638Srgrimes#  2.0.1-alpha --     2.0        1:0:0
451638Srgrimes#  2.0.2-alpha --                2:0:0
461638Srgrimes#  2.0.3-alpha --                2:0:0  (should have incremented; didn't.)
471638Srgrimes#  2.0.4-alpha --                3:0:0
481638Srgrimes#  2.0.5-beta  --                4:0:0
491638Srgrimes#  2.0.6-rc    --     2.0        2:0:0
501638Srgrimes#  2.0.7-rc    --     2.0        3:0:1
511638Srgrimes#  2.0.8-rc    --     2.0        4:0:2
521638Srgrimes#  2.0.9-rc    --     2.0        5:0:0 (ABI changed slightly)
531638Srgrimes#  2.0.10-stable--    2.0        5:1:0 (No ABI change)
541638Srgrimes#  2.0.11-stable--    2.0        6:0:1 (ABI changed, backward-compatible)
551638Srgrimes#  2.0.12-stable--    2.0        6:1:1 (No ABI change)
561638Srgrimes#  2.0.13-stable--    2.0        6:2:1 (No ABI change)
571638Srgrimes#  2.0.14-stable--    2.0        6:3:1 (No ABI change)
581638Srgrimes#  2.0.15-stable--    2.0        6:3:1 (Forgot to update :( )
591638Srgrimes#  2.0.16-stable--    2.0        6:4:1 (No ABI change)
601638Srgrimes#  2.0.17-stable--    2.0        6:5:1 (No ABI change)
611638Srgrimes#  2.0.18-stable--    2.0        6:6:1 (No ABI change)
621638Srgrimes#  2.0.19-stable--    2.0        6:7:1 (No ABI change)
631638Srgrimes#  2.0.20-stable--    2.0        6:8:1 (No ABI change)
641638Srgrimes#  2.0.21-stable--    2.0        6:9:1 (No ABI change)
651638Srgrimes#
661638Srgrimes# For Libevent 2.1:
671638Srgrimes#  2.1.1-alpha --     2.1        1:0:0
681638Srgrimes#  2.1.2-alpha --     2.1        1:0:0 (should have been 2:0:1)
691638Srgrimes#  2.1.3-alpha --     2.1        3:0:0 (ABI changed slightly)
701638Srgrimes#  2.1.4-alpha --     2.1        4:0:0 (ABI changed slightly)
711638Srgrimes#  2.1.5-beta  --     2.1        5:0:0 (ABI changed slightly)
721638Srgrimes
731638Srgrimes# ABI version history for this package effectively restarts every time
741638Srgrimes# we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
751638Srgrimes#
761638Srgrimes# Ideally, we would not be using RELEASE at all; instead we could just
771638Srgrimes# use the VERSION_INFO field to label our backward-incompatible ABI
781638Srgrimes# changes, and those would be few and far between.  Unfortunately,
791638Srgrimes# Libevent still exposes far too many volatile structures in its
801638Srgrimes# headers, so we pretty much have to assume that most development
811638Srgrimes# series will break ABI compatibility.  For now, it's simplest just to
821638Srgrimes# keep incrementing the RELEASE between series and resetting VERSION_INFO.
831638Srgrimes#
841638Srgrimes# Eventually, when we get to the point where the structures in the
851638Srgrimes# headers are all non-changing (or not there at all!), we can shift to
861638Srgrimes# a more normal worldview where backward-incompatible ABI changes are
871638Srgrimes# nice and rare.  For the next couple of years, though, 'struct event'
881638Srgrimes# is user-visible, and so we can pretty much guarantee that release
891638Srgrimes# series won't be binary-compatible.
901638Srgrimes
911638Srgrimesif INSTALL_LIBEVENT
921638Srgrimesdist_bin_SCRIPTS = event_rpcgen.py
931638Srgrimesendif
941638Srgrimes
951638Srgrimespkgconfigdir=$(libdir)/pkgconfig
961638SrgrimesLIBEVENT_PKGCONFIG=libevent.pc
971638Srgrimes
981638Srgrimes# These sources are conditionally added by configure.ac or conditionally
991638Srgrimes# included from other files.
1001638SrgrimesPLATFORM_DEPENDENT_SRC = \
1011638Srgrimes	arc4random.c \
1021638Srgrimes	epoll_sub.c
1031638Srgrimes
1041638SrgrimesEXTRA_DIST = \
1051638Srgrimes	ChangeLog-1.4 \
1061638Srgrimes	ChangeLog-2.0 \
1071638Srgrimes	Doxyfile \
1081638Srgrimes	LICENSE \
1091638Srgrimes	Makefile.nmake test/Makefile.nmake \
1101638Srgrimes	autogen.sh \
1111638Srgrimes	event_rpcgen.py \
1121638Srgrimes	libevent.pc.in \
1131638Srgrimes	make-event-config.sed \
1141638Srgrimes	whatsnew-2.0.txt \
1151638Srgrimes	whatsnew-2.1.txt \
1161638Srgrimes	$(PLATFORM_DEPENDENT_SRC)
1171638Srgrimes
1181638SrgrimesLIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la
1191638Srgrimesif PTHREADS
1201638SrgrimesLIBEVENT_LIBS_LA += libevent_pthreads.la
1211638SrgrimesLIBEVENT_PKGCONFIG += libevent_pthreads.pc
1221638Srgrimesendif
1231638Srgrimesif OPENSSL
1241638SrgrimesLIBEVENT_LIBS_LA += libevent_openssl.la
1251638SrgrimesLIBEVENT_PKGCONFIG += libevent_openssl.pc
1261638Srgrimesendif
1271638Srgrimes
1281638Srgrimesif INSTALL_LIBEVENT
1291638Srgrimeslib_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
1301638Srgrimespkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
1311638Srgrimeselse
1321638Srgrimesnoinst_LTLIBRARIES =  $(LIBEVENT_LIBS_LA)
1331638Srgrimesendif
1341638Srgrimes
1351638SrgrimesEXTRA_SOURCE=
1361638Srgrimesnoinst_HEADERS=
1371638Srgrimesnoinst_PROGRAMS=
1381638SrgrimesEXTRA_PROGRAMS=
1391638SrgrimesCLEANFILES=
1401638SrgrimesDISTCLEANFILES=
1411638SrgrimesBUILT_SOURCES =
1421638Srgrimesinclude include/include.am
1431638Srgrimes#include sample/include.am
1441638Srgrimesinclude test/include.am
1451638Srgrimes
1461638Srgrimesif BUILD_WIN32
1471638Srgrimes
1481638SrgrimesSYS_LIBS = -lws2_32 -lshell32 -ladvapi32
1491638SrgrimesSYS_SRC = win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \
1501638Srgrimes	bufferevent_async.c
1511638SrgrimesSYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake
1521638Srgrimes
1531638Srgrimeselse
1541638Srgrimes
1551638SrgrimesSYS_LIBS =
1561638SrgrimesSYS_SRC =
1571638SrgrimesSYS_INCLUDES =
1581638Srgrimes
1591638Srgrimesendif
1601638Srgrimes
1611638Srgrimesif STRLCPY_IMPL
1621638SrgrimesSYS_SRC += strlcpy.c
1631638Srgrimesendif
1641638Srgrimesif SELECT_BACKEND
1651638SrgrimesSYS_SRC += select.c
1661638Srgrimesendif
1671638Srgrimesif POLL_BACKEND
1681638SrgrimesSYS_SRC += poll.c
1691638Srgrimesendif
1701638Srgrimesif DEVPOLL_BACKEND
1711638SrgrimesSYS_SRC += devpoll.c
1721638Srgrimesendif
1731638Srgrimesif KQUEUE_BACKEND
1741638SrgrimesSYS_SRC += kqueue.c
1751638Srgrimesendif
1761638Srgrimesif 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
224AM_CFLAGS = $(LEP_CFLAGS)
225AM_CPPFLAGS = -I$(srcdir)/compat -I$(srcdir)/include -I./include $(SYS_INCLUDES) $(LEP_CPPFLAGS)
226AM_LDFLAGS = $(LEP_CFLAGS)
227
228GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED) $(AM_LDFLAGS)
229
230libevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC)
231libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
232libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
233
234libevent_core_la_SOURCES = $(CORE_SRC)
235libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
236libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
237
238if PTHREADS
239libevent_pthreads_la_SOURCES = evthread_pthread.c
240libevent_pthreads_la_LIBADD = $(MAYBE_CORE)
241libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
242endif
243
244libevent_extra_la_SOURCES = $(EXTRAS_SRC)
245libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
246libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
247
248if OPENSSL
249libevent_openssl_la_SOURCES = bufferevent_openssl.c
250libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
251libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
252libevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS)
253endif
254
255noinst_HEADERS +=				\
256	WIN32-Code/nmake/evconfig-private.h	\
257	WIN32-Code/nmake/event2/event-config.h	\
258	WIN32-Code/tree.h			\
259	bufferevent-internal.h			\
260	changelist-internal.h			\
261	compat/sys/queue.h			\
262	defer-internal.h			\
263	epolltable-internal.h			\
264	evbuffer-internal.h			\
265	evconfig-private.h			\
266	event-internal.h			\
267	evmap-internal.h			\
268	evrpc-internal.h			\
269	evsignal-internal.h			\
270	evthread-internal.h			\
271	ht-internal.h				\
272	http-internal.h				\
273	iocp-internal.h				\
274	ipv6-internal.h				\
275	kqueue-internal.h			\
276	log-internal.h				\
277	minheap-internal.h			\
278	mm-internal.h				\
279	ratelim-internal.h			\
280	ratelim-internal.h			\
281	strlcpy-internal.h			\
282	time-internal.h				\
283	util-internal.h
284
285EVENT1_HDRS = \
286	include/evdns.h \
287	include/event.h \
288	include/evhttp.h \
289	include/evrpc.h \
290	include/evutil.h
291
292if INSTALL_LIBEVENT
293include_HEADERS = $(EVENT1_HDRS)
294else
295noinst_HEADERS += $(EVENT1_HDRS)
296endif
297
298verify: check
299
300doxygen: FORCE
301	doxygen $(srcdir)/Doxyfile
302FORCE:
303
304DISTCLEANFILES += *~ libevent.pc ./include/event2/event-config.h
305
306