]>
Commit | Line | Data |
---|---|---|
1be32988 TB |
1 | LOCAL_PATH := $(call my-dir) |
2 | include $(CLEAR_VARS) | |
3 | ||
1cde0a51 TB |
4 | # whether starter is built. allows to control the daemons from the command line |
5 | strongswan_BUILD_STARTER := true | |
6 | ||
0ad58f01 TB |
7 | # whether pluto (IKEv1 daemon) is built. charon (IKEv2) is always enabled |
8 | strongswan_BUILD_PLUTO := true | |
9 | ||
1be32988 TB |
10 | # this is the list of plugins that are built into libstrongswan and charon |
11 | # also these plugins are loaded by default (if not changed in strongswan.conf) | |
9227a3b3 | 12 | strongswan_CHARON_PLUGINS := openssl fips-prf random pubkey pkcs1 \ |
c177076b | 13 | pem xcbc hmac kernel-netlink socket-default android \ |
635724f6 | 14 | stroke eap-identity eap-mschapv2 eap-md5 |
1be32988 | 15 | |
0ad58f01 TB |
16 | ifneq ($(strongswan_BUILD_PLUTO),) |
17 | # if both daemons are enabled we use raw sockets in charon | |
18 | strongswan_CHARON_PLUGINS := $(subst socket-default,socket-raw, \ | |
19 | $(strongswan_CHARON_PLUGINS)) | |
9227a3b3 TB |
20 | # plugins loaded by pluto |
21 | strongswan_PLUTO_PLUGINS := openssl fips-prf random pubkey pkcs1 \ | |
22 | pem xcbc hmac kernel-netlink xauth | |
0ad58f01 | 23 | endif |
9227a3b3 | 24 | |
bb3357e8 TB |
25 | strongswan_STARTER_PLUGINS := kernel-netlink |
26 | ||
9227a3b3 TB |
27 | # list of all plugins - used to enable them with the function below |
28 | strongswan_PLUGINS := $(sort $(strongswan_CHARON_PLUGINS) \ | |
bb3357e8 TB |
29 | $(strongswan_PLUTO_PLUGINS) \ |
30 | $(strongswan_STARTER_PLUGINS)) | |
9227a3b3 | 31 | |
1be32988 | 32 | # helper macros to only add source files for plugins included in the list above |
0f5a0439 | 33 | # source files are relative to the android.mk that called the macro |
1be32988 TB |
34 | plugin_enabled = $(findstring $(1), $(strongswan_PLUGINS)) |
35 | add_plugin = $(if $(call plugin_enabled,$(1)), \ | |
0f5a0439 TB |
36 | $(patsubst $(LOCAL_PATH)/%,%, \ |
37 | $(wildcard \ | |
e3dd6b14 TB |
38 | $(subst %,$(subst -,_,$(strip $(1))), \ |
39 | $(LOCAL_PATH)/plugins/%/%*.c \ | |
40 | ) \ | |
0f5a0439 TB |
41 | ) \ |
42 | ) \ | |
43 | ) | |
1be32988 TB |
44 | |
45 | # includes | |
551b0202 TB |
46 | strongswan_PATH := $(LOCAL_PATH) |
47 | libvstr_PATH := external/strongswan-support/vstr/include | |
48 | libgmp_PATH := external/strongswan-support/gmp | |
1be32988 | 49 | |
eae49aff TB |
50 | # some definitions |
51 | strongswan_VERSION := "@PACKAGE_VERSION@" | |
52 | strongswan_DIR := "/system/bin" | |
53 | strongswan_SBINDIR := "/system/bin" | |
54 | strongswan_PIDDIR := "/data/misc/vpn" | |
55 | strongswan_PLUGINDIR := "$(strongswan_IPSEC_DIR)/ipsec" | |
56 | strongswan_CONFDIR := "/system/etc" | |
57 | strongswan_STRONGSWAN_CONF := "$(strongswan_CONFDIR)/strongswan.conf" | |
58 | ||
1be32988 TB |
59 | # CFLAGS (partially from a configure run using droid-gcc) |
60 | strongswan_CFLAGS := \ | |
61 | -Wno-format \ | |
62 | -Wno-pointer-sign \ | |
f9622e8c | 63 | -Wno-pointer-arith \ |
1be32988 TB |
64 | -Wno-sign-compare \ |
65 | -Wno-strict-aliasing \ | |
66 | -DHAVE___BOOL \ | |
67 | -DHAVE_STDBOOL_H \ | |
68 | -DHAVE_ALLOCA_H \ | |
69 | -DHAVE_ALLOCA \ | |
70 | -DHAVE_CLOCK_GETTIME \ | |
71 | -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \ | |
72 | -DHAVE_PRCTL \ | |
73 | -DHAVE_LINUX_UDP_H \ | |
74 | -DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \ | |
75 | -DHAVE_IPSEC_MODE_BEET \ | |
76 | -DHAVE_IPSEC_DIR_FWD \ | |
61c950d9 TB |
77 | -DOPENSSL_NO_EC \ |
78 | -DOPENSSL_NO_ECDSA \ | |
79 | -DOPENSSL_NO_ECDH \ | |
80 | -DOPENSSL_NO_ENGINE \ | |
946be4d3 TB |
81 | -DCAPABILITIES \ |
82 | -DCAPABILITIES_NATIVE \ | |
1be32988 TB |
83 | -DMONOLITHIC \ |
84 | -DUSE_VSTR \ | |
b66a3b3d | 85 | -DDEBUG \ |
1be32988 TB |
86 | -DROUTING_TABLE=0 \ |
87 | -DROUTING_TABLE_PRIO=220 \ | |
eae49aff | 88 | -DVERSION=\"$(strongswan_VERSION)\" \ |
eae49aff TB |
89 | -DPLUGINDIR=\"$(strongswan_PLUGINDIR)\" \ |
90 | -DIPSEC_DIR=\"$(strongswan_DIR)\" \ | |
91 | -DIPSEC_PIDDIR=\"$(strongswan_PIDDIR)\" \ | |
92 | -DIPSEC_CONFDIR=\"$(strongswan_CONFDIR)\" \ | |
93 | -DSTRONGSWAN_CONF=\"$(strongswan_STRONGSWAN_CONF)\" \ | |
1be32988 TB |
94 | -DDEV_RANDOM=\"/dev/random\" \ |
95 | -DDEV_URANDOM=\"/dev/urandom\" | |
96 | ||
97 | # only for Android 2.0+ | |
98 | strongswan_CFLAGS += \ | |
99 | -DHAVE_IN6ADDR_ANY | |
100 | ||
1cde0a51 TB |
101 | strongswan_BUILD := \ |
102 | charon \ | |
103 | libcharon \ | |
104 | libhydra \ | |
105 | libstrongswan \ | |
106 | libtncif | |
107 | ||
108 | ifneq ($(strongswan_BUILD_STARTER),) | |
109 | strongswan_BUILD += \ | |
110 | libfreeswan \ | |
111 | starter \ | |
112 | stroke \ | |
113 | ipsec | |
114 | endif | |
115 | ||
116 | ifneq ($(strongswan_BUILD_PLUTO),) | |
117 | strongswan_BUILD += \ | |
118 | libfreeswan \ | |
119 | pluto \ | |
120 | whack | |
121 | endif | |
122 | ||
1be32988 | 123 | include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \ |
1cde0a51 | 124 | $(sort $(strongswan_BUILD)))) |