1 # strerrorname_np.m4 serial 1
2 dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_FUNC_STRERRORNAME_NP],
9 dnl Persuade glibc <string.h> to declare strerrorname_np().
10 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
12 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
13 AC_CHECK_FUNCS([strerrorname_np])
14 if test $ac_cv_func_strerrorname_np = yes; then
15 dnl In glibc 2.32, strerrorname_np returns English error descriptions, not
17 dnl See <https://sourceware.org/bugzilla/show_bug.cgi?id=26555>.
18 AC_CACHE_CHECK([whether strerrorname_np works],
19 [gl_cv_func_strerrorname_np_works],
25 [[return strcmp (strerrorname_np (EINVAL), "EINVAL") != 0;
27 [gl_cv_func_strerrorname_np_works=yes],
28 [gl_cv_func_strerrorname_np_works=no],
30 # Guess no on glibc systems.
32 gl_cv_func_strerrorname_np_works="guessing no" ;;
33 # Otherwise obey --enable-cross-guesses.
35 gl_cv_func_strerrorname_np_works="$gl_cross_guess_normal" ;;
39 case "$gl_cv_func_strerrorname_np_works" in
41 *) REPLACE_STRERRORNAME_NP=1 ;;
44 HAVE_STRERRORNAME_NP=0