1# Copyright (C) 2015 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
17libevent_linux_src := \
18	epoll.c \
19	poll.c \
20	select.c \
21
22libevent_darwin_src := \
23	kqueue.c \
24	poll.c \
25	select.c \
26
27libevent_core_src := \
28	buffer.c \
29	bufferevent.c \
30	bufferevent_filter.c \
31	bufferevent_pair.c \
32	bufferevent_ratelim.c \
33	bufferevent_sock.c \
34	event.c \
35	evmap.c \
36	evthread.c \
37	evutil.c \
38	evutil_rand.c \
39	listener.c \
40	log.c \
41	signal.c \
42	strlcpy.c
43
44libevent_extra_src := \
45	evdns.c \
46	event_tagging.c \
47	evrpc.c \
48	http.c
49
50libevent_all_src := \
51	$(libevent_core_src) \
52	$(libevent_extra_src)
53
54libevent_cflags := \
55	-O3 \
56	-Wno-implicit-function-declaration \
57	-Wno-strict-aliasing \
58	-Wno-unused-parameter \
59	-Werror
60
61include $(CLEAR_VARS)
62LOCAL_MODULE := libevent
63LOCAL_ARM_MODE := arm
64LOCAL_CFLAGS := $(libevent_cflags)
65LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
66LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
67LOCAL_SHARED_LIBRARIES := libc
68LOCAL_SRC_FILES := $(libevent_all_src) $(libevent_linux_src)
69include $(BUILD_SHARED_LIBRARY)
70
71include $(CLEAR_VARS)
72LOCAL_MODULE := libevent-host
73LOCAL_CFLAGS := $(libevent_cflags)
74LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
75LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
76LOCAL_SRC_FILES := $(libevent_all_src) $(libevent_$(HOST_OS)_src)
77include $(BUILD_HOST_SHARED_LIBRARY)
78