contrib: zvbi: fix Android usage of pthread

- pthread_create is not detected properly with the NDK26.
- pthread_cancel is called but it's not supported by Android, it's probably dead code that is removed during linking
This commit is contained in:
Steve Lhomme 2024-04-10 15:37:10 +02:00
parent 5858d5c2fc
commit 848b0f08c1
1 changed files with 7 additions and 0 deletions

View File

@ -27,6 +27,8 @@ endif
ifdef HAVE_ANDROID
$(APPLY) $(SRC)/zvbi/zvbi-android.patch
endif
# check for pthread_create in pthreads as well
sed -i.orig "s/AC_CHECK_LIB(pthread, pthread_create,,/AC_SEARCH_LIBS([pthread_create], [pthread pthreads],,/" $(UNPACK_DIR)/configure.in
$(MOVE)
DEPS_zvbi = png $(DEPS_png) iconv $(DEPS_iconv)
@ -36,6 +38,11 @@ ZVBICONF := \
--disable-nls --disable-proxy \
--without-doxygen
ifdef HAVE_ANDROID
# discard bogus pthread_cancel calls
ZVBICONF += CFLAGS="$(CFLAGS) -Wno-implicit-function-declaration"
endif
ifdef HAVE_WIN32
DEPS_zvbi += winpthreads $(DEPS_winpthreads)
endif