summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 7de4db1afdbf3e5fcdd32ad3e50ef5b0c12cc5f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# 'foreign' means that we're not enforcing GNU package rules strictly.
# '1.7' means that we need automake 1.7 or later (and we do).
AUTOMAKE_OPTIONS = foreign 1.7

ACLOCAL_AMFLAGS = -I m4

# This is the "Release" of the Libevent ABI.  It takes precedence over
# the VERSION_INFO, so that two versions of Libevent with the same
# "Release" are never binary-compatible.
#
# This number incremented once for the 2.0 release candidate, and
# shouldn't increment again until Libevent 3.0.  Also, we shouldn't
# increment to Libevent 3.0 unless we know in advance we're breaking
# the ABI.
#
RELEASE = -release 2.0
#RELEASE =

# This is the version info for the libevent binary API.  It has three
# numbers:
#   Current  -- the number of the binary API that we're implementing
#   Revision -- which iteration of the implementation of the binary
#               API are we supplying?
#   Age      -- How many previous binary API versions do we also
#               support?
#
# To increment a VERSION_INFO (current:revision:age):
#    If the ABI didn't change:
#        Return (current:revision+1:age)
#    If the ABI changed, but it's backward-compatible:
#        Return (current+1:0:age+1)
#    If the ABI changed and it isn't backward-compatible:
#        Return (current+1:0:0)
#
# Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES.
VERSION_INFO = 2:0:0

# History:          RELEASE    VERSION_INFO
#  2.0.1-alpha --     2.0        1:0:0
#  2.0.2-alpha --                2:0:0
#  2.0.3-alpha --                2:0:0  (should have incremented; didn't.)
#  2.0.4-alpha --                3:0:0
#  2.0.5-beta  --                4:0:0
#  2.0.6-rc  --       2.0        2:0:0
# Planned:
#  2.0.7-stable --    2.0        2:1:0  (Assuming no ABI change)
#
# If Libevent 2.1.1 makes 'struct event' etc opaque in the headers:
#  2.1.1-alpha --     2.1        1:0:0
# If Libevent 2.1.1 does not makes 'struct event' opaque in the headers:
#  2.1.1-alpha --     2.1        1:0:0

# ABI version history for this package effectively restarts every time
# we change RELEASE.  Version 1.4.x had RELEASE of 1.4.
#
# Ideally, we would not be using RELEASE at all; instead we could just
# use the VERSION_INFO field to label our backward-incompatible ABI
# changes, and those would be few and far between.  Unfortunately,
# Libevent still exposes far too many volatile structures in its
# headers, so we pretty much have to assume that most development
# series will break ABI compatibility.  For now, it's simplest just to
# keep incrementing the RELEASE between series and resetting VERSION_INFO.
#
# Eventually, when we get to the point where the structures in the
# headers are all non-changing (or not there at all!), we can shift to
# a more normal worldview where backward-incompatible ABI changes are
# nice and rare.  For the next couple of years, though, 'struct event'
# is user-visible, and so we can pretty much guarantee that release
# series won't be binary-compatible.

dist_bin_SCRIPTS = event_rpcgen.py

pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA=libevent.pc

# These sources are conditionally added by configure.in or conditionally
# included from other files.
PLATFORM_DEPENDENT_SRC = \
	epoll_sub.c \
	arc4random.c

EXTRA_DIST = \
	LICENSE \
	autogen.sh \
	libevent.pc.in \
	Doxyfile \
	whatsnew-2.0.txt \
	Makefile.nmake test/Makefile.nmake \
	$(PLATFORM_DEPENDENT_SRC)

lib_LTLIBRARIES = libevent.la libevent_core.la libevent_extra.la
if PTHREADS
lib_LTLIBRARIES += libevent_pthreads.la
pkgconfig_DATA += libevent_pthreads.pc
endif
if OPENSSL
lib_LTLIBRARIES += libevent_openssl.la
pkgconfig_DATA += libevent_openssl.pc
endif

