From 4e763315017dfffcde655329d3343fef35fb0537 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 19 Jan 2023 21:55:27 +0100 Subject: [PATCH 08/15] 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. --- ChangeLog | 89 +++++++++++++++++++++++++++++++++++++ m4/_Exit.m4 | 4 +- m4/c-strtod.m4 | 4 +- m4/c32rtomb.m4 | 38 +++++++++------- m4/dprintf-posix.m4 | 4 +- m4/dprintf.m4 | 4 +- m4/dup3.m4 | 5 ++- m4/duplocale.m4 | 4 +- m4/execvpe.m4 | 4 +- m4/fchmodat.m4 | 4 +- m4/fts.m4 | 4 +- m4/getpass.m4 | 24 +--------- m4/getprogname.m4 | 5 ++- m4/intl-thread-locale.m4 | 4 +- m4/iswblank.m4 | 4 +- m4/libtextstyle-optional.m4 | 4 +- m4/linkat.m4 | 5 ++- m4/localename.m4 | 6 ++- m4/mbrtoc32.m4 | 38 +++++++++------- m4/mbsnrtowcs.m4 | 4 +- m4/mbtowc.m4 | 4 +- m4/mkfifoat.m4 | 5 ++- m4/mountlist.m4 | 12 ++++- m4/posix_openpt.m4 | 4 +- m4/pty.m4 | 5 ++- m4/random.m4 | 5 ++- m4/readlinkat.m4 | 4 +- m4/stpcpy.m4 | 4 +- m4/stpncpy.m4 | 4 +- m4/symlinkat.m4 | 4 +- m4/tcgetattr.m4 | 29 ++++++++++++ m4/truncate.m4 | 4 +- m4/tsearch.m4 | 4 +- m4/vdprintf-posix.m4 | 4 +- m4/vdprintf.m4 | 4 +- m4/wcsnrtombs.m4 | 4 +- modules/careadlinkat | 2 +- modules/duplocale-tests | 3 +- modules/ftoastr | 2 +- modules/getpass | 1 + modules/getpass-gnu | 1 + modules/hard-locale-tests | 2 +- modules/locale-tests | 2 +- modules/localename-tests | 2 +- modules/term-style-control | 3 +- modules/tsearch-tests | 2 +- modules/unistr/u8-stpcpy | 2 +- 47 files changed, 255 insertions(+), 125 deletions(-) create mode 100644 m4/tcgetattr.m4 diff --git a/ChangeLog b/ChangeLog index 33693bec9c..ae2fb8c5c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,92 @@ +2023-01-19 Bruno Haible + + 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 Fix warnings for functions introduced in Android API level 19. diff --git a/m4/_Exit.m4 b/m4/_Exit.m4 index c4cf270eff..61e1f848b7 100644 --- a/m4/_Exit.m4 +++ b/m4/_Exit.m4 @@ -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 ]]) if test $ac_cv_func__Exit = no; then HAVE__EXIT=0 fi diff --git a/m4/c-strtod.m4 b/m4/c-strtod.m4 index e92badad1c..746b39bb44 100644 --- a/m4/c-strtod.m4 +++ b/m4/c-strtod.m4 @@ -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 ]]) ]) diff --git a/m4/c32rtomb.m4 b/m4/c32rtomb.m4 index 739d21d385..41c07e75c9 100644 --- a/m4/c32rtomb.m4 +++ b/m4/c32rtomb.m4 @@ -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 - #include - ]], - [[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 ]]) + 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 + #include + ]], + [[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 diff --git a/m4/dprintf-posix.m4 b/m4/dprintf-posix.m4 index 4efd46cc7d..a25ef4164e 100644 --- a/m4/dprintf-posix.m4 +++ b/m4/dprintf-posix.m4 @@ -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 ]]) if test $ac_cv_func_dprintf = yes; then case "$gl_cv_func_printf_sizes_c99" in *yes) diff --git a/m4/dprintf.m4 b/m4/dprintf.m4 index 7e3ea0bbf6..54c186620b 100644 --- a/m4/dprintf.m4 +++ b/m4/dprintf.m4 @@ -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 ]]) if test $ac_cv_func_dprintf = no; then HAVE_DPRINTF=0 gl_REPLACE_DPRINTF diff --git a/m4/dup3.m4 b/m4/dup3.m4 index 93a1d78509..644a172006 100644 --- a/m4/dup3.m4 +++ b/m4/dup3.m4 @@ -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 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 ]]) if test $ac_cv_func_dup3 != yes; then HAVE_DUP3=0 fi diff --git a/m4/duplocale.m4 b/m4/duplocale.m4 index c1525e90f5..e97cf5c055 100644 --- a/m4/duplocale.m4 +++ b/m4/duplocale.m4 @@ -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 ]]) if test $ac_cv_func_duplocale = yes; then dnl Check against glibc bug where duplocale crashes. dnl See . diff --git a/m4/execvpe.m4 b/m4/execvpe.m4 index 5ddc45d509..6c0a0e9b7d 100644 --- a/m4/execvpe.m4 +++ b/m4/execvpe.m4 @@ -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 ]]) if test $ac_cv_func_execvpe != yes; then HAVE_EXECVPE=0 fi diff --git a/m4/fchmodat.m4 b/m4/fchmodat.m4 index 7a3ee863e3..5356da40ba 100644 --- a/m4/fchmodat.m4 +++ b/m4/fchmodat.m4 @@ -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 ]]) : ]) diff --git a/m4/fts.m4 b/m4/fts.m4 index cdab461d45..eec034287c 100644 --- 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 ]]) 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. diff --git a/m4/getpass.m4 b/m4/getpass.m4 index 2dce1e0dfe..0e46edf64b 100644 --- a/m4/getpass.m4 +++ b/m4/getpass.m4 @@ -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 - 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. diff --git a/m4/getprogname.m4 b/m4/getprogname.m4 index b67c527cb6..7c306c80a9 100644 --- a/m4/getprogname.m4 +++ b/m4/getprogname.m4 @@ -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 ]]) + AC_CHECK_FUNCS_ONCE([getexecname]) ac_found=0 AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], [#include ]) diff --git a/m4/intl-thread-locale.m4 b/m4/intl-thread-locale.m4 index c231899511..90bc3b1aa6 100644 --- a/m4/intl-thread-locale.m4 +++ b/m4/intl-thread-locale.m4 @@ -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 to define 'locale_t'. AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_FUNCS_ONCE([uselocale]) + gl_CHECK_FUNCS_ANDROID([uselocale], [[#include ]]) dnl On AIX 7.2, the uselocale() function is not documented and leads to dnl crashes in subsequent setlocale() invocations. diff --git a/m4/iswblank.m4 b/m4/iswblank.m4 index ffb0d9bf30..f3f96bb784 100644 --- a/m4/iswblank.m4 +++ b/m4/iswblank.m4 @@ -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 to declare iswblank(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_FUNCS_ONCE([iswblank]) + gl_CHECK_FUNCS_ANDROID([iswblank], [[#include ]]) AC_CHECK_DECLS([iswblank], , , [[ #include #include diff --git a/m4/libtextstyle-optional.m4 b/m4/libtextstyle-optional.m4 index 93bec70629..3101cf7e3a 100644 --- a/m4/libtextstyle-optional.m4 +++ b/m4/libtextstyle-optional.m4 @@ -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 ]]) fi dnl Update the value of the TEXTSTYLE_H variable and the diff --git a/m4/linkat.m4 b/m4/linkat.m4 index 29978b4608..9b35fc14e3 100644 --- a/m4/linkat.m4 +++ b/m4/linkat.m4 @@ -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 ]]) if test $ac_cv_func_linkat = no; then HAVE_LINKAT=0 else diff --git a/m4/localename.m4 b/m4/localename.m4 index 03cce48033..43725d8444 100644 --- a/m4/localename.m4 +++ b/m4/localename.m4 @@ -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 ]]) + gl_CHECK_FUNCS_ANDROID([duplocale], [[#include ]]) + gl_CHECK_FUNCS_ANDROID([freelocale], [[#include ]]) gl_func_newlocale="$ac_cv_func_newlocale" gl_func_duplocale="$ac_cv_func_duplocale" gl_func_freelocale="$ac_cv_func_freelocale" diff --git a/m4/mbrtoc32.m4 b/m4/mbrtoc32.m4 index 082497d2f1..f2de33aff6 100644 --- a/m4/mbrtoc32.m4 +++ b/m4/mbrtoc32.m4 @@ -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 - #include - ]], - [[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 ]]) + 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 + #include + ]], + [[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], diff --git a/m4/mbsnrtowcs.m4 b/m4/mbsnrtowcs.m4 index d36ba4797d..1b398c7ca7 100644 --- a/m4/mbsnrtowcs.m4 +++ b/m4/mbsnrtowcs.m4 @@ -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 ]]) if test $ac_cv_func_mbsnrtowcs = no; then HAVE_MBSNRTOWCS=0 else diff --git a/m4/mbtowc.m4 b/m4/mbtowc.m4 index 7823be0e0c..88eb39a6de 100644 --- a/m4/mbtowc.m4 +++ b/m4/mbtowc.m4 @@ -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 ]]) if test $ac_cv_func_mbtowc = no; then HAVE_MBTOWC=0 else diff --git a/m4/mkfifoat.m4 b/m4/mkfifoat.m4 index cb324ff2a4..8bf5a227ee 100644 --- a/m4/mkfifoat.m4 +++ b/m4/mkfifoat.m4 @@ -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 ]]) + 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], diff --git a/m4/mountlist.m4 b/m4/mountlist.m4 index a9b4edb9f0..343017d354 100644 --- a/m4/mountlist.m4 +++ b/m4/mountlist.m4 @@ -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 + #include + ]]) + gl_CHECK_FUNCS_ANDROID([endmntent], + [[#include + #include + ]]) fi fi diff --git a/m4/posix_openpt.m4 b/m4/posix_openpt.m4 index 6ab66f5abf..f5912a12bb 100644 --- a/m4/posix_openpt.m4 +++ b/m4/posix_openpt.m4 @@ -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 to declare posix_openpt(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_FUNCS_ONCE([posix_openpt]) + gl_CHECK_FUNCS_ANDROID([posix_openpt], [[#include ]]) if test $ac_cv_func_posix_openpt != yes; then dnl The system does not have posix_openpt. HAVE_POSIX_OPENPT=0 diff --git a/m4/pty.m4 b/m4/pty.m4 index 794678eb7a..ac4ac2651a 100644 --- 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 ]]) fi ]) diff --git a/m4/random.m4 b/m4/random.m4 index 939a844029..b99603cf9a 100644 --- a/m4/random.m4 +++ b/m4/random.m4 @@ -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 ]]) + gl_CHECK_FUNCS_ANDROID([setstate], [[#include ]]) if test $ac_cv_func_initstate = no; then HAVE_INITSTATE=0 fi diff --git a/m4/readlinkat.m4 b/m4/readlinkat.m4 index ffd0b8e9bc..416f9c0d64 100644 --- a/m4/readlinkat.m4 +++ b/m4/readlinkat.m4 @@ -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 ]]) AC_REQUIRE([gl_FUNC_READLINK]) if test $ac_cv_func_readlinkat = no; then HAVE_READLINKAT=0 diff --git a/m4/stpcpy.m4 b/m4/stpcpy.m4 index e8a76bc34f..462f511d25 100644 --- a/m4/stpcpy.m4 +++ b/m4/stpcpy.m4 @@ -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 ]]) if test $ac_cv_func_stpcpy = no; then HAVE_STPCPY=0 fi diff --git a/m4/stpncpy.m4 b/m4/stpncpy.m4 index 7238329dc1..c321093b66 100644 --- a/m4/stpncpy.m4 +++ b/m4/stpncpy.m4 @@ -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 ]]) if test $ac_cv_func_stpncpy = yes; then AC_CACHE_CHECK([for working stpncpy], [gl_cv_func_stpncpy], [ AC_RUN_IFELSE( diff --git a/m4/symlinkat.m4 b/m4/symlinkat.m4 index 24fa7685c4..d12f91997c 100644 --- a/m4/symlinkat.m4 +++ b/m4/symlinkat.m4 @@ -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 ]]) 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 index 0000000000..2d55805b26 --- /dev/null +++ b/m4/tcgetattr.m4 @@ -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 + 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.]) +]) diff --git a/m4/truncate.m4 b/m4/truncate.m4 index 312d0d6864..b047af34c9 100644 --- a/m4/truncate.m4 +++ b/m4/truncate.m4 @@ -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 ]]) 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 diff --git a/m4/tsearch.m4 b/m4/tsearch.m4 index 8e6a894f83..d78da9b198 100644 --- a/m4/tsearch.m4 +++ b/m4/tsearch.m4 @@ -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 ]]) + gl_CHECK_FUNCS_ANDROID([twalk], [[#include ]]) 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]) diff --git a/m4/vdprintf-posix.m4 b/m4/vdprintf-posix.m4 index a873cbe003..47914cd177 100644 --- a/m4/vdprintf-posix.m4 +++ b/m4/vdprintf-posix.m4 @@ -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 ]]) if test $ac_cv_func_vdprintf = yes; then case "$gl_cv_func_printf_sizes_c99" in *yes) diff --git a/m4/vdprintf.m4 b/m4/vdprintf.m4 index eeea4b7c7d..1420efdb51 100644 --- a/m4/vdprintf.m4 +++ b/m4/vdprintf.m4 @@ -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 ]]) if test $ac_cv_func_vdprintf = no; then HAVE_VDPRINTF=0 gl_REPLACE_VDPRINTF diff --git a/m4/wcsnrtombs.m4 b/m4/wcsnrtombs.m4 index e31d72cc97..af6d26c78d 100644 --- a/m4/wcsnrtombs.m4 +++ b/m4/wcsnrtombs.m4 @@ -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 ]]) if test $ac_cv_func_wcsnrtombs = no; then HAVE_WCSNRTOMBS=0 else diff --git a/modules/careadlinkat b/modules/careadlinkat index b3375a9b20..700a89bdb5 100644 --- a/modules/careadlinkat +++ b/modules/careadlinkat @@ -14,7 +14,7 @@ unistd configure.ac: AC_REQUIRE([AC_C_RESTRICT]) -AC_CHECK_FUNCS_ONCE([readlinkat]) +gl_CHECK_FUNCS_ANDROID([readlinkat], [[#include ]]) Makefile.am: lib_SOURCES += careadlinkat.c diff --git a/modules/duplocale-tests b/modules/duplocale-tests index 01df43bf84..0cb7af4703 100644 --- a/modules/duplocale-tests +++ b/modules/duplocale-tests @@ -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 ]]) AC_CHECK_HEADERS_ONCE([monetary.h]) gt_FUNC_USELOCALE diff --git a/modules/ftoastr b/modules/ftoastr index 0088db160e..9d62add472 100644 --- a/modules/ftoastr +++ b/modules/ftoastr @@ -10,7 +10,7 @@ extensions intprops configure.ac: -AC_CHECK_FUNCS_ONCE([strtof]) +gl_CHECK_FUNCS_ANDROID([strtof], [[#include ]]) Makefile.am: lib_SOURCES += ftoastr.c diff --git a/modules/getpass b/modules/getpass index 74d781aff2..e7eefa4c98 100644 --- a/modules/getpass +++ b/modules/getpass @@ -5,6 +5,7 @@ Files: lib/getpass.h lib/getpass.c m4/getpass.m4 +m4/tcgetattr.m4 Depends-on: unistd diff --git a/modules/getpass-gnu b/modules/getpass-gnu index d968af7e33..e939cf2617 100644 --- a/modules/getpass-gnu +++ b/modules/getpass-gnu @@ -5,6 +5,7 @@ Files: lib/getpass.h lib/getpass.c m4/getpass.m4 +m4/tcgetattr.m4 Depends-on: getpass diff --git a/modules/hard-locale-tests b/modules/hard-locale-tests index b37fc39289..e4bc65a256 100644 --- a/modules/hard-locale-tests +++ b/modules/hard-locale-tests @@ -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 ]]) Makefile.am: TESTS += test-hard-locale diff --git a/modules/locale-tests b/modules/locale-tests index 11b840da9a..5c7c032fa8 100644 --- a/modules/locale-tests +++ b/modules/locale-tests @@ -6,7 +6,7 @@ assert-h locale-c++-tests configure.ac: -AC_CHECK_FUNCS_ONCE([newlocale]) +gl_CHECK_FUNCS_ANDROID([newlocale], [[#include ]]) Makefile.am: TESTS += test-locale diff --git a/modules/localename-tests b/modules/localename-tests index af9ee464da..f90d82da0d 100644 --- a/modules/localename-tests +++ b/modules/localename-tests @@ -10,7 +10,7 @@ setlocale strdup configure.ac: -AC_CHECK_FUNCS_ONCE([newlocale]) +gl_CHECK_FUNCS_ANDROID([newlocale], [[#include ]]) Makefile.am: TESTS += test-localename diff --git a/modules/term-style-control b/modules/term-style-control index 85d748d75e..9bc9f5e7b9 100644 --- a/modules/term-style-control +++ b/modules/term-style-control @@ -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 diff --git a/modules/tsearch-tests b/modules/tsearch-tests index 2612b72c4a..95f9d00386 100644 --- a/modules/tsearch-tests +++ b/modules/tsearch-tests @@ -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 ]]) Makefile.am: TESTS += test-tsearch.sh diff --git a/modules/unistr/u8-stpcpy b/modules/unistr/u8-stpcpy index 8831b2e643..7f22851283 100644 --- a/modules/unistr/u8-stpcpy +++ b/modules/unistr/u8-stpcpy @@ -9,7 +9,7 @@ Depends-on: unistr/base configure.ac: -AC_CHECK_FUNCS_ONCE([stpcpy]) +gl_CHECK_FUNCS_ANDROID([stpcpy], [[#include ]]) gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-stpcpy]) Makefile.am: -- 2.34.1