libandroid-posix-semaphore: pass PREFIX as compiler flag
This commit is contained in:
parent
b26410dd57
commit
a67899c977
@ -7,7 +7,8 @@ TERMUX_PKG_SKIP_SRC_EXTRACT=true
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
|
||||
termux_step_make() {
|
||||
$CC $CFLAGS $CPPFLAGS -I$TERMUX_PKG_BUILDER_DIR -c $TERMUX_PKG_BUILDER_DIR/semaphore.c
|
||||
$CC $CFLAGS $CPPFLAGS -DPREFIX="\"$TERMUX_PREFIX\"" \
|
||||
-c $TERMUX_PKG_BUILDER_DIR/semaphore.c
|
||||
$CC $LDFLAGS -shared semaphore.o -o libandroid-posix-semaphore.so
|
||||
$AR rcu libandroid-posix-semaphore.a semaphore.o
|
||||
cp -f $TERMUX_PKG_BUILDER_DIR/LICENSE $TERMUX_PKG_SRCDIR/
|
||||
|
@ -43,6 +43,10 @@
|
||||
#define SEM_NSEMS_MAX 256
|
||||
#endif // !SEM_NSEMS_MAX
|
||||
|
||||
#ifndef PREFIX
|
||||
#define PREFIX "/data/data/com.termux/files/usr"
|
||||
#endif
|
||||
|
||||
static __inline__ char *__strchrnul(const char *s, int c)
|
||||
{
|
||||
c = (unsigned char)c;
|
||||
@ -78,7 +82,7 @@ static char *__sem_mapname(const char *name, char *buf)
|
||||
errno = ENAMETOOLONG;
|
||||
return 0;
|
||||
}
|
||||
memcpy(buf, "/data/data/com.termux/files/usr/tmp/sem.", 40);
|
||||
memcpy(buf, PREFIX"/tmp/sem.", 40);
|
||||
memcpy(buf+40, name, p-name+1);
|
||||
return buf;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user