[vlc-devel] [PATCH] configure.ac: check newlocale against android_support

Alexandre Janniaux ajanni at videolabs.io
Fri May 8 13:35:42 CEST 2020


Android has uselocale through libandroid_support, which depends on
libc++abi for new/delete operators as being a C++ library.
---
 configure.ac | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 10ce6501eaf..0a01062b620 100644
--- a/configure.ac
+++ b/configure.ac
@@ -675,8 +675,15 @@ VLC_LIBRARY_SUFFIX
 dnl Check for system libs needed
 need_libc=false
 
+dnl Android has uselocale through Android support on API < 21
+AC_SEARCH_LIBS([uselocale], [android_support], [
+  AS_IF([test "$ac_cv_search_newlocale" = "-landroid_support"], [
+    AX_APPEND_FLAG([-landroid_support -lc++abi], [LDFLAGS]) ])
+  AC_DEFINE([HAVE_USELOCALE], [1], [Define if uselocale() is available.])
+],,[-lc++abi])
+
 dnl Check for usual libc functions
-AC_CHECK_FUNCS([accept4 fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
+AC_CHECK_FUNCS([accept4 fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime])
 AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lfind lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
 AC_REPLACE_FUNCS([gettimeofday])
 AC_CHECK_FUNC(fdatasync,,
-- 
2.26.2



More information about the vlc-devel mailing list