From f0e9663173a07bd9adf0819a1291ed0ef0ac2adc Mon Sep 17 00:00:00 2001
From: Arne Schwabe <arne@blinkt.de>
Date: Wed, 9 May 2012 12:49:20 +0200
Subject: Add tiny minivpn executable which uses the libopenvpn.so so we don't
 have to copy a big executable from assets to cache directory

---
 openvpn/Android.mk            | 22 +++++++++++++++++++++-
 openvpn/src/openvpn/jniglue.c |  4 ++++
 2 files changed, 25 insertions(+), 1 deletion(-)

(limited to 'openvpn')

diff --git a/openvpn/Android.mk b/openvpn/Android.mk
index 7884970..ca15c71 100644
--- a/openvpn/Android.mk
+++ b/openvpn/Android.mk
@@ -88,5 +88,25 @@ LOCAL_SRC_FILES:= src/openvpn/jniglue.c \
 	src/openvpn/status.c \
 	src/openvpn/tun.c 
 
-#include $(BUILD_SHARED_LIBRARY)
+include $(BUILD_SHARED_LIBRARY)
+#include $(BUILD_EXECUTABLE)
+
+
+include $(CLEAR_VARS)
+
+LOCAL_LDLIBS := -llog 
+LOCAL_SRC_FILES:= src/openvpn/jniglue.c 
+LOCAL_MODULE = opvpnutil
+include $(BUILD_SHARED_LIBRARY)
+
+
+include $(CLEAR_VARS)
+
+
+LOCAL_LDLIBS := -llog 
+LOCAL_SRC_FILES:= src/openvpn/testmain.c
+LOCAL_MODULE = minivpn
+LOCAL_SHARED_LIBRARIES=openvpn
 include $(BUILD_EXECUTABLE)
+
+
diff --git a/openvpn/src/openvpn/jniglue.c b/openvpn/src/openvpn/jniglue.c
index c79272d..b28acba 100644
--- a/openvpn/src/openvpn/jniglue.c
+++ b/openvpn/src/openvpn/jniglue.c
@@ -16,3 +16,7 @@ void android_openvpn_log(int level,const char* prefix,const char* prefix_sep,con
     __android_log_print(ANDROID_LOG_DEBUG,"openvpn","%s%s%s",prefix,prefix_sep,m1);
 }
 
+void Java_de_blinkt_openvpn_OpenVpnManagementThread_jniclose(JNIEnv *env,jobject jo, jint fd) {
+	int ret = close(fd);
+    __android_log_print(ANDROID_LOG_DEBUG,"openvpn","fd close %d %d",fd,ret);
+}
-- 
cgit v1.2.3