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