new package: libucontext

This commit is contained in:
Tee KOBAYASHI 2022-01-13 20:31:00 +09:00 committed by Leonid Pliushch
parent 69b4c75cae
commit d79be5f640
3 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,15 @@
--- a/Makefile
+++ b/Makefile
@@ -15,9 +15,9 @@
endif
LIBDIR := /lib
-INCLUDEDIR := /usr/include
-PKGCONFIGDIR := /usr/lib/pkgconfig
-CFLAGS := -ggdb3 -O2 -Wall
+INCLUDEDIR := /include
+PKGCONFIGDIR := /lib/pkgconfig
+CFLAGS ?= -ggdb3 -O2 -Wall
CPPFLAGS := -Iinclude -Iarch/${ARCH} -Iarch/common
EXPORT_UNPREFIXED := yes
FREESTANDING := no

View File

@ -0,0 +1,53 @@
--- a/arch/common/include/libucontext/bits.h
+++ b/arch/common/include/libucontext/bits.h
@@ -3,6 +3,50 @@
#ifndef FREESTANDING
+#ifdef __ANDROID__
+
+#if defined __i386__
+# undef REG_GS
+# undef REG_FS
+# undef REG_ES
+# undef REG_DS
+# undef REG_EDI
+# undef REG_ESI
+# undef REG_EBP
+# undef REG_ESP
+# undef REG_EBX
+# undef REG_EDX
+# undef REG_ECX
+# undef REG_EAX
+# undef REG_EIP
+#elif defined __x86_64__
+# undef REG_R8
+# undef REG_R9
+# undef REG_R10
+# undef REG_R11
+# undef REG_R12
+# undef REG_R13
+# undef REG_R14
+# undef REG_R15
+# undef REG_RDI
+# undef REG_RSI
+# undef REG_RBP
+# undef REG_RBX
+# undef REG_RDX
+# undef REG_RAX
+# undef REG_RCX
+# undef REG_RSP
+# undef REG_RIP
+# undef REG_EFL
+# undef REG_CSGSFS
+# undef REG_ERR
+# undef REG_TRAPNO
+# undef REG_OLDMASK
+# undef REG_CR2
+#endif
+
+#endif /* __ANDROID__ */
+
#include <ucontext.h>
typedef greg_t libucontext_greg_t;

View File

@ -0,0 +1,17 @@
TERMUX_PKG_HOMEPAGE=https://github.com/kaniini/libucontext
TERMUX_PKG_DESCRIPTION="A library which provides the ucontext.h C API"
TERMUX_PKG_LICENSE="ISC"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.1
TERMUX_PKG_SRCURL=https://github.com/kaniini/libucontext/archive/refs/tags/libucontext-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=298201cef024aee29dfb81c3f1ef800047d5c799297651a60e2c53bb76956ea6
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_MAKE_ARGS="DESTDIR=$TERMUX_PREFIX"
termux_step_pre_configure() {
TERMUX_PKG_EXTRA_MAKE_ARGS+=" ARCH=$TERMUX_ARCH"
}
termux_step_configure() {
:
}