xref: /freebsd/contrib/libevent/Makefile.am (revision b50261e2)
1c43e99fdSEd Maste# Makefile.am for libevent
2c43e99fdSEd Maste# Copyright 2000-2007 Niels Provos
3c43e99fdSEd Maste# Copyright 2007-2012 Niels Provos and Nick Mathewson
4c43e99fdSEd Maste#
5c43e99fdSEd Maste# See LICENSE for copying information.
6c43e99fdSEd Maste
7c43e99fdSEd Maste# 'foreign' means that we're not enforcing GNU package rules strictly.
8*b50261e2SCy Schubert# '1.13' means that we need automake 1.13 or later (and we do).
9*b50261e2SCy SchubertAUTOMAKE_OPTIONS = foreign 1.13 subdir-objects
10c43e99fdSEd Maste
11c43e99fdSEd MasteACLOCAL_AMFLAGS = -I m4
12c43e99fdSEd Maste
13c43e99fdSEd Maste# This is the "Release" of the Libevent ABI.  It takes precedence over
14c43e99fdSEd Maste# the VERSION_INFO, so that two versions of Libevent with the same
15c43e99fdSEd Maste# "Release" are never binary-compatible.
16c43e99fdSEd Maste#
17c43e99fdSEd Maste# This number incremented once for the 2.0 release candidate, and
18c43e99fdSEd Maste# will increment for each series until we revise our interfaces enough
19c43e99fdSEd Maste# that we can seriously expect ABI compatibility between series.
20c43e99fdSEd Maste#
21c43e99fdSEd MasteRELEASE = -release 2.1
22c43e99fdSEd Maste
23c43e99fdSEd Maste# This is the version info for the libevent binary API.  It has three
24c43e99fdSEd Maste# numbers:
25c43e99fdSEd Maste#   Current  -- the number of the binary API that we're implementing
26c43e99fdSEd Maste#   Revision -- which iteration of the implementation of the binary
27c43e99fdSEd Maste#               API are we supplying?
28c43e99fdSEd Maste#   Age      -- How many previous binary API versions do we also
29c43e99fdSEd Maste#               support?
30c43e99fdSEd Maste#
31c43e99fdSEd Maste# To increment a VERSION_INFO (current:revision:age):
32c43e99fdSEd Maste#    If the ABI didn't change:
33c43e99fdSEd Maste#        Return (current:revision+1:age)
34c43e99fdSEd Maste#    If the ABI changed, but it's backward-compatible:
35c43e99fdSEd Maste#        Return (current+1:0:age+1)
36c43e99fdSEd Maste#    If the ABI changed and it isn't backward-compatible:
37c43e99fdSEd Maste#        Return (current+1:0:0)
38c43e99fdSEd Maste#
39c43e99fdSEd Maste# Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
40c43e99fdSEd Maste# UNLESS YOU REALLY REALLY HAVE TO.
41*b50261e2SCy SchubertVERSION_INFO = 7:1:0
42c43e99fdSEd Maste
43c43e99fdSEd Maste# History:          RELEASE    VERSION_INFO
44c43e99fdSEd Maste#  2.0.1-alpha --     2.0        1:0:0
45c43e99fdSEd Maste#  2.0.2-alpha --                2:0:0
46c43e99fdSEd Maste#  2.0.3-alpha --                2:0:0  (should have incremented; didn't.)
47c43e99fdSEd Maste#  2.0.4-alpha --                3:0:0
48c43e99fdSEd Maste#  2.0.5-beta  --                4:0:0
49c43e99fdSEd Maste#  2.0.6-rc    --     2.0        2:0:0
50c43e99fdSEd Maste#  2.0.7-rc    --     2.0        3:0:1
51c43e99fdSEd Maste#  2.0.8-rc    --     2.0        4:0:2
52c43e99fdSEd Maste#  2.0.9-rc    --     2.0        5:0:0 (ABI changed slightly)
53c43e99fdSEd Maste#  2.0.10-stable--    2.0        5:1:0 (No ABI change)
54c43e99fdSEd Maste#  2.0.11-stable--    2.0        6:0:1 (ABI changed, backward-compatible)
55c43e99fdSEd Maste#  2.0.12-stable--    2.0        6:1:1 (No ABI change)
56c43e99fdSEd Maste#  2.0.13-stable--    2.0        6:2:1 (No ABI change)
57c43e99fdSEd Maste#  2.0.14-stable--    2.0        6:3:1 (No ABI change)
58c43e99fdSEd Maste#  2.0.15-stable--    2.0        6:3:1 (Forgot to update :( )
59c43e99fdSEd Maste#  2.0.16-stable--    2.0        6:4:1 (No ABI change)
60c43e99fdSEd Maste#  2.0.17-stable--    2.0        6:5:1 (No ABI change)
61c43e99fdSEd Maste#  2.0.18-stable--    2.0        6:6:1 (No ABI change)
62c43e99fdSEd Maste#  2.0.19-stable--    2.0        6:7:1 (No ABI change)
63c43e99fdSEd Maste#  2.0.20-stable--    2.0        6:8:1 (No ABI change)
64c43e99fdSEd Maste#  2.0.21-stable--    2.0        6:9:1 (No ABI change)
65c43e99fdSEd Maste#
66c43e99fdSEd Maste# For Libevent 2.1:
67c43e99fdSEd Maste#  2.1.1-alpha --     2.1        1:0:0
68c43e99fdSEd Maste#  2.1.2-alpha --     2.1        1:0:0 (should have been 2:0:1)
69c43e99fdSEd Maste#  2.1.3-alpha --     2.1        3:0:0 (ABI changed slightly)
70c43e99fdSEd Maste#  2.1.4-alpha --     2.1        4:0:0 (ABI changed slightly)
71c43e99fdSEd Maste#  2.1.5-beta  --     2.1        5:0:0 (ABI changed slightly)
72c43e99fdSEd Maste#  2.1.6-beta  --     2.1        6:0:0 (ABI changed slightly)
73c43e99fdSEd Maste#  2.1.7-beta  --     2.1        6:1:0 (ABI changed slightly)
74*b50261e2SCy Schubert#  2.1.8-stable--     2.1        6:2:0 (No ABI change)
75*b50261e2SCy Schubert#  2.1.9-beta--       2.1        6:3:0 (No ABI change)
76*b50261e2SCy Schubert#  2.1.10-stable--    2.1        6:4:0 (No ABI change, WRONG)
77*b50261e2SCy Schubert#  2.1.11-stable--    2.1        7:0:0 (ABI changed)
78*b50261e2SCy Schubert#  2.1.12-stable--    2.1        7:1:0 (No ABI change)
79c43e99fdSEd Maste
80c43e99fdSEd Maste# ABI version history for this package effectively restarts every time
81c43e99fdSEd Maste# we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
82c43e99fdSEd Maste#
83c43e99fdSEd Maste# Ideally, we would not be using RELEASE at all; instead we could just
84c43e99fdSEd Maste# use the VERSION_INFO field to label our backward-incompatible ABI
85c43e99fdSEd Maste# changes, and those would be few and far between.  Unfortunately,
86c43e99fdSEd Maste# Libevent still exposes far too many volatile structures in its
87c43e99fdSEd Maste# headers, so we pretty much have to assume that most development
88c43e99fdSEd Maste# series will break ABI compatibility.  For now, it's simplest just to
89c43e99fdSEd Maste# keep incrementing the RELEASE between series and resetting VERSION_INFO.
90c43e99fdSEd Maste#
91c43e99fdSEd Maste# Eventually, when we get to the point where the structures in the
92c43e99fdSEd Maste# headers are all non-changing (or not there at all!), we can shift to
93c43e99fdSEd Maste# a more normal worldview where backward-incompatible ABI changes are
94c43e99fdSEd Maste# nice and rare.  For the next couple of years, though, 'struct event'
95c43e99fdSEd Maste# is user-visible, and so we can pretty much guarantee that release
96c43e99fdSEd Maste# series won't be binary-compatible.
97c43e99fdSEd Maste
98c43e99fdSEd Masteif INSTALL_LIBEVENT
99c43e99fdSEd Mastedist_bin_SCRIPTS = event_rpcgen.py
100c43e99fdSEd Masteendif
101c43e99fdSEd Maste
102c43e99fdSEd Mastepkgconfigdir=$(libdir)/pkgconfig
103c43e99fdSEd MasteLIBEVENT_PKGCONFIG=libevent.pc libevent_core.pc libevent_extra.pc
104c43e99fdSEd Maste
105c43e99fdSEd Maste# These sources are conditionally added by configure.ac or conditionally
106c43e99fdSEd Maste# included from other files.
107c43e99fdSEd MastePLATFORM_DEPENDENT_SRC = \
108c43e99fdSEd Maste	arc4random.c \
109c43e99fdSEd Maste	epoll_sub.c
110c43e99fdSEd Maste
111*b50261e2SCy SchubertCMAKE_FILES = \
112*b50261e2SCy Schubert	cmake/AddCompilerFlags.cmake \
113*b50261e2SCy Schubert	cmake/AddEventLibrary.cmake \
114*b50261e2SCy Schubert	cmake/CheckConstExists.cmake \
115*b50261e2SCy Schubert	cmake/CheckFileOffsetBits.c \
116*b50261e2SCy Schubert	cmake/CheckFileOffsetBits.cmake \
117*b50261e2SCy Schubert	cmake/CheckFunctionKeywords.cmake \
118*b50261e2SCy Schubert	cmake/CheckPrototypeDefinition.c.in \
119*b50261e2SCy Schubert	cmake/CheckPrototypeDefinition.cmake \
120*b50261e2SCy Schubert	cmake/CheckWorkingKqueue.cmake \
121*b50261e2SCy Schubert	cmake/CodeCoverage.cmake \
122*b50261e2SCy Schubert	cmake/COPYING-CMAKE-SCRIPTS \
123*b50261e2SCy Schubert	cmake/Copyright.txt \
124*b50261e2SCy Schubert	cmake/LibeventConfig.cmake.in \
125*b50261e2SCy Schubert	cmake/LibeventConfigVersion.cmake.in \
126*b50261e2SCy Schubert	cmake/Macros.cmake \
127*b50261e2SCy Schubert	cmake/Uninstall.cmake.in \
128*b50261e2SCy Schubert	cmake/UseDoxygen.cmake \
129*b50261e2SCy Schubert	cmake/VersionViaGit.cmake \
130*b50261e2SCy Schubert	event-config.h.cmake \
131*b50261e2SCy Schubert	evconfig-private.h.cmake \
132*b50261e2SCy Schubert	CMakeLists.txt
133*b50261e2SCy Schubert
134c43e99fdSEd MasteEXTRA_DIST = \
135c43e99fdSEd Maste	ChangeLog-1.4 \
136c43e99fdSEd Maste	ChangeLog-2.0 \
137c43e99fdSEd Maste	Doxyfile \
138c43e99fdSEd Maste	LICENSE \
139c43e99fdSEd Maste	Makefile.nmake test/Makefile.nmake \
140c43e99fdSEd Maste	autogen.sh \
141c43e99fdSEd Maste	event_rpcgen.py \
142c43e99fdSEd Maste	libevent.pc.in \
143c43e99fdSEd Maste	make-event-config.sed \
144c43e99fdSEd Maste	whatsnew-2.0.txt \
145c43e99fdSEd Maste	whatsnew-2.1.txt \
146*b50261e2SCy Schubert	README.md \
147*b50261e2SCy Schubert	$(CMAKE_FILES) \
148c43e99fdSEd Maste	$(PLATFORM_DEPENDENT_SRC)
149c43e99fdSEd Maste
150c43e99fdSEd MasteLIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la
151c43e99fdSEd Masteif PTHREADS
152c43e99fdSEd MasteLIBEVENT_LIBS_LA += libevent_pthreads.la
153c43e99fdSEd MasteLIBEVENT_PKGCONFIG += libevent_pthreads.pc
154c43e99fdSEd Masteendif
155c43e99fdSEd Masteif OPENSSL
156c43e99fdSEd MasteLIBEVENT_LIBS_LA += libevent_openssl.la
157c43e99fdSEd MasteLIBEVENT_PKGCONFIG += libevent_openssl.pc
158c43e99fdSEd Masteendif
159c43e99fdSEd Maste
160c43e99fdSEd Masteif INSTALL_LIBEVENT
161c43e99fdSEd Mastelib_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
162c43e99fdSEd Mastepkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
163c43e99fdSEd Masteelse
164c43e99fdSEd Mastenoinst_LTLIBRARIES =  $(LIBEVENT_LIBS_LA)
165c43e99fdSEd Masteendif
166c43e99fdSEd Maste
167c43e99fdSEd MasteEXTRA_SOURCE=
168c43e99fdSEd Mastenoinst_HEADERS=
169c43e99fdSEd Mastenoinst_PROGRAMS=
170c43e99fdSEd MasteEXTRA_PROGRAMS=
171c43e99fdSEd MasteCLEANFILES=
172c43e99fdSEd MasteDISTCLEANFILES=
173c43e99fdSEd MasteBUILT_SOURCES =
174c43e99fdSEd Masteinclude include/include.am
175c43e99fdSEd Masteinclude sample/include.am
176c43e99fdSEd Masteinclude test/include.am
177c43e99fdSEd Maste
178c43e99fdSEd Masteif BUILD_WIN32
179c43e99fdSEd Maste
180*b50261e2SCy SchubertSYS_CORE_LIBS = -liphlpapi
181c43e99fdSEd MasteSYS_LIBS = -lws2_32 -lshell32 -ladvapi32
182c43e99fdSEd MasteSYS_SRC = win32select.c buffer_iocp.c event_iocp.c \
183c43e99fdSEd Maste	bufferevent_async.c
184c43e99fdSEd MasteSYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake
185c43e99fdSEd Maste
186c43e99fdSEd Masteif THREADS
187c43e99fdSEd MasteSYS_SRC += evthread_win32.c
188c43e99fdSEd Masteendif
189c43e99fdSEd Maste
190c43e99fdSEd Masteelse
191c43e99fdSEd Maste
192*b50261e2SCy SchubertSYS_CORE_LIBS =
193c43e99fdSEd MasteSYS_LIBS =
194c43e99fdSEd MasteSYS_SRC =
195c43e99fdSEd MasteSYS_INCLUDES =
196c43e99fdSEd Maste
197c43e99fdSEd Masteendif
198c43e99fdSEd Maste
199c43e99fdSEd Masteif STRLCPY_IMPL
200c43e99fdSEd MasteSYS_SRC += strlcpy.c
201c43e99fdSEd Masteendif
202c43e99fdSEd Masteif SELECT_BACKEND
203c43e99fdSEd MasteSYS_SRC += select.c
204c43e99fdSEd Masteendif
205c43e99fdSEd Masteif POLL_BACKEND
206c43e99fdSEd MasteSYS_SRC += poll.c
207c43e99fdSEd Masteendif
208c43e99fdSEd Masteif DEVPOLL_BACKEND
209c43e99fdSEd MasteSYS_SRC += devpoll.c
210c43e99fdSEd Masteendif
211c43e99fdSEd Masteif KQUEUE_BACKEND
212c43e99fdSEd MasteSYS_SRC += kqueue.c
213c43e99fdSEd Masteendif
214c43e99fdSEd Masteif EPOLL_BACKEND
215c43e99fdSEd MasteSYS_SRC += epoll.c
216c43e99fdSEd Masteendif
217c43e99fdSEd Masteif EVPORT_BACKEND
218c43e99fdSEd MasteSYS_SRC += evport.c
219c43e99fdSEd Masteendif
220c43e99fdSEd Masteif SIGNAL_SUPPORT
221c43e99fdSEd MasteSYS_SRC += signal.c
222c43e99fdSEd Masteendif
223c43e99fdSEd Maste
224c43e99fdSEd MasteBUILT_SOURCES += include/event2/event-config.h
225c43e99fdSEd Maste
226c43e99fdSEd Masteinclude/event2/event-config.h: config.h make-event-config.sed
227c43e99fdSEd Maste	$(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2
228c43e99fdSEd Maste	$(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T
229c43e99fdSEd Maste	$(AM_V_at)mv -f $@T $@
230c43e99fdSEd Maste
231c43e99fdSEd MasteCORE_SRC =					\
232c43e99fdSEd Maste	buffer.c				\
233c43e99fdSEd Maste	bufferevent.c				\
234c43e99fdSEd Maste	bufferevent_filter.c			\
235c43e99fdSEd Maste	bufferevent_pair.c			\
236c43e99fdSEd Maste	bufferevent_ratelim.c			\
237c43e99fdSEd Maste	bufferevent_sock.c			\
238c43e99fdSEd Maste	event.c					\
239c43e99fdSEd Maste	evmap.c					\
240c43e99fdSEd Maste	evthread.c				\
241c43e99fdSEd Maste	evutil.c				\
242c43e99fdSEd Maste	evutil_rand.c				\
243c43e99fdSEd Maste	evutil_time.c				\
244c43e99fdSEd Maste	listener.c				\
245c43e99fdSEd Maste	log.c					\
246c43e99fdSEd Maste	$(SYS_SRC)
247c43e99fdSEd Maste
248c43e99fdSEd MasteEXTRAS_SRC =					\
249c43e99fdSEd Maste	evdns.c					\
250c43e99fdSEd Maste	event_tagging.c				\
251c43e99fdSEd Maste	evrpc.c					\
252c43e99fdSEd Maste	http.c
253c43e99fdSEd Maste
254c43e99fdSEd Masteif BUILD_WITH_NO_UNDEFINED
255c43e99fdSEd MasteNO_UNDEFINED = -no-undefined
256c43e99fdSEd MasteMAYBE_CORE = libevent_core.la
257c43e99fdSEd Masteelse
258c43e99fdSEd MasteNO_UNDEFINED =
259c43e99fdSEd MasteMAYBE_CORE =
260c43e99fdSEd Masteendif
261c43e99fdSEd Maste
262*b50261e2SCy SchubertAM_CFLAGS = $(LIBEVENT_CFLAGS)
263*b50261e2SCy SchubertAM_CPPFLAGS = -I$(srcdir)/compat -I./include -I$(srcdir)/include $(SYS_INCLUDES) $(LIBEVENT_CPPFLAGS)
264*b50261e2SCy SchubertAM_LDFLAGS = $(LIBEVENT_LDFLAGS)
265*b50261e2SCy Schubert
266*b50261e2SCy SchubertGENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED) $(AM_LDFLAGS)
267c43e99fdSEd Maste
268c43e99fdSEd Mastelibevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC)
269*b50261e2SCy Schubertlibevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) $(SYS_CORE_LIBS)
270c43e99fdSEd Mastelibevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
271c43e99fdSEd Maste
272c43e99fdSEd Mastelibevent_core_la_SOURCES = $(CORE_SRC)
273*b50261e2SCy Schubertlibevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) $(SYS_CORE_LIBS)
274c43e99fdSEd Mastelibevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
275c43e99fdSEd Maste
276c43e99fdSEd Masteif PTHREADS
277c43e99fdSEd Mastelibevent_pthreads_la_SOURCES = evthread_pthread.c
278c43e99fdSEd Mastelibevent_pthreads_la_LIBADD = $(MAYBE_CORE)
279c43e99fdSEd Mastelibevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
280c43e99fdSEd Masteendif
281c43e99fdSEd Maste
282c43e99fdSEd Mastelibevent_extra_la_SOURCES = $(EXTRAS_SRC)
283c43e99fdSEd Mastelibevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
284c43e99fdSEd Mastelibevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
285c43e99fdSEd Maste
286c43e99fdSEd Masteif OPENSSL
287c43e99fdSEd Mastelibevent_openssl_la_SOURCES = bufferevent_openssl.c
288c43e99fdSEd Mastelibevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
289c43e99fdSEd Mastelibevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
290c43e99fdSEd Mastelibevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS)
291c43e99fdSEd Masteendif
292c43e99fdSEd Maste
293c43e99fdSEd Mastenoinst_HEADERS +=				\
294c43e99fdSEd Maste	WIN32-Code/nmake/evconfig-private.h	\
295c43e99fdSEd Maste	WIN32-Code/nmake/event2/event-config.h	\
296*b50261e2SCy Schubert	WIN32-Code/getopt.h			\
297*b50261e2SCy Schubert	WIN32-Code/getopt.c			\
298*b50261e2SCy Schubert	WIN32-Code/getopt_long.c	\
299c43e99fdSEd Maste	WIN32-Code/tree.h			\
300c43e99fdSEd Maste	bufferevent-internal.h		\
301c43e99fdSEd Maste	changelist-internal.h		\
302c43e99fdSEd Maste	compat/sys/queue.h			\
303c43e99fdSEd Maste	defer-internal.h			\
304c43e99fdSEd Maste	epolltable-internal.h		\
305c43e99fdSEd Maste	evbuffer-internal.h			\
306c43e99fdSEd Maste	event-internal.h			\
307c43e99fdSEd Maste	evmap-internal.h			\
308c43e99fdSEd Maste	evrpc-internal.h			\
309c43e99fdSEd Maste	evsignal-internal.h			\
310c43e99fdSEd Maste	evthread-internal.h			\
311c43e99fdSEd Maste	ht-internal.h				\
312c43e99fdSEd Maste	http-internal.h				\
313c43e99fdSEd Maste	iocp-internal.h				\
314c43e99fdSEd Maste	ipv6-internal.h				\
315c43e99fdSEd Maste	kqueue-internal.h			\
316c43e99fdSEd Maste	log-internal.h				\
317c43e99fdSEd Maste	minheap-internal.h			\
318c43e99fdSEd Maste	mm-internal.h				\
319c43e99fdSEd Maste	ratelim-internal.h			\
320c43e99fdSEd Maste	ratelim-internal.h			\
321c43e99fdSEd Maste	strlcpy-internal.h			\
322c43e99fdSEd Maste	time-internal.h				\
323c43e99fdSEd Maste	util-internal.h				\
324c43e99fdSEd Maste	openssl-compat.h
325c43e99fdSEd Maste
326c43e99fdSEd MasteEVENT1_HDRS = \
327c43e99fdSEd Maste	include/evdns.h \
328c43e99fdSEd Maste	include/event.h \
329c43e99fdSEd Maste	include/evhttp.h \
330c43e99fdSEd Maste	include/evrpc.h \
331c43e99fdSEd Maste	include/evutil.h
332c43e99fdSEd Maste
333c43e99fdSEd Masteif INSTALL_LIBEVENT
334c43e99fdSEd Masteinclude_HEADERS = $(EVENT1_HDRS)
335c43e99fdSEd Masteelse
336c43e99fdSEd Mastenoinst_HEADERS += $(EVENT1_HDRS)
337c43e99fdSEd Masteendif
338c43e99fdSEd Maste
339c43e99fdSEd Masteverify: check
340c43e99fdSEd Maste
341*b50261e2SCy Schubertinclude doxygen.am
342c43e99fdSEd Maste
343c43e99fdSEd MasteDISTCLEANFILES += *~ libevent.pc libevent_core.pc libevent_extra.pc ./include/event2/event-config.h
344c43e99fdSEd Maste
345