summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-06-04 14:32:25 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-06-04 14:32:25 +0800
commit4d76449e7f45d125b8427e63e06d733ee73a84c4 (patch)
tree4f7eaa14aaeb82957e931f547c409e9f4a22b38e
parent4195a7f93387a60fb3c8a37d7a14189728a57e7b (diff)
Android configure wrappers
-rwxr-xr-xaarch64-linux-android-configure9
-rwxr-xr-xarm-linux-androideabi-configure10
-rw-r--r--request.h15
3 files changed, 26 insertions, 8 deletions
diff --git a/aarch64-linux-android-configure b/aarch64-linux-android-configure
new file mode 100755
index 0000000..8690ece
--- /dev/null
+++ b/aarch64-linux-android-configure
@@ -0,0 +1,9 @@
+#!/bin/sh
+export TOOLCHAIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64
+export TARGET=aarch64-linux-android
+export API=21
+export CC=$TOOLCHAIN/bin/$TARGET$API-clang
+export PREFIX=$TOOLCHAIN/sysroot/usr
+export CPPFLAGS="$CPPFLAGS -DDEBUG"
+export CFLAGS="$CFLAGS -g"
+./configure --host=$TARGET --prefix=$PREFIX --libdir=$PREFIX/lib/$TARGET/$API --disable-static
diff --git a/arm-linux-androideabi-configure b/arm-linux-androideabi-configure
new file mode 100755
index 0000000..20d62ec
--- /dev/null
+++ b/arm-linux-androideabi-configure
@@ -0,0 +1,10 @@
+#!/bin/sh
+export TOOLCHAIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64
+export TARGET=armv7a-linux-androideabi
+export API=16
+export CC=$TOOLCHAIN/bin/$TARGET$API-clang
+export TARGET=arm-linux-androideabi
+export PREFIX=$TOOLCHAIN/sysroot/usr
+export CPPFLAGS="$CPPFLAGS -DDEBUG"
+export CFLAGS="$CFLAGS -g"
+./configure --host=$TARGET --prefix=$PREFIX --libdir=$PREFIX/lib/$TARGET/$API --disable-static
diff --git a/request.h b/request.h
index 1d15b6a..a943687 100644
--- a/request.h
+++ b/request.h
@@ -1,7 +1,7 @@
#ifndef ICCLIENT_REQUEST_H
#define ICCLIENT_REQUEST_H
-#if defined(ANDROID) && defined(DEBUG)
+#if defined __ANDROID__ && defined DEBUG
#include <android/log.h>
#endif
#include <string.h>
@@ -77,19 +77,18 @@ inline void request(size_t (*writefunction)(void *, size_t, size_t, void *),
#ifdef DEBUG
CURLcode res =
-#endif // DEBUG
+#endif
curl_easy_perform(curl);
#ifdef DEBUG
if (res != CURLE_OK) {
const char *error = curl_easy_strerror(res);
-#ifdef ANDROID
- __android_log_print(ANDROID_LOG_ERROR, "libicclient", "%s: %s", __func__,
- error);
+#ifdef __ANDROID__
+ __android_log_print(ANDROID_LOG_ERROR, "libicclient.so", "%s: %s", __func__, error);
#else
fprintf(stderr, "%s: %s\n", __func__, error);
-#endif // ANDROID
+#endif
}
-#endif // DEBUG
+#endif
}
-#endif // ICCLIENT_REQUEST_H
+#endif