efb4f42cf226678382dcee3e79ca7e01b1edbb10
[strongswan.git] / Android.mk.in
1 LOCAL_PATH := $(call my-dir)
2 include $(CLEAR_VARS)
3
4 # this is the list of plugins that are built into libstrongswan and charon
5 # also these plugins are loaded by default (if not changed in strongswan.conf)
6 strongswan_CHARON_PLUGINS := openssl fips-prf random pubkey pkcs1 \
7 pem xcbc hmac kernel-netlink socket-default android \
8 stroke eap-identity eap-mschapv2 eap-md5
9
10 # plugins loaded by pluto
11 strongswan_PLUTO_PLUGINS := openssl fips-prf random pubkey pkcs1 \
12 pem xcbc hmac kernel-netlink xauth
13
14 # list of all plugins - used to enable them with the function below
15 strongswan_PLUGINS := $(sort $(strongswan_CHARON_PLUGINS) \
16 $(strongswan_PLUTO_PLUGINS))
17
18 # helper macros to only add source files for plugins included in the list above
19 # source files are relative to the android.mk that called the macro
20 plugin_enabled = $(findstring $(1), $(strongswan_PLUGINS))
21 add_plugin = $(if $(call plugin_enabled,$(1)), \
22 $(patsubst $(LOCAL_PATH)/%,%, \
23 $(wildcard \
24 $(subst %,$(subst -,_,$(strip $(1))), \
25 $(LOCAL_PATH)/plugins/%/%*.c \
26 ) \
27 ) \
28 ) \
29 )
30
31 # includes
32 strongswan_PATH := $(LOCAL_PATH)
33 libvstr_PATH := external/strongswan-support/vstr/include
34 libgmp_PATH := external/strongswan-support/gmp
35
36 # some definitions
37 strongswan_VERSION := "@PACKAGE_VERSION@"
38 strongswan_DIR := "/system/bin"
39 strongswan_SBINDIR := "/system/bin"
40 strongswan_PIDDIR := "/data/misc/vpn"
41 strongswan_PLUGINDIR := "$(strongswan_IPSEC_DIR)/ipsec"
42 strongswan_CONFDIR := "/system/etc"
43 strongswan_STRONGSWAN_CONF := "$(strongswan_CONFDIR)/strongswan.conf"
44
45 # CFLAGS (partially from a configure run using droid-gcc)
46 strongswan_CFLAGS := \
47 -Wno-format \
48 -Wno-pointer-sign \
49 -Wno-pointer-arith \
50 -Wno-sign-compare \
51 -Wno-strict-aliasing \
52 -DHAVE___BOOL \
53 -DHAVE_STDBOOL_H \
54 -DHAVE_ALLOCA_H \
55 -DHAVE_ALLOCA \
56 -DHAVE_CLOCK_GETTIME \
57 -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \
58 -DHAVE_PRCTL \
59 -DHAVE_LINUX_UDP_H \
60 -DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \
61 -DHAVE_IPSEC_MODE_BEET \
62 -DHAVE_IPSEC_DIR_FWD \
63 -DOPENSSL_NO_EC \
64 -DOPENSSL_NO_ECDSA \
65 -DOPENSSL_NO_ECDH \
66 -DOPENSSL_NO_ENGINE \
67 -DCAPABILITIES \
68 -DCAPABILITIES_NATIVE \
69 -DMONOLITHIC \
70 -DUSE_VSTR \
71 -DDEBUG \
72 -DROUTING_TABLE=0 \
73 -DROUTING_TABLE_PRIO=220 \
74 -DVERSION=\"$(strongswan_VERSION)\" \
75 -DPLUGINDIR=\"$(strongswan_PLUGINDIR)\" \
76 -DIPSEC_DIR=\"$(strongswan_DIR)\" \
77 -DIPSEC_PIDDIR=\"$(strongswan_PIDDIR)\" \
78 -DIPSEC_CONFDIR=\"$(strongswan_CONFDIR)\" \
79 -DSTRONGSWAN_CONF=\"$(strongswan_STRONGSWAN_CONF)\" \
80 -DDEV_RANDOM=\"/dev/random\" \
81 -DDEV_URANDOM=\"/dev/urandom\"
82
83 # only for Android 2.0+
84 strongswan_CFLAGS += \
85 -DHAVE_IN6ADDR_ANY
86
87 include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
88 charon \
89 libcharon \
90 libhydra \
91 libstrongswan \
92 libtncif \
93 libfreeswan \
94 pluto \
95 stroke \
96 whack \
97 starter \
98 ipsec \
99 ))