summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 303af1d9b84c284356808e1961eb33eae4f87555 (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
# '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 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?
#
# If we release a new version that does not change the binary API,
# increment Revision.
#
# If we release a new version that changes the binary API, but does
# not break programs compiled against the old binary API, increment
# Current and Age.  Set Revision to 0, since this is the first
# implementation of the new API.
#
# Otherwise, we're changing the binary API and breaking bakward
# compatibility with old binaries.  Increment Current.  Set Age to 0,
# since we're backward compatible with no previous APIs.  Set Revision
# to 0 too.
#
# ABI version history for this package effectively begins with package
# version 2.0, because package version 1.4 erroneously applied both
# -release and -version-info to the same libraries; -release takes
# precedence, so the -version-info history of 1.4 libraries is moot.
# We are starting the numbering at 2 rather than 1 to avoid confusion.
#
#      2:0:0 -- Libevent 2.0.1-alpha.
#      3:0:0 -- Libevent 2.0.4-alpha
VERSION_INFO = 3:0:0

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 = \
	evdns.3 event.3 \
	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
endif
if OPENSSL
lib_LTLIBRARIES += libevent_openssl.la
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 = event-config.h

event-config.h: config.h
	echo '/* 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 _EVENT_CONFIG_H_' >> $@
	echo '#define _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

libevent_la_SOURCES = $(CORE_SRC) $(EXTRA_SRC)
libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
libevent_la_LDFLAGS = -version-info $(VERSION_INFO) -no-undefined

libevent_core_la_SOURCES = $(CORE_SRC)
libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
libevent_core_la_LDFLAGS = -version-info $(VERSION_INFO) -no-undefined

if PTHREADS
libevent_pthreads_la_SOURCES = evthread_pthread.c
endif

libevent_extra_la_SOURCES = $(EXTRA_SRC)
libevent_extra_la_LIBADD = libevent_core.la $(SYS_LIBS)
libevent_extra_la_LDFLAGS = -version-info $(VERSION_INFO) -no-undefined

if OPENSSL
libevent_openssl_la_SOURCES = bufferevent_openssl.c
libevent_openssl_la_LIBADD = libevent_core.la -lcrypto -lssl
libevent_openssl_la_LDFLAGS = -version-info $(VERSION_INFO) -no-undefined
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/event-config.h \
	WIN32-Code/tree.h \
	compat/sys/queue.h

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

nodist_include_HEADERS = event-config.h

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

man_MANS = event.3 evdns.3

verify: check

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

DISTCLEANFILES = *~ event-config.h libevent.pc