-# perror.m4 serial 6
-dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
+# perror.m4 serial 7
+dnl Copyright (C) 2008-2018 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_REQUIRE([gl_HEADER_ERRNO_H])
AC_REQUIRE([gl_FUNC_STRERROR_R])
AC_REQUIRE([gl_FUNC_STRERROR_0])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl We intentionally do not check for the broader REPLACE_STRERROR_R,
dnl since on glibc systems, strerror_r is replaced only for signature
dnl issues, and perror is just fine. Rather, we only want to
fi
rm -rf conftest.txt1 conftest.txt2],
[gl_cv_func_perror_works=no],
- [dnl Guess no when cross-compiling.
- gl_cv_func_perror_works="guessing no"
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_perror_works="guessing yes" ;;
+ # Otherwise guess no.
+ *) gl_cv_func_perror_works="guessing no" ;;
+ esac
])
])
- if test "$gl_cv_func_perror_works" != yes; then
- REPLACE_PERROR=1
- fi
+ case "$gl_cv_func_perror_works" in
+ *yes) ;;
+ *) REPLACE_PERROR=1 ;;
+ esac
;;
*)
dnl The system's perror() probably inherits the bugs in the