SUBDIRS = . include sample test

if BUILD_WIN32

SYS_LIBS = -lws2_32
SYS_SRC = win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \
	bufferevent_async.c
SYS_INCLUDES = -IWIN32-Code

else

SYS_LIBS =
SYS_SRC =
SYS_INCLUDES =

endif

if SELECT_BACKEND
SYS_SRC += select.c
endif
if POLL_BACKEND
SYS_SRC += poll.c
endif
if DEVPOLL_BACKEND
SYS_SRC += devpoll.c
endif
if KQUEUE_BACKEND
SYS_SRC += kqueue.c
endif
if EPOLL_BACKEND
SYS_SRC += epoll.c
endif
if EVPORT_BACKEND
SYS_SRC += evport.c
endif
if SIGNAL_SUPPORT
SYS_SRC += signal.c
endif

BUILT_SOURCES = ./include/event2/event-config.h

./include/event2/event-config.h: config.h
	@MKDIR_P@ ./include/event2
	echo '/* event2/event-config.h' > $@
	echo ' *' >> $@
	echo ' * This file was generated by autoconf when libevent was built, and post-' >> $@
	echo ' * processed by Libevent so that its macros would have a uniform prefix.' >> $@
	echo ' *' >> $@
	echo ' * DO NOT EDIT THIS FILE.' >> $@
	echo ' *' >> $@
	echo ' * Do not rely on macros in this file existing in later versions.'>> $@
	echo ' */' >> $@
	echo '#ifndef _EVENT2_EVENT_CONFIG_H_' >> $@
	echo '#define _EVENT2_EVENT_CONFIG_H_' >> $@

	sed -e 's/#define /#define _EVENT_/' \
	    -e 's/#undef /#undef _EVENT_/' \
	    -e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@
	echo "#endif" >> $@

CORE_SRC = event.c evthread.c buffer.c \
	bufferevent.c bufferevent_sock.c bufferevent_filter.c \
	bufferevent_pair.c listener.c bufferevent_ratelim.c \
	evmap.c	log.c evutil.c evutil_rand.c strlcpy.c $(SYS_SRC)
EXTRA_SRC = event_tagging.c http.c evdns.c evrpc.c

if BUILD_WIN32
NO_UNDEFINED = -no-undefined
MAYBE_CORE = libevent_core.la
else
NO_UNDEFINED =
MAYBE_CORE =
endif

GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED)

libevent_la_SOURCES = $(CORE_SRC) $(EXTRA_SRC)
libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)

libevent_core_la_SOURCES = $(CORE_SRC)
libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)

if PTHREADS
libevent_pthreads_la_SOURCES = evthread_pthread.c
libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
endif

libevent_extra_la_SOURCES = $(EXTRA_SRC)
libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)

if OPENSSL
libevent_openssl_la_SOURCES = bufferevent_openssl.c
libevent_openssl_la_LIBADD = $(MAYBE_CORE) -lcrypto -lssl
libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
endif

noinst_HEADERS = util-internal.h mm-internal.h ipv6-internal.h \
	evrpc-internal.h strlcpy-internal.h evbuffer-internal.h \
	bufferevent-internal.h http-internal.h event-internal.h \
	evthread-internal.h ht-internal.h defer-internal.h \
	minheap-internal.h log-internal.h evsignal-internal.h evmap-internal.h \
	changelist-internal.h iocp-internal.h \
	ratelim-internal.h \
	WIN32-Code/event2/event-config.h \
	WIN32-Code/tree.h \
	compat/sys/queue.h

include_HEADERS = event.h evhttp.h evdns.h evrpc.h evutil.h

INCLUDES = -I$(srcdir)/compat -I$(srcdir)/include -I./include $(SYS_INCLUDES)

verify: check

doxygen: FORCE
	doxygen $(srcdir)/Doxyfile
FORCE:

DISTCLEANFILES = *~ libevent.pc ./include/event2/event-config.h