1#
2# Copyright (C) 2011 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
18
19include $(CLEAR_VARS)
20
21LOCAL_SRC_FILES := \
22	src/racoon/algorithm.c \
23	src/racoon/crypto_openssl.c \
24	src/racoon/genlist.c \
25	src/racoon/handler.c \
26	src/racoon/isakmp.c \
27	src/racoon/isakmp_agg.c \
28	src/racoon/isakmp_base.c \
29	src/racoon/isakmp_cfg.c \
30	src/racoon/isakmp_frag.c \
31	src/racoon/isakmp_ident.c \
32	src/racoon/isakmp_inf.c \
33	src/racoon/isakmp_newg.c \
34	src/racoon/isakmp_quick.c \
35	src/racoon/isakmp_unity.c \
36	src/racoon/isakmp_xauth.c \
37	src/racoon/ipsec_doi.c \
38	src/racoon/nattraversal.c \
39	src/racoon/oakley.c \
40	src/racoon/pfkey.c \
41	src/racoon/policy.c \
42	src/racoon/proposal.c \
43	src/racoon/remoteconf.c \
44	src/racoon/schedule.c \
45	src/racoon/sockmisc.c \
46	src/racoon/str2val.c \
47	src/racoon/strnames.c \
48	src/racoon/vendorid.c \
49	src/racoon/vmbuf.c \
50	main.c \
51	setup.c
52
53LOCAL_C_INCLUDES += \
54	$(LOCAL_PATH) \
55	$(LOCAL_PATH)/src/include-glibc \
56	$(LOCAL_PATH)/src/libipsec \
57	$(LOCAL_PATH)/src/racoon \
58	$(LOCAL_PATH)/src/racoon/missing
59
60LOCAL_STATIC_LIBRARIES := libipsec
61
62LOCAL_SHARED_LIBRARIES := libcutils liblog libcrypto
63
64ifneq (,$(wildcard $(TOP)/external/boringssl/flavor.mk))
65	include $(TOP)/external/boringssl/flavor.mk
66else
67	include $(TOP)/external/openssl/flavor.mk
68endif
69ifeq ($(OPENSSL_FLAVOR),BoringSSL)
70	LOCAL_SHARED_LIBRARIES += libkeystore-engine
71endif
72
73LOCAL_CFLAGS := -DANDROID_CHANGES -DHAVE_CONFIG_H -DHAVE_OPENSSL_ENGINE_H -D_BSD_SOURCE=1
74
75LOCAL_CFLAGS += -Wno-sign-compare -Wno-missing-field-initializers -Wno-unused-parameter -Wno-pointer-sign -Werror
76
77# Turn off unused XXX warnings. Should be removed/fixed when syncing with upstream. b/18523687, b/18632512
78LOCAL_CFLAGS += -Wno-unused-variable \
79                -Wno-unused-but-set-variable \
80                -Wno-unused-function \
81                -Wno-unused-label \
82                -Wno-unused-value
83
84LOCAL_MODULE := racoon
85
86LOCAL_INIT_RC := racoon.rc
87
88include $(BUILD_EXECUTABLE)
89
90##########################################################################
91
92include $(CLEAR_VARS)
93
94LOCAL_SRC_FILES := \
95	src/libipsec/pfkey.c \
96	src/libipsec/ipsec_strerror.c
97
98LOCAL_CFLAGS := -DANDROID_CHANGES -DHAVE_CONFIG_H -DHAVE_OPENSSL_ENGINE_H
99
100LOCAL_CFLAGS += -Wno-sign-compare -Wno-missing-field-initializers -Wno-unused-parameter -Wno-pointer-sign -Werror
101
102LOCAL_C_INCLUDES += \
103	$(LOCAL_PATH) \
104	$(LOCAL_PATH)/src/include-glibc \
105	$(LOCAL_PATH)/src/libipsec
106
107LOCAL_MODULE := libipsec
108
109LOCAL_MODULE_TAGS := optional
110
111include $(BUILD_STATIC_LIBRARY)
112