]> git.ipfire.org Git - thirdparty/strongswan.git/blob - Android.mk.in
share some code between IMC and IMV managers
[thirdparty/strongswan.git] / Android.mk.in
1 LOCAL_PATH := $(call my-dir)
2 include $(CLEAR_VARS)
3
4 # whether starter is built. allows to control the daemons from the command line
5 strongswan_BUILD_STARTER := true
6
7 # whether pluto (IKEv1 daemon) is built. charon (IKEv2) is always enabled
8 strongswan_BUILD_PLUTO := true
9
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
15
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
23 endif
24
25 strongswan_STARTER_PLUGINS := kernel-netlink
26
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))
31
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)/%,%, \
37 $(wildcard \
38 $(subst %,$(subst -,_,$(strip $(1))), \
39 $(LOCAL_PATH)/plugins/%/%*.c \
40 ) \
41 ) \
42 ) \
43 )
44
45 # includes
46 strongswan_PATH := $(LOCAL_PATH)
47 libvstr_PATH := external/strongswan-support/vstr/include
48 libgmp_PATH := external/strongswan-support/gmp
49
50 # some definitions
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"
58
59 # CFLAGS (partially from a configure run using droid-gcc)
60 strongswan_CFLAGS := \
61 -Wno-format \
62 -Wno-pointer-sign \
63 -Wno-pointer-arith \
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 \
77 -DOPENSSL_NO_EC \
78 -DOPENSSL_NO_ECDSA \
79 -DOPENSSL_NO_ECDH \
80 -DOPENSSL_NO_ENGINE \
81 -DCAPABILITIES \
82 -DCAPABILITIES_NATIVE \
83 -DMONOLITHIC \
84 -DUSE_VSTR \
85 -DDEBUG \
86 -DROUTING_TABLE=0 \
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\"
96
97 # only for Android 2.0+
98 strongswan_CFLAGS += \
99 -DHAVE_IN6ADDR_ANY
100
101 strongswan_BUILD := \
102 charon \
103 libcharon \
104 libhydra \
105 libstrongswan \
106 libtncif
107
108 ifneq ($(strongswan_BUILD_STARTER),)
109 strongswan_BUILD += \
110 libfreeswan \
111 starter \
112 stroke \
113 ipsec
114 endif
115
116 ifneq ($(strongswan_BUILD_PLUTO),)
117 strongswan_BUILD += \
118 libfreeswan \
119 pluto \
120 whack
121 endif
122
123 include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
124 $(sort $(strongswan_BUILD))))