Fix Android build
authorDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 15 Jun 2012 12:45:13 +0000 (13:45 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 15 Jun 2012 12:45:26 +0000 (13:45 +0100)
Well, almost. My local NDK setup still fails to link because libicuuc.so
needs libgabi++.so, and even with that it has undefined references to
mbstowcs and wcstombs. But that's probably a local issue.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Android.mk
ssl.c

index a3707b1..e7dbcb2 100644 (file)
@@ -4,11 +4,12 @@ LOCAL_PATH := $(call my-dir)
 # This list comes from the following variables in the normal Makefile.am:
 # $(openconnect_SOURCES) $(libopenconnect_la_SOURCES) $(noinst_HEADERS)
 common_SRC_FILES := \
-       xml.c main.c dtls.c cstp.c mainloop.c tun.c \
-       ssl.c http.c version.c auth.c library.c \
+       xml.c main.c dtls.c cstp.c mainloop.c tun.c compat.c \
+       ssl.c http.c version.c auth.c library.c openssl.c \
        openconnect-internal.h openconnect.h
 
-common_CFLAGS += -DANDROID -DIF_TUN_HDR="<linux/if_tun.h>"
+common_CFLAGS += -DANDROID -DANDROID_KEYSTORE -DIF_TUN_HDR="<linux/if_tun.h>" \
+       -DDEFAULT_VPNCSCRIPT=NULL -DHAVE_ASPRINTF -DOPENCONNECT_OPENSSL
 
 common_C_INCLUDES += \
        $(JNI_H_INCLUDE) \
diff --git a/ssl.c b/ssl.c
index 2303b6f..32eeceb 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -34,7 +34,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <stdarg.h>
-#if defined(__linux__)
+#if defined(__linux__) || defined(ANDROID)
 #include <sys/vfs.h>
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__APPLE__)
 #include <sys/param.h>