From 2bb986afa876b68a8758a5fdf9b866252c9db47f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 6 Dec 2010 23:30:54 +0100 Subject: [PATCH] Update from gnulib. --- gettext-runtime/m4/ChangeLog | 9 +++++ gettext-runtime/m4/fcntl-o.m4 | 63 +++++++++++++++++++++++++---------- gettext-runtime/m4/iconv.m4 | 19 +++++++---- gettext-runtime/m4/intdiv0.m4 | 4 +-- 4 files changed, 68 insertions(+), 27 deletions(-) diff --git a/gettext-runtime/m4/ChangeLog b/gettext-runtime/m4/ChangeLog index ed1e30641..e042c6576 100644 --- a/gettext-runtime/m4/ChangeLog +++ b/gettext-runtime/m4/ChangeLog @@ -1,3 +1,12 @@ +2010-12-04 Bruno Haible + + Put more information about failed tests into the test return codes. + * intdiv0.m4 (gt_INTDIV0): Change test program so that it returns an + enumerated value (0, 1, 2, 3, 4, ...). + * fcntl-o.m4 (gl_FCNTL_O_FLAGS): Change test program so that it returns + a bit mask. + * iconv.m4 (AM_ICONV_LINK): Likewise. + 2010-11-26 Bruno Haible * iconv.m4 (AM_ICONV): If the gnulib module 'iconv-h' is present, set diff --git a/gettext-runtime/m4/fcntl-o.m4 b/gettext-runtime/m4/fcntl-o.m4 index 1adacc8ab..46fad4702 100644 --- a/gettext-runtime/m4/fcntl-o.m4 +++ b/gettext-runtime/m4/fcntl-o.m4 @@ -1,4 +1,4 @@ -# fcntl-o.m4 serial 2 +# fcntl-o.m4 serial 3 dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -37,34 +37,61 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], }; ]], [[ - int status = !constants; + int result = !constants; { static char const sym[] = "conftest.sym"; - if (symlink (".", sym) != 0 - || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0) - status |= 32; + if (symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } unlink (sym); } { static char const file[] = "confdefs.h"; int fd = open (file, O_RDONLY | O_NOATIME); - char c; - struct stat st0, st1; - if (fd < 0 - || fstat (fd, &st0) != 0 - || sleep (1) != 0 - || read (fd, &c, 1) != 1 - || close (fd) != 0 - || stat (file, &st1) != 0 - || st0.st_atime != st1.st_atime) - status |= 64; + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } } - return status;]])], + return result;]])], [gl_cv_header_working_fcntl_h=yes], [case $? in #( - 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( - 96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( *) gl_cv_header_working_fcntl_h='no';; esac], [gl_cv_header_working_fcntl_h=cross-compiling])]) diff --git a/gettext-runtime/m4/iconv.m4 b/gettext-runtime/m4/iconv.m4 index 7d1959423..006c90780 100644 --- a/gettext-runtime/m4/iconv.m4 +++ b/gettext-runtime/m4/iconv.m4 @@ -1,4 +1,4 @@ -# iconv.m4 serial 16 (gettext-0.18.2) +# iconv.m4 serial 17 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -78,6 +78,7 @@ AC_DEFUN([AM_ICONV_LINK], #include int main () { + int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { @@ -94,7 +95,8 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 1; + iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from @@ -113,7 +115,8 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 2; + iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ @@ -131,7 +134,8 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) - return 1; + result |= 4; + iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ @@ -150,7 +154,8 @@ int main () (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) - return 1; + result |= 8; + iconv_close (cd_88591_to_utf8); } } #endif @@ -164,8 +169,8 @@ int main () && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; - return 0; + result |= 16; + return result; }]])], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], diff --git a/gettext-runtime/m4/intdiv0.m4 b/gettext-runtime/m4/intdiv0.m4 index 9b27ff1b7..562882def 100644 --- a/gettext-runtime/m4/intdiv0.m4 +++ b/gettext-runtime/m4/intdiv0.m4 @@ -1,4 +1,4 @@ -# intdiv0.m4 serial 4 (gettext-0.18.2) +# intdiv0.m4 serial 5 (gettext-0.18.2) dnl Copyright (C) 2002, 2007-2008, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -60,7 +60,7 @@ int main () z = x / y; nan = y / y; - exit (1); + exit (2); } ]])], [gt_cv_int_divbyzero_sigfpe=yes], -- 2.47.2