* m4/gnulib-common.m4 (gl_CHECK_FUNCS_ANDROID): New macro.
* m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Use
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/freading.m4 (gl_FUNC_FREADING): Likewise.
* m4/fseterr.m4 (gl_FUNC_FSETERR): Likewise.
* m4/fwriting.m4 (gl_FUNC_FWRITING): Likewise.
* m4/getentropy.m4 (gl_FUNC_GETENTROPY): Likewise.
* m4/getlogin_r.m4 (gl_CHECK_FUNCS_ANDROID): Likewise.
* m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise.
* m4/glob.m4 (gl_PREREQ_GLOB): Likewise.
* m4/spawn_h.m4 (gl_HAVE_POSIX_SPAWN): Likewise.
* doc/glibc-functions/getentropy.texi: Mark function as existing in
Android 9.0.
* doc/glibc-functions/getrandom.texi: Likewise.
* doc/posix-functions/pthread_attr_getinheritsched.texi: Likewise.
* doc/posix-functions/pthread_attr_setinheritsched.texi: Likewise.
+2023-01-05 Bruno Haible <bruno@clisp.org>
+
+ Recognize functions added in future versions of Android.
+ * m4/gnulib-common.m4 (gl_CHECK_FUNCS_ANDROID): New macro.
+ * m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Use
+ gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+ * m4/freading.m4 (gl_FUNC_FREADING): Likewise.
+ * m4/fseterr.m4 (gl_FUNC_FSETERR): Likewise.
+ * m4/fwriting.m4 (gl_FUNC_FWRITING): Likewise.
+ * m4/getentropy.m4 (gl_FUNC_GETENTROPY): Likewise.
+ * m4/getlogin_r.m4 (gl_CHECK_FUNCS_ANDROID): Likewise.
+ * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise.
+ * m4/glob.m4 (gl_PREREQ_GLOB): Likewise.
+ * m4/spawn_h.m4 (gl_HAVE_POSIX_SPAWN): Likewise.
+ * doc/glibc-functions/getentropy.texi: Mark function as existing in
+ Android 9.0.
+ * doc/glibc-functions/getrandom.texi: Likewise.
+ * doc/posix-functions/pthread_attr_getinheritsched.texi: Likewise.
+ * doc/posix-functions/pthread_attr_setinheritsched.texi: Likewise.
+
2023-01-05 Bruno Haible <bruno@clisp.org>
copy-file, supersede: Fix link-time requirements.
@itemize
@item
This function is missing on some platforms:
-glibc 2.24, Mac OS X 10.11, FreeBSD 11.0, NetBSD 9.0, OpenBSD 5.5, Minix 3.3, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.0, Cygwin 1.7.x, mingw, MSVC 14, Android 9.0.
+glibc 2.24, Mac OS X 10.11, FreeBSD 11.0, NetBSD 9.0, OpenBSD 5.5, Minix 3.3, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.0, Cygwin 1.7.x, mingw, MSVC 14, Android 8.1.
@item
This function is declared in @code{<sys/random.h>}, not in @code{<unistd.h>},
on some platforms:
@itemize
@item
This function is missing on some platforms:
-glibc 2.24, macOS 11.1, FreeBSD 11.0, NetBSD 9.0, OpenBSD 6.7, Minix 3.3, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.0, Cygwin 1.7.x, mingw, MSVC 14, Android 9.0.
+glibc 2.24, macOS 11.1, FreeBSD 11.0, NetBSD 9.0, OpenBSD 6.7, Minix 3.3, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.0, Cygwin 1.7.x, mingw, MSVC 14, Android 8.1.
@item
This function has a different return type on some platforms:
Solaris 11.4.
@itemize
@item
This function is missing on some platforms:
-Minix 3.1.8, mingw, MSVC 14, Android 9.0.
+Minix 3.1.8, mingw, MSVC 14, Android 8.1.
@end itemize
@itemize
@item
This function is missing on some platforms:
-Minix 3.1.8, mingw, MSVC 14, Android 9.0.
+Minix 3.1.8, mingw, MSVC 14, Android 8.1.
@end itemize
-# aligned_alloc.m4 serial 3
+# aligned_alloc.m4 serial 4
dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl Persuade glibc and OpenBSD <stdlib.h> to declare aligned_alloc().
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_FUNCS_ONCE([aligned_alloc])
+ gl_CHECK_FUNCS_ANDROID([aligned_alloc], [[#include <stdlib.h>]])
if test $ac_cv_func_aligned_alloc = yes; then
dnl On macOS 11.1 and AIX 7.2, aligned_alloc returns NULL when the alignment
dnl argument is smaller than sizeof (void *).
-# freading.m4 serial 2
+# freading.m4 serial 3
dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_FREADING],
[
AC_CHECK_HEADERS_ONCE([stdio_ext.h])
- AC_CHECK_FUNCS_ONCE([__freading])
+ gl_CHECK_FUNCS_ANDROID([__freading],
+ [[#include <stdio.h>
+ #include <stdio_ext.h>
+ ]])
])
-# fseterr.m4 serial 1
+# fseterr.m4 serial 2
dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_FSETERR],
[
- AC_CHECK_FUNCS_ONCE([__fseterr])
+ gl_CHECK_FUNCS_ANDROID([__fseterr],
+ [[#include <stdio.h>
+ #include <stdio_ext.h>
+ ]])
])
-# fwriting.m4 serial 3
+# fwriting.m4 serial 4
dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_FWRITING],
[
AC_CHECK_HEADERS_ONCE([stdio_ext.h])
- AC_CHECK_FUNCS_ONCE([__fwriting])
+ gl_CHECK_FUNCS_ANDROID([__fwriting],
+ [[#include <stdio.h>
+ #include <stdio_ext.h>
+ ]])
])
-# getentropy.m4
+# getentropy.m4 serial 2
dnl Copyright 2020-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_GETENTROPY],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([getentropy])
+ gl_CHECK_FUNCS_ANDROID([getentropy],
+ [[#include <unistd.h>
+ /* Additional includes are needed before <sys/random.h> on uClibc
+ and Mac OS X. */
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <sys/random.h>
+ ]])
if test $ac_cv_func_getentropy = no; then
HAVE_GETENTROPY=0
fi
-#serial 13
+#serial 14
# Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
#
HAVE_DECL_GETLOGIN_R=0
fi
- AC_CHECK_FUNCS_ONCE([getlogin_r])
+ gl_CHECK_FUNCS_ANDROID([getlogin_r], [[#include <unistd.h>]])
if test $ac_cv_func_getlogin_r = no; then
HAVE_GETLOGIN_R=0
else
-# getrandom.m4 serial 8
+# getrandom.m4 serial 9
dnl Copyright 2020-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_GETRANDOM],
[
AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([getrandom])
+ gl_CHECK_FUNCS_ANDROID([getrandom],
+ [[/* Additional includes are needed before <sys/random.h> on uClibc
+ and Mac OS X. */
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <sys/random.h>
+ ]])
if test "$ac_cv_func_getrandom" != yes; then
HAVE_GETRANDOM=0
else
-# glob.m4 serial 26
+# glob.m4 serial 27
dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
AC_CHECK_HEADERS_ONCE([unistd.h])
- AC_CHECK_FUNCS_ONCE([getlogin_r getpwnam_r])
+ gl_CHECK_FUNCS_ANDROID([getlogin_r], [[#include <unistd.h>]])
+ AC_CHECK_FUNCS_ONCE([getpwnam_r])
])
-# gnulib-common.m4 serial 75
+# gnulib-common.m4 serial 76
dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
m4_popdef([gl_header_name])
])
+dnl gl_CHECK_FUNCS_ANDROID([func], [[#include <foo.h>]])
+dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem
+dnl on Android.
+dnl Namely, if func was added to Android API level, say, 28, then the libc.so
+dnl has the symbol func always, whereas the header file <foo.h> declares func
+dnl conditionally:
+dnl #if __ANDROID_API__ >= 28
+dnl ... func (...) __INTRODUCED_IN(28);
+dnl #endif
+dnl Thus, when compiling with "clang -target armv7a-unknown-linux-android28",
+dnl the function func is declared and exists in libc.
+dnl Whereas when compiling with "clang -target armv7a-unknown-linux-android27",
+dnl the function func is not declared but exists in libc. We need to treat this
+dnl case like the case where func does not exist.
+AC_DEFUN([gl_CHECK_FUNCS_ANDROID],
+[
+ AC_CHECK_DECL([$1], , , [$2])
+ if test $ac_cv_have_decl_[$1] = yes; then
+ AC_CHECK_FUNCS([$1])
+ else
+ ac_cv_func_[$1]=no
+ fi
+])
+
dnl Expands to some code for use in .c programs that, on native Windows, defines
dnl the Microsoft deprecated alias function names to the underscore-prefixed
dnl actual function names. With this macro, these function names are available
-# spawn_h.m4 serial 21
+# spawn_h.m4 serial 22
dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_SEARCH_LIBS([posix_spawn], [rt],
[test "$ac_cv_search_posix_spawn" = "none required" ||
LIB_POSIX_SPAWN=$ac_cv_search_posix_spawn])
- AC_CHECK_FUNCS([posix_spawn])
+ gl_CHECK_FUNCS_ANDROID([posix_spawn], [[#include <spawn.h>]])
LIBS=$gl_saved_libs
if test $ac_cv_func_posix_spawn != yes; then