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