X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=m4%2Fperror.m4;h=60568a7ad90a8836633535187b1264dff6d7aeb4;hb=92249085071a973e2c0621b0415b93d2e48bb00d;hp=42549ba212c990ec328bd0488a365174c46b47f5;hpb=d738e90e8360e101b94fca8c79147f59565f62d8;p=debian%2Fgzip diff --git a/m4/perror.m4 b/m4/perror.m4 index 42549ba..60568a7 100644 --- a/m4/perror.m4 +++ b/m4/perror.m4 @@ -1,5 +1,5 @@ -# perror.m4 serial 6 -dnl Copyright (C) 2008-2013 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. @@ -10,6 +10,7 @@ AC_DEFUN([gl_FUNC_PERROR], 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 @@ -46,13 +47,18 @@ AC_DEFUN([gl_FUNC_PERROR], 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