]> Savannah Git Hosting - gnulib.git/commitdiff
Fix warnings for functions introduced in Android API level 21.
authorBruno Haible <bruno@clisp.org>
Thu, 19 Jan 2023 20:55:27 +0000 (21:55 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 19 Jan 2023 20:55:27 +0000 (21:55 +0100)
* m4/_Exit.m4 (gl_FUNC__EXIT): Test for _Exit using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/c-strtod.m4 (gl_C_STRTOLD): Test for strtold_l using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/c32rtomb.m4 (gl_FUNC_C32RTOMB): Test for c32rtomb like
gl_CHECK_FUNCS_ANDROID does.
* m4/dprintf.m4 (gl_FUNC_DPRINTF): Test for dprintf using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Likewise.
* m4/dup3.m4 (gl_FUNC_DUP3): Test for dup3 using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Test for duplocale using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/execvpe.m4 (gl_FUNC_EXECVPE): Test for execvpe using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/fts.m4 (gl_FUNC_FTS_CORE): Test for fts_open using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNC.
* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Test for getprogname using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/intl-thread-locale.m4 (gt_FUNC_USELOCALE): Test for uselocale using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/iswblank.m4 (gl_FUNC_ISWBLANK): Test for iswblank using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Test for
tcdrain using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/linkat.m4 (gl_FUNC_LINKAT): Test for linkat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/localename.m4 (gl_LOCALENAME): Test for newlocale, duplocale,
freelocale using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/mbrtoc32.m4 (gl_CHECK_FUNC_MBRTOC32): Test for mbrtoc32 like
gl_CHECK_FUNCS_ANDROID does.
* m4/mbsnrtowcs.m4 (gl_FUNC_MBSNRTOWCS): Test for mbsnrtowcs using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/mbtowc.m4 (gl_FUNC_MBTOWC): Test for mbtowc using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Test for mknodat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/mountlist.m4 (gl_MOUNTLIST): Test for setmntent, endmntent using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/posix_openpt.m4 (gl_FUNC_POSIX_OPENPT): Test for posix_openpt using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/pty.m4 (gl_FUNC_OPENPTY): Test for posix_openpt using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/random.m4 (gl_FUNC_RANDOM): Test for initstate, setstate using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/stpcpy.m4 (gl_FUNC_STPCPY): Test for stpcpy using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/stpncpy.m4 (gl_FUNC_STPNCPY): Test for stpncpy using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Test for symlinkat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/truncate.m4 (gl_FUNC_TRUNCATE): Test for truncate using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Test for twalk using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
* m4/vdprintf.m4 (gl_FUNC_VDPRINTF): Test for vdprintf using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_POSIX): Likewise.
* m4/wcsnrtombs.m4 (gl_FUNC_WCSNRTOMBS): Test for wcsnrtombs using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/readlinkat.m4 (gl_FUNC_READLINKAT): Test for readlinkat using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* m4/fchmodat.m4 (gl_PREREQ_FCHMODAT): Likewise.
* modules/careadlinkat (configure.ac): Likewise.
* modules/ftoastr (configure.ac): Test for strtof using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* modules/duplocale-tests (configure.ac): Test for duplocale using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* modules/hard-locale-tests (configure.ac): Likewise.
* modules/locale-tests (configure.ac): Test for newlocale using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* modules/localename-tests (configure.ac): Likewise.
* modules/tsearch-tests (configure.ac): Test for initstate using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* modules/unistr/u8-stpcpy (configure.ac): Test for stpcpy using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.

* m4/tcgetattr.m4: New file, extracted from m4/getpass.m4.
* m4/getpass.m4 (gl_PREREQ_GETPASS): Remove code that tests for
tcgetattr. Invoke gl_HAVE_TCGETATTR instead.
* modules/getpass (Files): Add tcgetattr.m4.
* modules/getpass-gnu (Files): Add tcgetattr.m4.
* modules/term-style-control (Files): Add tcgetattr.m4.
(configure.ac): Remove code that tests for tcgetattr. Invoke
gl_HAVE_TCGETATTR instead.

47 files changed:
ChangeLog
m4/_Exit.m4
m4/c-strtod.m4
m4/c32rtomb.m4
m4/dprintf-posix.m4
m4/dprintf.m4
m4/dup3.m4
m4/duplocale.m4
m4/execvpe.m4
m4/fchmodat.m4
m4/fts.m4
m4/getpass.m4
m4/getprogname.m4
m4/intl-thread-locale.m4
m4/iswblank.m4
m4/libtextstyle-optional.m4
m4/linkat.m4
m4/localename.m4
m4/mbrtoc32.m4
m4/mbsnrtowcs.m4
m4/mbtowc.m4
m4/mkfifoat.m4
m4/mountlist.m4
m4/posix_openpt.m4
m4/pty.m4
m4/random.m4
m4/readlinkat.m4
m4/stpcpy.m4
m4/stpncpy.m4
m4/symlinkat.m4
m4/tcgetattr.m4 [new file with mode: 0644]
m4/truncate.m4
m4/tsearch.m4
m4/vdprintf-posix.m4
m4/vdprintf.m4
m4/wcsnrtombs.m4
modules/careadlinkat
modules/duplocale-tests
modules/ftoastr
modules/getpass
modules/getpass-gnu
modules/hard-locale-tests
modules/locale-tests
modules/localename-tests
modules/term-style-control
modules/tsearch-tests
modules/unistr/u8-stpcpy

