summaryrefslogtreecommitdiff
path: root/main/jni/Android.mk
blob: e33ed1c71328b6b7a0e13dd1531a8142d3d7f45f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Path of the sources
JNI_DIR := $(call my-dir)

#optional arguments
#WITH_MBEDTLS=1
#WITH_OPENVPN3=1
# Build openvpn with mbedTLS (OpenVPN3 core is always build with mbedTLS)
#USE_BREAKPAD=0

include lzo/Android.mk
include openssl/Android.mk

ifeq ($(TARGET_ARCH),mips)
	WITH_BREAKPAD=0
else ifeq ($(TARGET_ARCH),mips64)
	WITH_BREAKPAD=0
else ifeq ($(USE_BREAKPAD),1)
	WITH_BREAKPAD=1
else
	WITH_BREAKPAD=0
endif

#ifeq ($(TARGET_ARCH),x86)
#	USE_BREAKPAD=0
#endif


ifeq ($(WITH_BREAKPAD),1)
	include breakpad/android/google_breakpad/Android.mk
endif

ifeq ($(WITH_MBEDTLS),1)
	USE_MBEDTLS=1
endif
ifeq ($(WITH_OPENVPN3),1)
	USE_MBEDTLS=1
endif

ifeq ($(USE_MBEDTLS),1)
	include mbedtls/Android.mk
endif

include openvpn/Android.mk

ifeq ($(WITH_OPENVPN3),1)
	include ovpn3/Android.mk
endif

LOCAL_PATH := $(JNI_DIR)

# The only real JNI libraries
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog  -lz
LOCAL_CFLAGS =  -DTARGET_ARCH_ABI=\"${TARGET_ARCH_ABI}\"
LOCAL_SRC_FILES:= jniglue.c  scan_ifs.c sslspeed.c
LOCAL_C_INCLUDES := openssl/include openssl/crypto openssl openssl/crypto/include
LOCAL_MODULE = opvpnutil
LOCAL_STATIC_LIBRARIES := libssl_static libcrypto_static
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog  -lz
LOCAL_CFLAGS =
LOCAL_C_INCLUDES := openssl/include openssl/crypto openssl openssl/crypto/include
LOCAL_SRC_FILES:=  jbcrypto.cpp
LOCAL_MODULE = jbcrypto
LOCAL_SHARED_LIBRARIES :=  libcrypto
include $(BUILD_SHARED_LIBRARY)


include $(CLEAR_VARS)
LOCAL_LDLIBS := -lz  -lc 
LOCAL_STATIC_LIBRARIES := libssl_static libcrypto_static openvpn
LOCAL_SRC_FILES:= minivpn.c dummy.cpp
LOCAL_MODULE = nopie_openvpn
include $(BUILD_EXECUTABLE)


include $(CLEAR_VARS)
LOCAL_LDLIBS := -lz  -lc 
LOCAL_CFLAGS= -fPIE -pie
LOCAL_LDFLAGS = -fPIE -pie
LOCAL_STATIC_LIBRARIES := libssl_static libcrypto_static openvpn
LOCAL_SRC_FILES:= minivpn.c dummy.cpp
LOCAL_MODULE = pie_openvpn
include $(BUILD_EXECUTABLE)