1 LOCAL_PATH
:= $(call my-dir
)
4 # whether starter is built. allows to control the daemons from the command line
5 strongswan_BUILD_STARTER
:= true
7 # whether pluto (IKEv1 daemon) is built. charon (IKEv2) is always enabled
8 strongswan_BUILD_PLUTO
:= true
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)
12 strongswan_CHARON_PLUGINS
:= openssl fips-prf random pubkey pkcs1 \
13 pem xcbc hmac kernel-netlink socket-default android \
14 stroke eap-identity eap-mschapv2 eap-md5
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
))
20 # plugins loaded by pluto
21 strongswan_PLUTO_PLUGINS
:= openssl fips-prf random pubkey pkcs1 \
22 pem xcbc hmac kernel-netlink xauth
25 strongswan_STARTER_PLUGINS
:= kernel-netlink
27 # list of all plugins - used to enable them with the function below
28 strongswan_PLUGINS
:= $(sort $(strongswan_CHARON_PLUGINS
) \
29 $(strongswan_PLUTO_PLUGINS
) \
30 $(strongswan_STARTER_PLUGINS
))
32 # helper macros to only add source files for plugins included in the list above
33 # source files are relative to the android.mk that called the macro
34 plugin_enabled
= $(findstring $(1), $(strongswan_PLUGINS
))
35 add_plugin
= $(if
$(call plugin_enabled
,$(1)), \
36 $(patsubst $(LOCAL_PATH
)/%,%, \
38 $(subst %,$(subst -,_
,$(strip $(1))), \
39 $(LOCAL_PATH
)/plugins
/%/%*.c \
46 strongswan_PATH
:= $(LOCAL_PATH
)
47 libvstr_PATH
:= external
/strongswan-support
/vstr
/include
48 libgmp_PATH
:= external
/strongswan-support
/gmp
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"
59 # CFLAGS (partially from a configure run using droid-gcc)
60 strongswan_CFLAGS
:= \
65 -Wno-strict-aliasing \
70 -DHAVE_CLOCK_GETTIME \
71 -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \
74 -DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \
75 -DHAVE_IPSEC_MODE_BEET \
76 -DHAVE_IPSEC_DIR_FWD \
82 -DCAPABILITIES_NATIVE \
87 -DROUTING_TABLE_PRIO
=220 \
88 -DVERSION
=\"$(strongswan_VERSION
)\" \
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
)\" \
94 -DDEV_RANDOM
=\"/dev
/random
\" \
95 -DDEV_URANDOM
=\"/dev
/urandom
\"
97 # only for Android 2.0+
98 strongswan_CFLAGS
+= \
101 strongswan_BUILD
:= \
108 ifneq ($(strongswan_BUILD_STARTER
),)
109 strongswan_BUILD
+= \
116 ifneq ($(strongswan_BUILD_PLUTO
),)
117 strongswan_BUILD
+= \
123 include $(addprefix $(LOCAL_PATH
)/src
/,$(addsuffix /Android.mk
, \
124 $(sort $(strongswan_BUILD
))))