index 33693bec9c2f4910305f1254d616e1c0fd01c0c8..ae2fb8c5c9f0ab4a8c26cdf859e63cddd2bd7465 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,92 @@
+2023-01-19  Bruno Haible  <bruno@clisp.org>
+
+       Fix warnings for functions introduced in Android API level 21.
+       * m4/_Exit.m4 (gl_FUNC__EXIT): Test for _Exit using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/c-strtod.m4 (gl_C_STRTOLD): Test for strtold_l using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/c32rtomb.m4 (gl_FUNC_C32RTOMB): Test for c32rtomb like
+       gl_CHECK_FUNCS_ANDROID does.
+       * m4/dprintf.m4 (gl_FUNC_DPRINTF): Test for dprintf using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Likewise.
+       * m4/dup3.m4 (gl_FUNC_DUP3): Test for dup3 using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Test for duplocale using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/execvpe.m4 (gl_FUNC_EXECVPE): Test for execvpe using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/fts.m4 (gl_FUNC_FTS_CORE): Test for fts_open using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNC.
+       * m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Test for getprogname using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/intl-thread-locale.m4 (gt_FUNC_USELOCALE): Test for uselocale using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/iswblank.m4 (gl_FUNC_ISWBLANK): Test for iswblank using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Test for
+       tcdrain using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/linkat.m4 (gl_FUNC_LINKAT): Test for linkat using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/localename.m4 (gl_LOCALENAME): Test for newlocale, duplocale,
+       freelocale using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/mbrtoc32.m4 (gl_CHECK_FUNC_MBRTOC32): Test for mbrtoc32 like
+       gl_CHECK_FUNCS_ANDROID does.
+       * m4/mbsnrtowcs.m4 (gl_FUNC_MBSNRTOWCS): Test for mbsnrtowcs using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/mbtowc.m4 (gl_FUNC_MBTOWC): Test for mbtowc using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Test for mknodat using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/mountlist.m4 (gl_MOUNTLIST): Test for setmntent, endmntent using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/posix_openpt.m4 (gl_FUNC_POSIX_OPENPT): Test for posix_openpt using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/pty.m4 (gl_FUNC_OPENPTY): Test for posix_openpt using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/random.m4 (gl_FUNC_RANDOM): Test for initstate, setstate using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/stpcpy.m4 (gl_FUNC_STPCPY): Test for stpcpy using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/stpncpy.m4 (gl_FUNC_STPNCPY): Test for stpncpy using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Test for symlinkat using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/truncate.m4 (gl_FUNC_TRUNCATE): Test for truncate using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/tsearch.m4 (gl_FUNC_TSEARCH): Test for twalk using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.
+       * m4/vdprintf.m4 (gl_FUNC_VDPRINTF): Test for vdprintf using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_POSIX): Likewise.
+       * m4/wcsnrtombs.m4 (gl_FUNC_WCSNRTOMBS): Test for wcsnrtombs using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/readlinkat.m4 (gl_FUNC_READLINKAT): Test for readlinkat using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * m4/fchmodat.m4 (gl_PREREQ_FCHMODAT): Likewise.
+       * modules/careadlinkat (configure.ac): Likewise.
+       * modules/ftoastr (configure.ac): Test for strtof using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * modules/duplocale-tests (configure.ac): Test for duplocale using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * modules/hard-locale-tests (configure.ac): Likewise.
+       * modules/locale-tests (configure.ac): Test for newlocale using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * modules/localename-tests (configure.ac): Likewise.
+       * modules/tsearch-tests (configure.ac): Test for initstate using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+       * modules/unistr/u8-stpcpy (configure.ac): Test for stpcpy using
+       gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
+
+       * m4/tcgetattr.m4: New file, extracted from m4/getpass.m4.
+       * m4/getpass.m4 (gl_PREREQ_GETPASS): Remove code that tests for
+       tcgetattr. Invoke gl_HAVE_TCGETATTR instead.
+       * modules/getpass (Files): Add tcgetattr.m4.
+       * modules/getpass-gnu (Files): Add tcgetattr.m4.
+       * modules/term-style-control (Files): Add tcgetattr.m4.
+       (configure.ac): Remove code that tests for tcgetattr. Invoke
+       gl_HAVE_TCGETATTR instead.
+
 2023-01-19  Bruno Haible  <bruno@clisp.org>
 
        Fix warnings for functions introduced in Android API level 19.
