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