2 dnl Copyright (C) 2002, 2007 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_STRERROR],
9 AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE])
10 if test $gl_cv_func_working_strerror = no; then
12 AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR],
13 [Define this to 1 if strerror is broken.])
17 # Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ).
18 AC_DEFUN([gl_FUNC_STRERROR_SEPARATE],
20 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
21 AC_CACHE_CHECK([for working strerror function],
22 [gl_cv_func_working_strerror],
27 [return !*strerror (-2);])],
28 [gl_cv_func_working_strerror=yes],
29 [gl_cv_func_working_strerror=no],
30 [dnl Assume crossbuild works if it compiles.
35 [return !*strerror (-2);])],
36 [gl_cv_func_working_strerror=yes],
37 [gl_cv_func_working_strerror=no])])])
38 if test $gl_cv_func_working_strerror = no ; then
44 # Prerequisites of lib/strerror.c.
45 AC_DEFUN([gl_PREREQ_STRERROR], [
46 AC_CHECK_DECLS([strerror])