index c4cf270eff23e9ba6335619c59bedc7b980c121e..61e1f848b705b4296ed130d1aa6265875105d18e 100644 (file)
@@ -1,4 +1,4 @@
-# _Exit.m4 serial 2
+# _Exit.m4 serial 3
 dnl Copyright (C) 2010-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,
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC__EXIT],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
-  AC_CHECK_FUNCS([_Exit])
+  gl_CHECK_FUNCS_ANDROID([_Exit], [[#include <stdlib.h>]])
   if test $ac_cv_func__Exit = no; then
     HAVE__EXIT=0
   fi
index e92badad1ca65524046d3616bff07c54101b60ed..746b39bb445d866b46493cece60b73d3811bcc2a 100644 (file)
@@ -1,4 +1,4 @@
-# c-strtod.m4 serial 18
+# c-strtod.m4 serial 19
 
 # Copyright (C) 2004-2006, 2009-2023 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -47,5 +47,5 @@ AC_DEFUN([gl_C_STRTOLD],
 [
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_REQUIRE([gt_FUNC_USELOCALE])
-  AC_CHECK_FUNCS([strtold_l])
+  gl_CHECK_FUNCS_ANDROID([strtold_l], [[#include <stdlib.h>]])
 ])
index 739d21d385e28c253e548c4dd09943ae43687b95..41c07e75c992696c53bcdabb21e26e3941a8cff8 100644 (file)
@@ -1,4 +1,4 @@
-# c32rtomb.m4 serial 3
+# c32rtomb.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,
@@ -10,21 +10,27 @@ AC_DEFUN([gl_FUNC_C32RTOMB],
 
   AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
 
-  dnl We can't use AC_CHECK_FUNC here, because c32rtomb() is defined as a
-  dnl static inline function on Haiku 2020.
-  AC_CACHE_CHECK([for c32rtomb], [gl_cv_func_c32rtomb],
-    [AC_LINK_IFELSE(
-       [AC_LANG_PROGRAM(
-          [[#include <stdlib.h>
-            #include <uchar.h>
-          ]],
-          [[char buf[8];
-            return c32rtomb (buf, 0, NULL) == 0;
-          ]])
-       ],
-       [gl_cv_func_c32rtomb=yes],
-       [gl_cv_func_c32rtomb=no])
-    ])
+  dnl Cf. gl_CHECK_FUNCS_ANDROID
+  AC_CHECK_DECL([c32rtomb], , , [[#include <uchar.h>]])
+  if test $ac_cv_have_decl_c32rtomb = yes; then
+    dnl We can't use AC_CHECK_FUNC here, because c32rtomb() is defined as a
+    dnl static inline function on Haiku 2020.
+    AC_CACHE_CHECK([for c32rtomb], [gl_cv_func_c32rtomb],
+      [AC_LINK_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#include <stdlib.h>
+              #include <uchar.h>
+            ]],
+            [[char buf[8];
+              return c32rtomb (buf, 0, NULL) == 0;
+            ]])
+         ],
+         [gl_cv_func_c32rtomb=yes],
+         [gl_cv_func_c32rtomb=no])
+      ])
+  else
+    gl_cv_func_c32rtomb=no
+  fi
   if test $gl_cv_func_c32rtomb = no; then
     HAVE_C32RTOMB=0
   else
index 4efd46cc7d8cd9863b479e6849c3e14b01b40bf6..a25ef4164e81be86a9b97e19b8e7b097ac708165 100644 (file)
@@ -1,4 +1,4 @@
-# dprintf-posix.m4 serial 2
+# dprintf-posix.m4 serial 3
 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,
@@ -21,7 +21,7 @@ AC_DEFUN([gl_FUNC_DPRINTF_POSIX],
   AC_REQUIRE([gl_PRINTF_PRECISION])
   AC_REQUIRE([gl_PRINTF_ENOMEM])
   gl_cv_func_dprintf_posix=no
-  AC_CHECK_FUNCS_ONCE([dprintf])
+  gl_CHECK_FUNCS_ANDROID([dprintf], [[#include <stdio.h>]])
   if test $ac_cv_func_dprintf = yes; then
     case "$gl_cv_func_printf_sizes_c99" in
       *yes)
index 7e3ea0bbf68b02d200f8ecfda87294a28429126b..54c186620b4c2eaff5fef2613c810da5380ff3f9 100644 (file)
@@ -1,4 +1,4 @@
-# dprintf.m4 serial 1
+# dprintf.m4 serial 2
 dnl Copyright (C) 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,
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_DPRINTF],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  AC_CHECK_FUNCS_ONCE([dprintf])
+  gl_CHECK_FUNCS_ANDROID([dprintf], [[#include <stdio.h>]])
   if test $ac_cv_func_dprintf = no; then
     HAVE_DPRINTF=0
     gl_REPLACE_DPRINTF
index 93a1d7850956cb5d1f2845f2083f98a41a76a64b..644a172006dea9583a417eb1a400f2418af6fb24 100644 (file)
@@ -1,4 +1,4 @@
-# dup3.m4 serial 5
+# dup3.m4 serial 6
 dnl Copyright (C) 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,
@@ -11,7 +11,8 @@ AC_DEFUN([gl_FUNC_DUP3],
   dnl Persuade glibc <unistd.h> to declare dup3().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_CHECK_FUNCS_ONCE([dup3 setdtablesize])
+  AC_CHECK_FUNCS_ONCE([setdtablesize])
+  gl_CHECK_FUNCS_ANDROID([dup3], [[#include <unistd.h>]])
   if test $ac_cv_func_dup3 != yes; then
     HAVE_DUP3=0
   fi
index c1525e90f5b859bba5f3b8a63056b91517db5ac3..e97cf5c05589a32ed68be8478ae998ab369ee147 100644 (file)
@@ -1,4 +1,4 @@
-# duplocale.m4 serial 14
+# duplocale.m4 serial 15
 dnl Copyright (C) 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,
@@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_DUPLOCALE],
   AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
-  AC_CHECK_FUNCS_ONCE([duplocale])
+  gl_CHECK_FUNCS_ANDROID([duplocale], [[#include <locale.h>]])
   if test $ac_cv_func_duplocale = yes; then
     dnl Check against glibc bug where duplocale crashes.
     dnl See <https://sourceware.org/bugzilla/show_bug.cgi?id=10969>.
index 5ddc45d50938a9d3dcb2234554ba6cb68e52ccfc..6c0a0e9b7d5f66d2ed65a78d0e0b94adf53a56f3 100644 (file)
@@ -1,4 +1,4 @@
-# execvpe.m4 serial 1
+# execvpe.m4 serial 2
 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,
@@ -15,7 +15,7 @@ AC_DEFUN([gl_FUNC_EXECVPE],
   case "$host_os" in
     mingw*) REPLACE_EXECVPE=1 ;;
     *)
-      AC_CHECK_FUNCS([execvpe])
+      gl_CHECK_FUNCS_ANDROID([execvpe], [[#include <unistd.h>]])
       if test $ac_cv_func_execvpe != yes; then
         HAVE_EXECVPE=0
       fi
index 7a3ee863e3cd282e8e24ab1e9ea07f3ad969f0ab..5356da40bae9b4644b0f87f720a5d3cfa93c3017 100644 (file)
@@ -1,4 +1,4 @@
-# fchmodat.m4 serial 7
+# fchmodat.m4 serial 8
 dnl Copyright (C) 2004-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,
@@ -97,6 +97,6 @@ AC_DEFUN([gl_FUNC_FCHMODAT],
 # Prerequisites of lib/fchmodat.c.
 AC_DEFUN([gl_PREREQ_FCHMODAT],
 [
-  AC_CHECK_FUNCS_ONCE([readlinkat])
+  gl_CHECK_FUNCS_ANDROID([readlinkat], [[#include <unistd.h>]])
   :
 ])
index cdab461d45fddf2210a4f11627534b180b2fb8c3..eec034287cc05e29e9055d794a15750a2417d1a8 100644 (file)
--- a/m4/fts.m4
+++ b/m4/fts.m4
@@ -1,4 +1,4 @@
-#serial 22
+#serial 23
 dnl Copyright (C) 2005-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,
@@ -29,7 +29,7 @@ AC_DEFUN([gl_FUNC_FTS_CORE],
     fi
   fi
 
-  AC_CHECK_FUNC([fts_open])
+  gl_CHECK_FUNCS_ANDROID([fts_open], [[#include <fts.h>]])
   if test $ac_cv_func_fts_open = yes; then
     dnl The system already has the symbols fts_open, etc.
     dnl Avoid conflicts between these symbols and ours at the linker level.
index 2dce1e0dfe991353084e5b45995c407f364cd83e..0e46edf64b971c95a1baa45bc026e38f17b2c698 100644 (file)
@@ -1,4 +1,4 @@
-# getpass.m4 serial 18
+# getpass.m4 serial 19
 dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -64,27 +64,7 @@ AC_DEFUN([gl_PREREQ_GETPASS], [
   AC_CHECK_DECLS_ONCE([fputs_unlocked])
   AC_CHECK_DECLS_ONCE([funlockfile])
   AC_CHECK_DECLS_ONCE([putc_unlocked])
-
-  dnl We can't use AC_CHECK_FUNC here, because tcgetattr() is defined as a
-  dnl static inline function when compiling for Android 4.4 or older.
-  AC_CACHE_CHECK([for tcgetattr], [gl_cv_func_tcgetattr],
-    [AC_LINK_IFELSE(
-       [AC_LANG_PROGRAM(
-          [[#include <termios.h>
-            struct termios x;
-          ]],
-          [[return tcgetattr(0,&x);]])
-       ],
-       [gl_cv_func_tcgetattr=yes],
-       [gl_cv_func_tcgetattr=no])
-    ])
-  if test $gl_cv_func_tcgetattr = yes; then
-    HAVE_TCGETATTR=1
-  else
-    HAVE_TCGETATTR=0
-  fi
-  AC_DEFINE_UNQUOTED([HAVE_TCGETATTR], [$HAVE_TCGETATTR],
-    [Define to 1 if the system has the 'tcgetattr' function.])
+  gl_HAVE_TCGETATTR
 
   dnl We can't use AC_CHECK_FUNC here, because tcsetattr() is defined as a
   dnl static inline function when compiling for Android 4.4 or older.
index b67c527cb6042762c6a914234a7de1e700c9b7df..7c306c80a98ede23c32424b62a6e6f27a5f82eb6 100644 (file)
@@ -5,12 +5,13 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 AC_DEFUN([gl_FUNC_GETPROGNAME],
 [
-  AC_CHECK_FUNCS_ONCE([getprogname getexecname])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  gl_CHECK_FUNCS_ANDROID([getprogname], [[#include <stdlib.h>]])
+  AC_CHECK_FUNCS_ONCE([getexecname])
   ac_found=0
   AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [],
     [#include <errno.h>])
index c231899511a528cc218eee1b2c2aae2ded7cfaf2..90bc3b1aa6c392d7cea03d8e98d50f04fa598362 100644 (file)
@@ -1,4 +1,4 @@
-# intl-thread-locale.m4 serial 9
+# intl-thread-locale.m4 serial 10
 dnl Copyright (C) 2015-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,
@@ -171,7 +171,7 @@ AC_DEFUN([gt_FUNC_USELOCALE],
   dnl Persuade glibc and Solaris <locale.h> to define 'locale_t'.
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_CHECK_FUNCS_ONCE([uselocale])
+  gl_CHECK_FUNCS_ANDROID([uselocale], [[#include <locale.h>]])
 
   dnl On AIX 7.2, the uselocale() function is not documented and leads to
   dnl crashes in subsequent setlocale() invocations.
index ffb0d9bf30dff0d40dc3b947b35feb40b185525a..f3f96bb78446b54e805bbd9c488b00e8b5b525e4 100644 (file)
@@ -1,4 +1,4 @@
-# iswblank.m4 serial 5
+# iswblank.m4 serial 6
 dnl Copyright (C) 2011-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,
@@ -10,7 +10,7 @@ AC_DEFUN([gl_FUNC_ISWBLANK],
   AC_REQUIRE([gl_WCTYPE_H])
   dnl Persuade glibc <wctype.h> to declare iswblank().
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  AC_CHECK_FUNCS_ONCE([iswblank])
+  gl_CHECK_FUNCS_ANDROID([iswblank], [[#include <wctype.h>]])
   AC_CHECK_DECLS([iswblank], , , [[
     #include <wchar.h>
     #include <wctype.h>
index 93bec706294b780b187900870da58369b34c73d6..3101cf7e3abe461761ecf8ad680c5f78d19111cc 100644 (file)
@@ -1,4 +1,4 @@
-# libtextstyle-optional.m4 serial 4
+# libtextstyle-optional.m4 serial 5
 dnl Copyright (C) 2019-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,
@@ -27,7 +27,7 @@ AC_DEFUN([gl_LIBTEXTSTYLE_OPTIONAL],
   else
     GL_GENERATE_TEXTSTYLE_H=true
     AC_REQUIRE([AC_C_INLINE])
-    AC_CHECK_FUNCS_ONCE([tcdrain])
+    gl_CHECK_FUNCS_ANDROID([tcdrain], [[#include <termios.h>]])
   fi
 
   dnl Update the value of the TEXTSTYLE_H variable and the
index 29978b46080140d510f633622d336945eff9d357..9b35fc14e3bd5b321a0b5b2721261a16458c7de5 100644 (file)
@@ -1,4 +1,4 @@
-# serial 14
+# serial 15
 # See if we need to provide linkat replacement.
 
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
@@ -15,7 +15,8 @@ AC_DEFUN([gl_FUNC_LINKAT],
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CHECK_FUNCS_ONCE([linkat symlink])
+  AC_CHECK_FUNCS_ONCE([symlink])
+  gl_CHECK_FUNCS_ANDROID([linkat], [[#include <unistd.h>]])
   if test $ac_cv_func_linkat = no; then
     HAVE_LINKAT=0
   else
index 03cce480332dfa42c5e6a8d1e080c41e5cf19983..43725d8444379fdb46db467d98828ff7e9791bfb 100644 (file)
@@ -1,4 +1,4 @@
-# localename.m4 serial 8
+# localename.m4 serial 9
 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,
@@ -13,7 +13,9 @@ AC_DEFUN([gl_LOCALENAME],
   AC_REQUIRE([gt_INTL_MACOSX])
   AC_CHECK_HEADERS_ONCE([langinfo.h])
   if test $HAVE_LOCALE_T = 1; then
-    AC_CHECK_FUNCS_ONCE([newlocale duplocale freelocale])
+    gl_CHECK_FUNCS_ANDROID([newlocale], [[#include <locale.h>]])
+    gl_CHECK_FUNCS_ANDROID([duplocale], [[#include <locale.h>]])
+    gl_CHECK_FUNCS_ANDROID([freelocale], [[#include <locale.h>]])
     gl_func_newlocale="$ac_cv_func_newlocale"
     gl_func_duplocale="$ac_cv_func_duplocale"
     gl_func_freelocale="$ac_cv_func_freelocale"
index 082497d2f1fef89d10bd39b344d8474ec0446e25..f2de33aff64a36cf28bc0aa5c0b526f57fb400c8 100644 (file)
@@ -1,4 +1,4 @@
-# mbrtoc32.m4 serial 9
+# mbrtoc32.m4 serial 10
 dnl Copyright (C) 2014-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,
@@ -44,23 +44,29 @@ AC_DEFUN([gl_FUNC_MBRTOC32],
   fi
 ])
 
-dnl We can't use AC_CHECK_FUNC here, because mbrtoc32() is defined as a
-dnl static inline function on Haiku 2020.
 AC_DEFUN([gl_CHECK_FUNC_MBRTOC32],
 [
-  AC_CACHE_CHECK([for mbrtoc32], [gl_cv_func_mbrtoc32],
-    [AC_LINK_IFELSE(
-       [AC_LANG_PROGRAM(
-          [[#include <stdlib.h>
-            #include <uchar.h>
-          ]],
-          [[char32_t c;
-            return mbrtoc32 (&c, "", 1, NULL) == 0;
-          ]])
-       ],
-       [gl_cv_func_mbrtoc32=yes],
-       [gl_cv_func_mbrtoc32=no])
-    ])
+  dnl Cf. gl_CHECK_FUNCS_ANDROID
+  AC_CHECK_DECL([mbrtoc32], , , [[#include <uchar.h>]])
+  if test $ac_cv_have_decl_mbrtoc32 = yes; then
+    dnl We can't use AC_CHECK_FUNC here, because mbrtoc32() is defined as a
+    dnl static inline function on Haiku 2020.
+    AC_CACHE_CHECK([for mbrtoc32], [gl_cv_func_mbrtoc32],
+      [AC_LINK_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#include <stdlib.h>
+              #include <uchar.h>
+            ]],
+            [[char32_t c;
+              return mbrtoc32 (&c, "", 1, NULL) == 0;
+            ]])
+         ],
+         [gl_cv_func_mbrtoc32=yes],
+         [gl_cv_func_mbrtoc32=no])
+      ])
+  else
+    gl_cv_func_mbrtoc32=no
+  fi
 ])
 
 AC_DEFUN([gl_MBRTOC32_EMPTY_INPUT],
index d36ba4797dd69362b2402d8b60b41fe3ae14dfc8..1b398c7ca73948c8a6a2e3936b14129c5bbfd3d6 100644 (file)
@@ -1,4 +1,4 @@
-# mbsnrtowcs.m4 serial 6
+# mbsnrtowcs.m4 serial 7
 dnl Copyright (C) 2008, 2010-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,
@@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_MBSNRTOWCS],
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   gl_MBSTATE_T_BROKEN
 
-  AC_CHECK_FUNCS_ONCE([mbsnrtowcs])
+  gl_CHECK_FUNCS_ANDROID([mbsnrtowcs], [[#include <wchar.h>]])
   if test $ac_cv_func_mbsnrtowcs = no; then
     HAVE_MBSNRTOWCS=0
   else
index 7823be0e0ca38731f11e6b4c26b26bf2dcb469e2..88eb39a6de7dd9646aef8ae8f3cd17d44c10b68a 100644 (file)
@@ -1,4 +1,4 @@
-# mbtowc.m4 serial 3
+# mbtowc.m4 serial 4
 dnl Copyright (C) 2011-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,
@@ -8,7 +8,7 @@ AC_DEFUN([gl_FUNC_MBTOWC],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
 
-  AC_CHECK_FUNCS([mbtowc])
+  gl_CHECK_FUNCS_ANDROID([mbtowc], [[#include <stdlib.h>]])
   if test $ac_cv_func_mbtowc = no; then
     HAVE_MBTOWC=0
   else
index cb324ff2a44b1460bb5b8dee8dd46f30e0b98aed..8bf5a227ee2997f88f5ba3d37076115e4bb42234 100644 (file)
@@ -1,4 +1,4 @@
-# serial 5
+# serial 6
 # See if we need to provide mkfifoat/mknodat replacement.
 
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
@@ -18,7 +18,8 @@ AC_DEFUN([gl_FUNC_MKFIFOAT],
 
   AC_REQUIRE([gl_FUNC_OPENAT])
 
-  AC_CHECK_FUNCS_ONCE([mkfifoat mknodat])
+  gl_CHECK_FUNCS_ANDROID([mknodat], [[#include <sys/stat.h>]])
+  AC_CHECK_FUNCS_ONCE([mkfifoat])
   if test $ac_cv_func_mkfifoat = yes; then
     dnl Check for AIX 7.2 bug with trailing slash.
     AC_CACHE_CHECK([whether mkfifoat rejects trailing slashes],
index a9b4edb9f054cd32c4ad04223b085f949f2f0c5e..343017d354a5bbf541aed809e264b2b6d1e55dd1 100644 (file)
@@ -1,4 +1,4 @@
-# serial 15
+# serial 16
 dnl Copyright (C) 2002-2006, 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,
@@ -106,7 +106,15 @@ $ac_includes_default
           [Define if there is a function named getmntent for reading the list
            of mounted file systems, and that function takes a single argument.
            (4.3BSD, SunOS, HP-UX, Irix)])
-        AC_CHECK_FUNCS([setmntent endmntent hasmntopt])
+        AC_CHECK_FUNCS([hasmntopt])
+        gl_CHECK_FUNCS_ANDROID([setmntent],
+          [[#include <stdio.h>
+            #include <mntent.h>
+          ]])
+        gl_CHECK_FUNCS_ANDROID([endmntent],
+          [[#include <stdio.h>
+            #include <mntent.h>
+          ]])
       fi
     fi
 
index 6ab66f5abff277af0fa86cadf868bb8eea19dd4f..f5912a12bb1d82f9ea6bcf28bc409e700219e3f1 100644 (file)
@@ -1,4 +1,4 @@
-# posix_openpt.m4 serial 2
+# posix_openpt.m4 serial 3
 dnl Copyright (C) 2011-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,
@@ -11,7 +11,7 @@ AC_DEFUN([gl_FUNC_POSIX_OPENPT],
   dnl Persuade Solaris <stdlib.h> to declare posix_openpt().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_CHECK_FUNCS_ONCE([posix_openpt])
+  gl_CHECK_FUNCS_ANDROID([posix_openpt], [[#include <stdlib.h>]])
   if test $ac_cv_func_posix_openpt != yes; then
     dnl The system does not have posix_openpt.
     HAVE_POSIX_OPENPT=0
index 794678eb7a441cdbd205011201fb0fb88bf6a82a..ac4ac2651a51bf80eee060a7e30c4049ad4f76c9 100644 (file)
--- a/m4/pty.m4
+++ b/m4/pty.m4
@@ -1,4 +1,4 @@
-# pty.m4 serial 14
+# pty.m4 serial 15
 dnl Copyright (C) 2010-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,
@@ -145,7 +145,8 @@ AC_DEFUN([gl_FUNC_OPENPTY],
     dnl The system does not have openpty.
     HAVE_OPENPTY=0
     dnl Prerequisites of lib/openpty.c in this case.
-    AC_CHECK_FUNCS([_getpty posix_openpt])
+    AC_CHECK_FUNCS([_getpty])
+    gl_CHECK_FUNCS_ANDROID([posix_openpt], [[#include <stdlib.h>]])
   fi
 ])
 
index 939a8440295cd73a2528a7de8399ed0a3cfdc6a2..b99603cf9a4e270630c6944bd93cf4bae23352b0 100644 (file)
@@ -1,4 +1,4 @@
-# random.m4 serial 4
+# random.m4 serial 5
 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,
@@ -24,7 +24,8 @@ AC_DEFUN([gl_FUNC_RANDOM],
     HAVE_INITSTATE=0
     HAVE_SETSTATE=0
   else
-    AC_CHECK_FUNCS([initstate setstate])
+    gl_CHECK_FUNCS_ANDROID([initstate], [[#include <stdlib.h>]])
+    gl_CHECK_FUNCS_ANDROID([setstate], [[#include <stdlib.h>]])
     if test $ac_cv_func_initstate = no; then
       HAVE_INITSTATE=0
     fi
index ffd0b8e9bc1f75af5df4b093368e4ee91cf3560c..416f9c0d6402e9e21234dfc79ff2d55098eea5b9 100644 (file)
@@ -1,4 +1,4 @@
-# serial 6
+# serial 7
 # See if we need to provide readlinkat replacement.
 
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
@@ -12,7 +12,7 @@ AC_DEFUN([gl_FUNC_READLINKAT],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  AC_CHECK_FUNCS_ONCE([readlinkat])
+  gl_CHECK_FUNCS_ANDROID([readlinkat], [[#include <unistd.h>]])
   AC_REQUIRE([gl_FUNC_READLINK])
   if test $ac_cv_func_readlinkat = no; then
     HAVE_READLINKAT=0
index e8a76bc34f3a86acef01e3867b1fb999700d1925..462f511d25dfbdc7145b41974ce79eb175d54c20 100644 (file)
@@ -1,4 +1,4 @@
-# stpcpy.m4 serial 9
+# stpcpy.m4 serial 10
 dnl Copyright (C) 2002, 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,
@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_STPCPY],
   AC_REQUIRE([AC_C_RESTRICT])
 
   AC_REQUIRE([gl_STRING_H_DEFAULTS])
-  AC_CHECK_FUNCS([stpcpy])
+  gl_CHECK_FUNCS_ANDROID([stpcpy], [[#include <string.h>]])
   if test $ac_cv_func_stpcpy = no; then
     HAVE_STPCPY=0
   fi
index 7238329dc1df90bd1a693e3e77f47cec8e034c51..c321093b665a6343012f4cfac2b5e0d6693d9661 100644 (file)
@@ -1,4 +1,4 @@
-# stpncpy.m4 serial 19
+# stpncpy.m4 serial 20
 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -28,7 +28,7 @@ AC_DEFUN([gl_FUNC_STPNCPY],
   dnl Only the glibc return value is useful in practice.
 
   AC_CHECK_DECLS_ONCE([stpncpy])
-  AC_CHECK_FUNCS_ONCE([stpncpy])
+  gl_CHECK_FUNCS_ANDROID([stpncpy], [[#include <string.h>]])
   if test $ac_cv_func_stpncpy = yes; then
     AC_CACHE_CHECK([for working stpncpy], [gl_cv_func_stpncpy], [
       AC_RUN_IFELSE(
index 24fa7685c4492487b3a767fd3e348fc9c2095512..d12f91997c6a53ed5c4d9db024467a2787aa4b93 100644 (file)
@@ -1,4 +1,4 @@
-# serial 10
+# serial 11
 # See if we need to provide symlinkat replacement.
 
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
@@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_SYMLINKAT],
   AC_REQUIRE([gl_FUNC_OPENAT])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CHECK_FUNCS_ONCE([symlinkat])
+  gl_CHECK_FUNCS_ANDROID([symlinkat], [[#include <unistd.h>]])
   if test $ac_cv_func_symlinkat = no; then
     HAVE_SYMLINKAT=0
   else
diff --git a/m4/tcgetattr.m4 b/m4/tcgetattr.m4
new file mode 100644 (file)
index 0000000..2d55805
--- /dev/null
@@ -0,0 +1,29 @@
+# tcgetattr.m4 serial 1
+dnl Copyright (C) 2002-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 with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_HAVE_TCGETATTR],
+[
+  dnl We can't use AC_CHECK_FUNC here, because tcgetattr() is defined as a
+  dnl static inline function when compiling for Android 4.4 or older.
+  AC_CACHE_CHECK([for tcgetattr], [gl_cv_func_tcgetattr],
+    [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <termios.h>
+            struct termios x;
+          ]],
+          [[return tcgetattr(0,&x);]])
+       ],
+       [gl_cv_func_tcgetattr=yes],
+       [gl_cv_func_tcgetattr=no])
+    ])
+  if test $gl_cv_func_tcgetattr = yes; then
+    HAVE_TCGETATTR=1
+  else
+    HAVE_TCGETATTR=0
+  fi
+  AC_DEFINE_UNQUOTED([HAVE_TCGETATTR], [$HAVE_TCGETATTR],
+    [Define to 1 if the system has the 'tcgetattr' function.])
+])
index 312d0d6864ec4880866e85315f566b900d8a7428..b047af34c98d9cca3f2dbc46d29f0f554fd13c9d 100644 (file)
@@ -1,4 +1,4 @@
-# truncate.m4 serial 3   -*- Autoconf -*-
+# truncate.m4 serial 4   -*- Autoconf -*-
 dnl Copyright (C) 2017-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,
@@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_TRUNCATE],
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
 
-  AC_CHECK_FUNCS_ONCE([truncate])
+  gl_CHECK_FUNCS_ANDROID([truncate], [[#include <unistd.h>]])
   dnl AC_CHECK_FUNC is not enough here, because when compiling for Android 4.4
   dnl or older with _FILE_OFFSET_BITS=64, truncate() is not declared.  There
   dnl is a function 'truncate' in libc, but it is unsuitable, because it takes
index 8e6a894f83723c2607d2f31a4db13f76acf6d650..d78da9b198d4b650acf1d009f691f191de1189cf 100644 (file)
@@ -1,4 +1,4 @@
-# tsearch.m4 serial 9
+# tsearch.m4 serial 10
 dnl Copyright (C) 2006-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,
@@ -7,8 +7,8 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_TSEARCH],
 [
   AC_REQUIRE([gl_SEARCH_H_DEFAULTS])
-  AC_CHECK_FUNCS([twalk])
   gl_CHECK_FUNCS_ANDROID([tsearch], [[#include <search.h>]])
+  gl_CHECK_FUNCS_ANDROID([twalk], [[#include <search.h>]])
   if test $ac_cv_func_tsearch = yes; then
     dnl On OpenBSD 4.0, the return value of tdelete() is incorrect.
     AC_REQUIRE([AC_PROG_CC])
index a873cbe003fc3cc763757326f8d1a082eeb18249..47914cd1770574d797d76956790dc617542fef31 100644 (file)
@@ -1,4 +1,4 @@
-# vdprintf-posix.m4 serial 2
+# vdprintf-posix.m4 serial 3
 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,
@@ -21,7 +21,7 @@ AC_DEFUN([gl_FUNC_VDPRINTF_POSIX],
   AC_REQUIRE([gl_PRINTF_PRECISION])
   AC_REQUIRE([gl_PRINTF_ENOMEM])
   gl_cv_func_vdprintf_posix=no
-  AC_CHECK_FUNCS_ONCE([vdprintf])
+  gl_CHECK_FUNCS_ANDROID([vdprintf], [[#include <stdio.h>]])
   if test $ac_cv_func_vdprintf = yes; then
     case "$gl_cv_func_printf_sizes_c99" in
       *yes)
index eeea4b7c7db7722b4214b40ee7ffad960dfab506..1420efdb51a2a8d49772b11b6893ca8700476588 100644 (file)
@@ -1,4 +1,4 @@
-# vdprintf.m4 serial 1
+# vdprintf.m4 serial 2
 dnl Copyright (C) 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,
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_VDPRINTF],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  AC_CHECK_FUNCS_ONCE([vdprintf])
+  gl_CHECK_FUNCS_ANDROID([vdprintf], [[#include <stdio.h>]])
   if test $ac_cv_func_vdprintf = no; then
     HAVE_VDPRINTF=0
     gl_REPLACE_VDPRINTF
index e31d72cc971684ef41eb88cc3ac2fbbcb52403ad..af6d26c78d0a64a111ca17610489a1bc103191c3 100644 (file)
@@ -1,4 +1,4 @@
-# wcsnrtombs.m4 serial 7
+# wcsnrtombs.m4 serial 8
 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,
@@ -11,7 +11,7 @@ AC_DEFUN([gl_FUNC_WCSNRTOMBS],
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   gl_MBSTATE_T_BROKEN
 
-  AC_CHECK_FUNCS_ONCE([wcsnrtombs])
+  gl_CHECK_FUNCS_ANDROID([wcsnrtombs], [[#include <wchar.h>]])
   if test $ac_cv_func_wcsnrtombs = no; then
     HAVE_WCSNRTOMBS=0
   else
index b3375a9b20eb2aa76b81315ae61403cff9edf6ce..700a89bdb59ff0b99e761ff9fe045fe28153b719 100644 (file)
@@ -14,7 +14,7 @@ unistd
 
 configure.ac:
 AC_REQUIRE([AC_C_RESTRICT])
-AC_CHECK_FUNCS_ONCE([readlinkat])
+gl_CHECK_FUNCS_ANDROID([readlinkat], [[#include <unistd.h>]])
 
 Makefile.am:
 lib_SOURCES += careadlinkat.c
index 01df43bf84c691757a884f0d9261d3e4bae18a10..0cb7af470330feb24487daabb574ebe0e8b87143 100644 (file)
@@ -8,7 +8,8 @@ Depends-on:
 langinfo
 
 configure.ac:
-AC_CHECK_FUNCS_ONCE([duplocale strfmon_l snprintf_l nl_langinfo_l])
+AC_CHECK_FUNCS_ONCE([strfmon_l snprintf_l nl_langinfo_l])
+gl_CHECK_FUNCS_ANDROID([duplocale], [[#include <locale.h>]])
 AC_CHECK_HEADERS_ONCE([monetary.h])
 gt_FUNC_USELOCALE
 
index 0088db160e0645d6381d43a2dd754e263a642306..9d62add472d92aabaa353b9b61f3578caa1e12b2 100644 (file)
@@ -10,7 +10,7 @@ extensions
 intprops
 
 configure.ac:
-AC_CHECK_FUNCS_ONCE([strtof])
+gl_CHECK_FUNCS_ANDROID([strtof], [[#include <stdlib.h>]])
 
 Makefile.am:
 lib_SOURCES += ftoastr.c
index 74d781aff2a29df1033364f747fb42accba222e2..e7eefa4c9808ab7a3b0ec7d7b3ecdc23fdd9d83b 100644 (file)
@@ -5,6 +5,7 @@ Files:
 lib/getpass.h
 lib/getpass.c
 m4/getpass.m4
+m4/tcgetattr.m4
 
 Depends-on:
 unistd
index d968af7e3377bad719d75120ad08d3cb1138dc23..e939cf2617c48065fb093472f7c6d4bd39120d76 100644 (file)
@@ -5,6 +5,7 @@ Files:
 lib/getpass.h
 lib/getpass.c
 m4/getpass.m4
+m4/tcgetattr.m4
 
 Depends-on:
 getpass
index b37fc39289ad7b86abae857d7414bc33046abc65..e4bc65a2564f2b49d02cd9c4ba8990f40766ee21 100644 (file)
@@ -8,7 +8,7 @@ Depends-on:
 configure.ac:
 gl_MUSL_LIBC
 dnl Distinguish OpenBSD >= 6.2 from OpenBSD < 6.2.
-AC_CHECK_FUNCS_ONCE([duplocale])
+gl_CHECK_FUNCS_ANDROID([duplocale], [[#include <locale.h>]])
 
 Makefile.am:
 TESTS += test-hard-locale
index 11b840da9adb6386f08bbcaa4f26964b17c33b25..5c7c032fa8a3cd7e84840d4670fcb256cbd40ecf 100644 (file)
@@ -6,7 +6,7 @@ assert-h
 locale-c++-tests
 
 configure.ac:
-AC_CHECK_FUNCS_ONCE([newlocale])
+gl_CHECK_FUNCS_ANDROID([newlocale], [[#include <locale.h>]])
 
 Makefile.am:
 TESTS += test-locale
index af9ee464daf7679c64c213ea9344deae8d1f29a1..f90d82da0d182fc6ab491197a60d5c7f93cd1bff 100644 (file)
@@ -10,7 +10,7 @@ setlocale
 strdup
 
 configure.ac:
-AC_CHECK_FUNCS_ONCE([newlocale])
+gl_CHECK_FUNCS_ANDROID([newlocale], [[#include <locale.h>]])
 
 Makefile.am:
 TESTS += test-localename
index 85d748d75e2677de703d8b5ff00cba9150d16e6f..9bc9f5e7b9cfb08f21687414ac5487276000200b 100644 (file)
@@ -4,6 +4,7 @@ Terminal control for outputting styled text to a terminal.
 Files:
 lib/term-style-control.h
 lib/term-style-control.c
+m4/tcgetattr.m4
 
 Depends-on:
 stdbool
@@ -17,7 +18,7 @@ xalloc-die
 
 configure.ac:
 AC_REQUIRE([AC_C_INLINE])
-AC_CHECK_FUNCS_ONCE([tcgetattr])
+gl_HAVE_TCGETATTR
 
 Makefile.am:
 lib_SOURCES += term-style-control.c
index 2612b72c4ae617dd7c31b58d851cdb68e4cb9a29..95f9d0038614c3bad605660a866b724b898a99d5 100644 (file)
@@ -20,7 +20,7 @@ AC_LINK_IFELSE(
   [],
   [TEST_TSEARCH_LIBM=-lm])
 AC_SUBST([TEST_TSEARCH_LIBM])
-AC_CHECK_FUNCS_ONCE([initstate])
+gl_CHECK_FUNCS_ANDROID([initstate], [[#include <stdlib.h>]])
 
 Makefile.am:
 TESTS += test-tsearch.sh
index 8831b2e64316a77d70850869ac04ef404d6abcfe..7f228512833238e762187f352b980d0b74d78149 100644 (file)
@@ -9,7 +9,7 @@ Depends-on:
 unistr/base
 
 configure.ac:
-AC_CHECK_FUNCS_ONCE([stpcpy])
+gl_CHECK_FUNCS_ANDROID([stpcpy], [[#include <string.h>]])
 gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-stpcpy])
 
 Makefile.am: