diff options
author | Bruno Haible <bruno@clisp.org> | 2023-01-19 21:55:27 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-01-19 21:55:27 +0100 |
commit | 4e763315017dfffcde655329d3343fef35fb0537 (patch) | |
tree | 3ee66e1e3c35bb14a50f61870cd6556d4f6f427f /m4 | |
parent | 64044f7934922d347c578fa8b2c5b2305aed5ca5 (diff) | |
download | gnulib-4e763315017dfffcde655329d3343fef35fb0537.tar.gz |
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.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/_Exit.m4 | 4 | ||||
-rw-r--r-- | m4/c-strtod.m4 | 4 | ||||
-rw-r--r-- | m4/c32rtomb.m4 | 38 | ||||
-rw-r--r-- | m4/dprintf-posix.m4 | 4 | ||||
-rw-r--r-- | m4/dprintf.m4 | 4 | ||||
-rw-r--r-- | m4/dup3.m4 | 5 | ||||
-rw-r--r-- | m4/duplocale.m4 | 4 | ||||
-rw-r--r-- | m4/execvpe.m4 | 4 | ||||
-rw-r--r-- | m4/fchmodat.m4 | 4 | ||||
-rw-r--r-- | m4/fts.m4 | 4 | ||||
-rw-r--r-- | m4/getpass.m4 | 24 | ||||
-rw-r--r-- | m4/getprogname.m4 | 5 | ||||
-rw-r--r-- | m4/intl-thread-locale.m4 | 4 | ||||
-rw-r--r-- | m4/iswblank.m4 | 4 | ||||
-rw-r--r-- | m4/libtextstyle-optional.m4 | 4 | ||||
-rw-r--r-- | m4/linkat.m4 | 5 | ||||
-rw-r--r-- | m4/localename.m4 | 6 | ||||
-rw-r--r-- | m4/mbrtoc32.m4 | 38 | ||||
-rw-r--r-- | m4/mbsnrtowcs.m4 | 4 | ||||
-rw-r--r-- | m4/mbtowc.m4 | 4 | ||||
-rw-r--r-- | m4/mkfifoat.m4 | 5 | ||||
-rw-r--r-- | m4/mountlist.m4 | 12 | ||||
-rw-r--r-- | m4/posix_openpt.m4 | 4 | ||||
-rw-r--r-- | m4/pty.m4 | 5 | ||||
-rw-r--r-- | m4/random.m4 | 5 | ||||
-rw-r--r-- | m4/readlinkat.m4 | 4 | ||||
-rw-r--r-- | m4/stpcpy.m4 | 4 | ||||
-rw-r--r-- | m4/stpncpy.m4 | 4 | ||||
-rw-r--r-- | m4/symlinkat.m4 | 4 | ||||
-rw-r--r-- | m4/tcgetattr.m4 | 29 | ||||
-rw-r--r-- | m4/truncate.m4 | 4 | ||||
-rw-r--r-- | m4/tsearch.m4 | 4 | ||||
-rw-r--r-- | m4/vdprintf-posix.m4 | 4 | ||||
-rw-r--r-- | m4/vdprintf.m4 | 4 | ||||
-rw-r--r-- | m4/wcsnrtombs.m4 | 4 |
35 files changed, 153 insertions, 116 deletions
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 <stdlib.h>]]) 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 <stdlib.h>]]) ]) 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 <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 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 <stdio.h>]]) 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 <stdio.h>]]) 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 <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 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 <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>. 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 <unistd.h>]]) 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 <unistd.h>]]) : ]) @@ -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. 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 <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. 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 <stdlib.h>]]) + AC_CHECK_FUNCS_ONCE([getexecname]) ac_found=0 AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], [#include <errno.h>]) 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 <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. 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 <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> 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 <termios.h>]]) 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 <unistd.h>]]) 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 <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" 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 <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], 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 <wchar.h>]]) 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 <stdlib.h>]]) 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 <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], 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 <stdio.h> + #include <mntent.h> + ]]) + gl_CHECK_FUNCS_ANDROID([endmntent], + [[#include <stdio.h> + #include <mntent.h> + ]]) 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 <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 @@ -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 ]) 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 <stdlib.h>]]) + gl_CHECK_FUNCS_ANDROID([setstate], [[#include <stdlib.h>]]) 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 <unistd.h>]]) 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 <string.h>]]) 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 <string.h>]]) 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 <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 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 <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.]) +]) 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 <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 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 <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]) 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 <stdio.h>]]) 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 <stdio.h>]]) 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 <wchar.h>]]) if test $ac_cv_func_wcsnrtombs = no; then HAVE_WCSNRTOMBS=0 else |