aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2016-01-26 17:23:02 +0100
committerTobias Brunner <tobias@strongswan.org>2016-03-23 14:18:37 +0100
commit17e36cd48cbb7a17c7ea0ee48cbf87d30da103ba (patch)
tree3ad46dc6f717c94de2a441b45f38b12aa50450a2
parentab88f22f7888d2df7fc7f632b4c96fb94c903790 (diff)
downloadstrongswan-17e36cd48cbb7a17c7ea0ee48cbf87d30da103ba.tar.bz2
strongswan-17e36cd48cbb7a17c7ea0ee48cbf87d30da103ba.tar.xz
android: Enable build against API level 21
While building against this level in general would break our app on older systems, the NDK will automatically use this level for 64-bit ABI builds (which are not supported in older levels). So to build against 64-bit ABIs we have to support this API level.
-rw-r--r--Android.mk1
-rw-r--r--src/frontends/android/app/src/main/jni/Android.mk1
-rw-r--r--src/libstrongswan/utils/compat/android.h17
3 files changed, 17 insertions, 2 deletions
diff --git a/Android.mk b/Android.mk
index f17289ea0..840cc14cf 100644
--- a/Android.mk
+++ b/Android.mk
@@ -61,7 +61,6 @@ strongswan_CFLAGS := \
-DHAVE_ALLOCA \
-DHAVE_CLOCK_GETTIME \
-DHAVE_DLADDR \
- -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \
-DHAVE_PRCTL \
-DHAVE_LINUX_UDP_H \
-DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \
diff --git a/src/frontends/android/app/src/main/jni/Android.mk b/src/frontends/android/app/src/main/jni/Android.mk
index b295320f4..39620aa42 100644
--- a/src/frontends/android/app/src/main/jni/Android.mk
+++ b/src/frontends/android/app/src/main/jni/Android.mk
@@ -39,7 +39,6 @@ strongswan_CFLAGS := \
-DHAVE_ALLOCA \
-DHAVE_CLOCK_GETTIME \
-DHAVE_DLADDR \
- -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \
-DHAVE_PRCTL \
-DHAVE_LINUX_UDP_H \
-DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \
diff --git a/src/libstrongswan/utils/compat/android.h b/src/libstrongswan/utils/compat/android.h
index b3ea9c475..6edd3effb 100644
--- a/src/libstrongswan/utils/compat/android.h
+++ b/src/libstrongswan/utils/compat/android.h
@@ -21,6 +21,8 @@
#ifndef ANDROID_H_
#define ANDROID_H_
+#include <android/api-level.h>
+
/* stuff defined in AndroidConfig.h, which is included using the -include
* command-line option, thus cannot be undefined using -U CFLAGS options.
* the reason we have to undefine these flags in the first place, is that
@@ -28,4 +30,19 @@
* actually defined. */
#undef HAVE_BACKTRACE
+/* API level 21 changed quite a few things, we define some stuff here and not
+ * via CFLAGS in Android.mk files as it is easier to compare versions */
+#if __ANDROID_API__ >= 21
+
+#define HAVE_PTHREAD_CONDATTR_INIT 1
+#define HAVE_CONDATTR_CLOCK_MONOTONIC 1
+
+#define HAVE_SYS_CAPABILITY_H 1
+
+#else /* __ANDROID_API__ */
+
+#define HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC 1
+
+#endif /* __ANDROID_API__ */
+
#endif /** ANDROID_H_ @}*/