From d1ea38d86dfd73753b807e529014ba02e836d05e Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 5 Jan 2016 20:54:44 -0500 Subject: [PATCH] Add android-libcutils as disabled package --- disabled-packages/android-libcutils/build.sh | 30 +++++++++++++++++++ disabled-packages/android-libcutils/log.h | 31 ++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 disabled-packages/android-libcutils/build.sh create mode 100644 disabled-packages/android-libcutils/log.h diff --git a/disabled-packages/android-libcutils/build.sh b/disabled-packages/android-libcutils/build.sh new file mode 100644 index 000000000..714a12ebe --- /dev/null +++ b/disabled-packages/android-libcutils/build.sh @@ -0,0 +1,30 @@ +TERMUX_PKG_HOMEPAGE=http://elinux.org/Android_aapt +TERMUX_PKG_DESCRIPTION="Library providing common functionalities for Android related tools" +TERMUX_PKG_VERSION=6.0.1 +TERMUX_PKG_BUILD_IN_SRC=yes + +termux_step_make_install () { + local _TAGNAME=${TERMUX_PKG_VERSION}_r5 + + LIBCUTILS_TARFILE=$TERMUX_PKG_CACHEDIR/libcutils_${_TAGNAME}.tar.gz + + test ! -f $LIBCUTILS_TARFILE && curl -o $LIBCUTILS_TARFILE "https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/libcutils.tar.gz" + + # https://android.googlesource.com/platform/system/core/+/android-4.4.4_r2/include/cutils/ + LIBCUTILS_INCLUDE_TARFILE=$TERMUX_PKG_CACHEDIR/libcutils_include_${_TAGNAME}.tar.gz + test ! -f $LIBCUTILS_INCLUDE_TARFILE && curl -o $LIBCUTILS_INCLUDE_TARFILE \ + "https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/include/cutils.tar.gz" + + mkdir -p libcutils include/{cutils,log} + tar xf $LIBCUTILS_INCLUDE_TARFILE -C include/cutils + + cp $TERMUX_PKG_BUILDER_DIR/log.h include/log/ + cp $TERMUX_PKG_BUILDER_DIR/log.h include/cutils/ + + cp -Rf include/cutils $TERMUX_PREFIX/include/cutils + + cd libcutils + tar xf $LIBCUTILS_TARFILE + rm dlmalloc_stubs.c ashmem-host.c properties.c fs_config.c trace-*.c + $CC -isystem $TERMUX_PKG_SRCDIR/include *.c -shared -o $TERMUX_PREFIX/lib/libcutils.so +} diff --git a/disabled-packages/android-libcutils/log.h b/disabled-packages/android-libcutils/log.h new file mode 100644 index 000000000..d6385a789 --- /dev/null +++ b/disabled-packages/android-libcutils/log.h @@ -0,0 +1,31 @@ +#include +#include +#include +#include + +/* https://android.googlesource.com/platform/system/core/+/android-4.4.4_r2/include/log/log.h */ + +#define QUOTEME_(x) #x +#define QUOTEME(x) QUOTEME_(x) + +#define ALOGV(...) printf("VERBOSE (" __FILE__ ":" QUOTEME(__LINE__) "): " __VA_ARGS__) +#define ALOGD(...) printf("DEBUG (" __FILE__ ":" QUOTEME(__LINE__) "): " __VA_ARGS__) +#define ALOGI(...) printf("INFO (" __FILE__ ":" QUOTEME(__LINE__) "): " __VA_ARGS__) +#define ALOGW(...) printf("WARNING (" __FILE__ ":" QUOTEME(__LINE__) "): " __VA_ARGS__) +#define ALOGE(...) printf("ERROR (" __FILE__ ":" QUOTEME(__LINE__) "): " __VA_ARGS__) + +#define HAL_PRIORITY_URGENT_DISPLAY ANDROID_LOG_INFO + +#define LOG_FATAL_IF(...) +#define LOG_ALWAYS_FATAL(...) +#define LOG_ALWAYS_FATAL_IF(...) +#define LOG_PRI(...) + +#define ALOGW_IF(...) + +#define android_printAssert(cond, tag, fmt...) +#define ALOG_ASSERT(...) + +#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) + +#define OS_PATH_SEPARATOR '/'