From b271592d70db2b89aa2df7ce1572b12e8455c5d4 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 7 Jan 2023 01:50:49 +0200 Subject: [PATCH 46/46] Update gnulib-common to serial 76 from gnulib upstream See osdn #46462 Signed-off-by: Marko Lindqvist --- dependencies/m4/gnulib-common.m4 | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dependencies/m4/gnulib-common.m4 b/dependencies/m4/gnulib-common.m4 index 40c19cab69..26239caa2b 100644 --- a/dependencies/m4/gnulib-common.m4 +++ b/dependencies/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 75 -dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. +# gnulib-common.m4 serial 76 +dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -1023,6 +1023,30 @@ AC_DEFUN([gl_CONDITIONAL_HEADER], m4_popdef([gl_header_name]) ]) +dnl gl_CHECK_FUNCS_ANDROID([func], [[#include ]]) +dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem +dnl on Android. +dnl Namely, if func was added to Android API level, say, 28, then the libc.so +dnl has the symbol func always, whereas the header file declares func +dnl conditionally: +dnl #if __ANDROID_API__ >= 28 +dnl ... func (...) __INTRODUCED_IN(28); +dnl #endif +dnl Thus, when compiling with "clang -target armv7a-unknown-linux-android28", +dnl the function func is declared and exists in libc. +dnl Whereas when compiling with "clang -target armv7a-unknown-linux-android27", +dnl the function func is not declared but exists in libc. We need to treat this +dnl case like the case where func does not exist. +AC_DEFUN([gl_CHECK_FUNCS_ANDROID], +[ + AC_CHECK_DECL([$1], , , [$2]) + if test $ac_cv_have_decl_[$1] = yes; then + AC_CHECK_FUNCS([$1]) + else + ac_cv_func_[$1]=no + fi +]) + dnl Expands to some code for use in .c programs that, on native Windows, defines dnl the Microsoft deprecated alias function names to the underscore-prefixed dnl actual function names. With this macro, these function names are available -- 2.39.0