]> git.ipfire.org Git - thirdparty/strongswan.git/blame - Android.mk.in
Avoid SIGSEGV during shutdown if charon is not started as root
[thirdparty/strongswan.git] / Android.mk.in
CommitLineData
1be32988
TB
1LOCAL_PATH := $(call my-dir)
2include $(CLEAR_VARS)
3
2e0b478a
TB
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 daemons from the command line
fff4b74d 9# charon - the IKE daemon
1cde0a51 10
fff4b74d 11# if you enable starter (see above) uncomment this line too
2e0b478a 12# strongswan_BUILD_STARTER := true
0ad58f01 13
1be32988
TB
14# this is the list of plugins that are built into libstrongswan and charon
15# also these plugins are loaded by default (if not changed in strongswan.conf)
9227a3b3 16strongswan_CHARON_PLUGINS := openssl fips-prf random pubkey pkcs1 \
c177076b 17 pem xcbc hmac kernel-netlink socket-default android \
635724f6 18 stroke eap-identity eap-mschapv2 eap-md5
1be32988 19
bb3357e8
TB
20strongswan_STARTER_PLUGINS := kernel-netlink
21
9227a3b3
TB
22# list of all plugins - used to enable them with the function below
23strongswan_PLUGINS := $(sort $(strongswan_CHARON_PLUGINS) \
bb3357e8 24 $(strongswan_STARTER_PLUGINS))
9227a3b3 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 77 -DMONOLITHIC \
088020fb 78 -DUSE_IKEV2 \
1be32988 79 -DUSE_VSTR \
b66a3b3d 80 -DDEBUG \
1be32988
TB
81 -DROUTING_TABLE=0 \
82 -DROUTING_TABLE_PRIO=220 \
eae49aff 83 -DVERSION=\"$(strongswan_VERSION)\" \
eae49aff
TB
84 -DPLUGINDIR=\"$(strongswan_PLUGINDIR)\" \
85 -DIPSEC_DIR=\"$(strongswan_DIR)\" \
86 -DIPSEC_PIDDIR=\"$(strongswan_PIDDIR)\" \
87 -DIPSEC_CONFDIR=\"$(strongswan_CONFDIR)\" \
88 -DSTRONGSWAN_CONF=\"$(strongswan_STRONGSWAN_CONF)\" \
1be32988
TB
89 -DDEV_RANDOM=\"/dev/random\" \
90 -DDEV_URANDOM=\"/dev/urandom\"
91
92# only for Android 2.0+
93strongswan_CFLAGS += \
94 -DHAVE_IN6ADDR_ANY
95
1cde0a51
TB
96strongswan_BUILD := \
97 charon \
98 libcharon \
99 libhydra \
100 libstrongswan \
ba5b559b
TB
101 libtncif \
102 libtnccs
1cde0a51
TB
103
104ifneq ($(strongswan_BUILD_STARTER),)
105strongswan_BUILD += \
1cde0a51
TB
106 starter \
107 stroke \
108 ipsec
109endif
110
1be32988 111include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
1cde0a51 112 $(sort $(strongswan_BUILD))))