]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Enable build against API level 21
authorTobias Brunner <tobias@strongswan.org>
Tue, 26 Jan 2016 16:23:02 +0000 (17:23 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 23 Mar 2016 13:18:37 +0000 (14:18 +0100)
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.

Android.mk
src/frontends/android/app/src/main/jni/Android.mk
src/libstrongswan/utils/compat/android.h

index f17289ea0502c1de87fa9b49cf9a9f1cc13004b8..840cc14cfd9ba820cc1a484afbad2202de71daba 100644 (file)
@@ -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 \
index b295320f4d71efb08a0aa1ee39af54d01a3c974f..39620aa420e9674820908495db65eb843a4aa143 100644 (file)
@@ -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 \
index b3ea9c475795b058010393d48058a2d69a9d6f30..6edd3effb57d886f29e6fd8a2cf443d324f9cf80 100644 (file)
@@ -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
  * 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_ @}*/