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