Commit 1f8c872f authored by Bruno Haible's avatar Bruno Haible

Put more information about failed tests into the test return codes.

* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Change test
program so that it returns an enumerated value (0, 1, 2, 3, 4, ...).
* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise.
* m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.
* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Likewise.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Likewise.
* m4/getline.m4 (gl_FUNC_GETLINE): Likewise.
* m4/intdiv0.m4 (gt_INTDIV0): Likewise.
* m4/isapipe.m4 (gl_PREREQ_ISAPIPE): Likewise.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise.
* m4/posix_spawn.m4 (gl_POSIX_SPAWN_WORKS): Likewise.
* m4/putenv.m4 (gl_FUNC_PUTENV): Likewise.
* m4/sleep.m4 (gl_FUNC_SLEEP): Likewise.
* m4/stdint.m4 (gl_STDINT_H): Likewise.
* m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Change test program so that it
returns a bit mask.
* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Likewise.
* m4/chown.m4 (gl_FUNC_CHOWN_FOLLOWS_SYMLINK): Likewise.
* m4/dup2.m4 (gl_FUNC_DUP2): Likewise.
* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Likewise.
* m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Likewise.
* m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Likewise.
* m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Likewise.
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Likewise.
* m4/iconv.m4 (AM_ICONV_LINK): Likewise.
* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN_UTF): Likewise.
* m4/isfinite.m4 (gl_ISFINITEL_WORKS): Likewise.
* m4/isnanf.m4 (gl_ISNANF_WORKS): Likewise.
* m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Likewise.
* m4/ldexpl.m4 (gl_FUNC_LDEXPL_WORKS): Likewise.
* m4/link.m4 (gl_FUNC_LINK): Likewise.
* m4/linkat.m4 (gl_FUNC_LINKAT): Likewise.
* m4/mbrlen.m4 (gl_MBRLEN_RETVAL): Likewise.
* m4/mbrtowc.m4 (gl_MBRTOWC_RETVAL): Likewise.
* m4/mbsrtowcs.m4 (gl_MBSRTOWCS_WORKS): Likewise.
* m4/memchr.m4 (gl_FUNC_MEMCHR): Likewise.
* m4/memmem.m4 (gl_FUNC_MEMMEM): Likewise.
* m4/mkfifo.m4 (gl_FUNC_MKFIFO): Likewise.
* m4/mkstemp.m4 (gl_FUNC_MKSTEMP): Likewise.
* m4/mktime.m4 (AC_FUNC_MKTIME): Likewise.
* m4/open.m4 (gl_FUNC_OPEN): Likewise.
* m4/poll.m4 (gl_FUNC_POLL): Likewise.
* m4/popen.m4 (gl_FUNC_POPEN): Likewise.
* m4/printf.m4 (gl_PRINTF_SIZES_C99, gl_PRINTF_LONG_DOUBLE,
gl_PRINTF_INFINITE, gl_PRINTF_INFINITE_LONG_DOUBLE,
gl_PRINTF_DIRECTIVE_A, gl_PRINTF_DIRECTIVE_F, gl_PRINTF_DIRECTIVE_LS,
gl_PRINTF_PRECISION): Likewise.
* m4/regex.m4 (gl_REGEX): Likewise.
* m4/rename.m4 (gl_FUNC_RENAME): Likewise.
* m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise.
* m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE): Likewise.
* m4/stat.m4 (gl_FUNC_STAT): Likewise.
* m4/stpncpy.m4 (gl_FUNC_STPNCPY): Likewise.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR): Likewise.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Likewise.
* m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Likewise.
* m4/strstr.m4 (gl_FUNC_STRSTR): Likewise.
* m4/strtod.m4 (gl_FUNC_STRTOD): Likewise.
* m4/symlink.m4 (gl_FUNC_SYMLINK): Likewise.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Likewise.
* m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Likewise.
* m4/unlink-busy.m4 (gl_FUNC_UNLINK_BUSY_TEXT): Likewise.
* m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise.
* m4/utimes.m4 (gl_FUNC_UTIMES): Likewise.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Likewise.
* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise.
* m4/signbit.m4 (gl_SIGNBIT_TEST_PROGRAM): Likewise.
(gl_FLOATTYPE_SIGN_LOCATION): Change test program so that it returns an
enumerated value.
* m4/acl.m4 (gl_ACL_GET_FILE): Use "if ... return 1; return 0;" style.
parent e8eabe5a
2010-12-04 Bruno Haible <bruno@clisp.org>
Put more information about failed tests into the test return codes.
* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Change test
program so that it returns an enumerated value (0, 1, 2, 3, 4, ...).
* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise.
* m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.
* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Likewise.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Likewise.
* m4/getline.m4 (gl_FUNC_GETLINE): Likewise.
* m4/intdiv0.m4 (gt_INTDIV0): Likewise.
* m4/isapipe.m4 (gl_PREREQ_ISAPIPE): Likewise.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise.
* m4/posix_spawn.m4 (gl_POSIX_SPAWN_WORKS): Likewise.
* m4/putenv.m4 (gl_FUNC_PUTENV): Likewise.
* m4/sleep.m4 (gl_FUNC_SLEEP): Likewise.
* m4/stdint.m4 (gl_STDINT_H): Likewise.
* m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Change test program so that it
returns a bit mask.
* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Likewise.
* m4/chown.m4 (gl_FUNC_CHOWN_FOLLOWS_SYMLINK): Likewise.
* m4/dup2.m4 (gl_FUNC_DUP2): Likewise.
* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Likewise.
* m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Likewise.
* m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Likewise.
* m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Likewise.
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Likewise.
* m4/iconv.m4 (AM_ICONV_LINK): Likewise.
* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN_UTF): Likewise.
* m4/isfinite.m4 (gl_ISFINITEL_WORKS): Likewise.
* m4/isnanf.m4 (gl_ISNANF_WORKS): Likewise.
* m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Likewise.
* m4/ldexpl.m4 (gl_FUNC_LDEXPL_WORKS): Likewise.
* m4/link.m4 (gl_FUNC_LINK): Likewise.
* m4/linkat.m4 (gl_FUNC_LINKAT): Likewise.
* m4/mbrlen.m4 (gl_MBRLEN_RETVAL): Likewise.
* m4/mbrtowc.m4 (gl_MBRTOWC_RETVAL): Likewise.
* m4/mbsrtowcs.m4 (gl_MBSRTOWCS_WORKS): Likewise.
* m4/memchr.m4 (gl_FUNC_MEMCHR): Likewise.
* m4/memmem.m4 (gl_FUNC_MEMMEM): Likewise.
* m4/mkfifo.m4 (gl_FUNC_MKFIFO): Likewise.
* m4/mkstemp.m4 (gl_FUNC_MKSTEMP): Likewise.
* m4/mktime.m4 (AC_FUNC_MKTIME): Likewise.
* m4/open.m4 (gl_FUNC_OPEN): Likewise.
* m4/poll.m4 (gl_FUNC_POLL): Likewise.
* m4/popen.m4 (gl_FUNC_POPEN): Likewise.
* m4/printf.m4 (gl_PRINTF_SIZES_C99, gl_PRINTF_LONG_DOUBLE,
gl_PRINTF_INFINITE, gl_PRINTF_INFINITE_LONG_DOUBLE,
gl_PRINTF_DIRECTIVE_A, gl_PRINTF_DIRECTIVE_F, gl_PRINTF_DIRECTIVE_LS,
gl_PRINTF_PRECISION): Likewise.
* m4/regex.m4 (gl_REGEX): Likewise.
* m4/rename.m4 (gl_FUNC_RENAME): Likewise.
* m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise.
* m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE): Likewise.
* m4/stat.m4 (gl_FUNC_STAT): Likewise.
* m4/stpncpy.m4 (gl_FUNC_STPNCPY): Likewise.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR): Likewise.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Likewise.
* m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Likewise.
* m4/strstr.m4 (gl_FUNC_STRSTR): Likewise.
* m4/strtod.m4 (gl_FUNC_STRTOD): Likewise.
* m4/symlink.m4 (gl_FUNC_SYMLINK): Likewise.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Likewise.
* m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Likewise.
* m4/unlink-busy.m4 (gl_FUNC_UNLINK_BUSY_TEXT): Likewise.
* m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise.
* m4/utimes.m4 (gl_FUNC_UTIMES): Likewise.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Likewise.
* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise.
* m4/signbit.m4 (gl_SIGNBIT_TEST_PROGRAM): Likewise.
(gl_FLOATTYPE_SIGN_LOCATION): Change test program so that it returns an
enumerated value.
* m4/acl.m4 (gl_ACL_GET_FILE): Use "if ... return 1; return 0;" style.
2010-12-04 Bruno Haible <bruno@clisp.org>
Update for Solaris 11 2010-11.
# acl.m4 - check for access control list (ACL) primitives
# serial 11
# serial 12
# Copyright (C) 2002, 2004-2010 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
......@@ -151,8 +151,10 @@ AC_DEFUN([gl_ACL_GET_FILE],
#include <sys/acl.h>
#include <errno.h>
]],
[[return !! (!acl_get_file (".", ACL_TYPE_ACCESS)
&& errno == ENOENT);]])],
[[if (!acl_get_file (".", ACL_TYPE_ACCESS) && errno == ENOENT)
return 1;
return 0;
]])],
[gl_cv_func_working_acl_get_file=yes],
[gl_cv_func_working_acl_get_file=no],
[gl_cv_func_working_acl_get_file=cross-compiling])])
......
......@@ -8,7 +8,7 @@
# Written by Paul Eggert.
# serial 11
# serial 12
AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
[# for STACK_DIRECTION
......@@ -77,16 +77,18 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
st.ss_size = SIGSTKSZ;
r = sigaltstack (&st, 0);
if (r != 0)
return r;
return 1;
sigemptyset (&act.sa_mask);
act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND;
act.sa_handler = segv_handler;
#if FAULT_YIELDS_SIGBUS
if (sigaction (SIGBUS, &act, 0) < 0)
return -1;
return 2;
#endif
return sigaction (SIGSEGV, &act, 0);
if (sigaction (SIGSEGV, &act, 0) < 0)
return 3;
return 0;
}
static volatile int *
recurse_1 (volatile int n, volatile int *p)
......@@ -104,6 +106,7 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
int
main ()
{
int result;
#if HAVE_SETRLIMIT && defined RLIMIT_STACK
/* Before starting the endless recursion, try to be friendly
to the user's machine. On some Linux 2.2.x systems, there
......@@ -114,7 +117,10 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
setrlimit (RLIMIT_STACK, &rl);
#endif
return c_stack_action () || recurse (0);
result = c_stack_action ();
if (result != 0)
return result;
return recurse (0);
}
]])],
[ac_cv_sys_stack_overflow_works=yes],
......@@ -177,7 +183,7 @@ int main ()
exit(3);
/* Provoke a SIGSEGV. */
raise (SIGSEGV);
exit (3);
exit (4);
}]])],
[gl_cv_sigaltstack_low_base=yes],
[gl_cv_sigaltstack_low_base=no],
......@@ -245,9 +251,9 @@ int main ()
s += page_size;
if (s < stack_size + page_size)
_exit (0);
_exit (4);
}
_exit (1);
_exit (5);
}
static int
......@@ -263,16 +269,18 @@ int main ()
st.ss_size = SIGSTKSZ;
r = sigaltstack (&st, 0);
if (r != 0)
return r;
return 1;
sigemptyset (&act.sa_mask);
act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
act.sa_sigaction = segv_handler;
#if FAULT_YIELDS_SIGBUS
if (sigaction (SIGBUS, &act, 0) < 0)
return -1;
return 2;
#endif
return sigaction (SIGSEGV, &act, 0);
if (sigaction (SIGSEGV, &act, 0) < 0)
return 3;
return 0;
}
static volatile int *
recurse_1 (volatile int n, volatile int *p)
......@@ -290,6 +298,7 @@ int main ()
int
main ()
{
int result;
#if HAVE_SETRLIMIT && defined RLIMIT_STACK
/* Before starting the endless recursion, try to be friendly
to the user's machine. On some Linux 2.2.x systems, there
......@@ -300,7 +309,10 @@ int main ()
setrlimit (RLIMIT_STACK, &rl);
#endif
return c_stack_action () || recurse (0);
result = c_stack_action ();
if (result != 0)
return result;
return recurse (0);
}
]])],
[ac_cv_sys_xsi_stack_overflow_heuristic=yes],
......
# calloc.m4 serial 11
# calloc.m4 serial 12
# Copyright (C) 2004-2010 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
......@@ -16,14 +16,24 @@
# -------------------------------------
# If `calloc (0, 0)' is properly handled, run IF-WORKS, otherwise, IF-NOT.
AC_DEFUN([_AC_FUNC_CALLOC_IF],
[AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_CACHE_CHECK([for GNU libc compatible calloc], [ac_cv_func_calloc_0_nonnull],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[exit (!calloc (0, 0) || calloc ((size_t) -1 / 8 + 1, 8));]])],
[ac_cv_func_calloc_0_nonnull=yes],
[ac_cv_func_calloc_0_nonnull=no],
[ac_cv_func_calloc_0_nonnull=no])])
AS_IF([test $ac_cv_func_calloc_0_nonnull = yes], [$1], [$2])
[
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_CACHE_CHECK([for GNU libc compatible calloc],
[ac_cv_func_calloc_0_nonnull],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[AC_INCLUDES_DEFAULT],
[[int result = 0;
if (!calloc (0, 0))
result |= 1;
if (calloc ((size_t) -1 / 8 + 1, 8))
result |= 2;
return result;
]])],
[ac_cv_func_calloc_0_nonnull=yes],
[ac_cv_func_calloc_0_nonnull=no],
[ac_cv_func_calloc_0_nonnull=no])])
AS_IF([test $ac_cv_func_calloc_0_nonnull = yes], [$1], [$2])
])# AC_FUNC_CALLOC
......
# canonicalize.m4 serial 16
# canonicalize.m4 serial 17
dnl Copyright (C) 2003-2007, 2009-2010 Free Software Foundation, Inc.
......@@ -65,10 +65,23 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
AC_LANG_PROGRAM([[
#include <stdlib.h>
]], [[
char *name1 = realpath ("conftest.a", NULL);
char *name2 = realpath ("conftest.b/../conftest.a", NULL);
char *name3 = realpath ("conftest.a/", NULL);
return !(name1 && *name1 == '/' && !name2 && !name3);
int result = 0;
{
char *name = realpath ("conftest.a", NULL);
if (!(name && *name == '/'))
result |= 1;
}
{
char *name = realpath ("conftest.b/../conftest.a", NULL);
if (name != NULL)
result |= 2;
}
{
char *name = realpath ("conftest.a/", NULL);
if (name != NULL)
result |= 4;
}
return result;
]])
], [gl_cv_func_realpath_works=yes], [gl_cv_func_realpath_works=no],
[gl_cv_func_realpath_works="guessing no"])
......
# serial 23
# serial 24
# Determine whether we need the chown wrapper.
dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2010 Free Software
......@@ -114,6 +114,7 @@ AC_DEFUN_ONCE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK],
int
main ()
{
int result = 0;
char const *dangling_symlink = "conftest.dangle";
unlink (dangling_symlink);
......@@ -122,8 +123,11 @@ AC_DEFUN_ONCE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK],
/* Exit successfully on a conforming system,
i.e., where chown must fail with ENOENT. */
exit ( ! (chown (dangling_symlink, getuid (), getgid ()) != 0
&& errno == ENOENT));
if (chown (dangling_symlink, getuid (), getgid ()) == 0)
result |= 1;
if (errno != ENOENT)
result |= 2;
return result;
}
]])],
[gl_cv_func_chown_follows_symlink=yes],
......
# serial 11
# serial 12
dnl From Jim Meyering.
dnl
......@@ -27,12 +27,17 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
if (! dp)
return 1;
e = readdir (dp);
return ! (e
&& stat (e->d_name, &st) == 0
&& e->d_ino == st.st_ino);]])],
[gl_cv_struct_dirent_d_ino=yes],
[gl_cv_struct_dirent_d_ino=no],
[gl_cv_struct_dirent_d_ino=no])])
if (! e)
return 2;
if (stat (e->d_name, &st) != 0)
return 3;
if (e->d_ino != st.st_ino)
return 4;
return 0;
]])],
[gl_cv_struct_dirent_d_ino=yes],
[gl_cv_struct_dirent_d_ino=no],
[gl_cv_struct_dirent_d_ino=no])])
if test $gl_cv_struct_dirent_d_ino = yes; then
AC_DEFINE([D_INO_IN_DIRENT], [1],
[Define if struct dirent has a member d_ino that actually works.])
......
#serial 10
#serial 11
dnl Copyright (C) 2002, 2005, 2007, 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,
......@@ -17,15 +17,16 @@ AC_DEFUN([gl_FUNC_DUP2],
[AC_RUN_IFELSE([
AC_LANG_PROGRAM([[#include <unistd.h>
#include <errno.h>]],
[if (dup2 (1, 1) == 0)
return 1;
[int result = 0;
if (dup2 (1, 1) == 0)
result |= 1;
close (0);
if (dup2 (0, 0) != -1)
return 2;
result |= 2;
/* Many gnulib modules require POSIX conformance of EBADF. */
if (dup2 (1, 1000000) == -1 && errno != EBADF)
return 3;
return 0;
result |= 4;
return result;
])
],
[gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
......
# 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])])
......
# Check for fnmatch - serial 4.
# Check for fnmatch - serial 5.
# Copyright (C) 2000-2007, 2009-2010 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
......@@ -60,33 +60,60 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
static char const a01[] = { 'a' + 1, 0 };
static char const bs_1[] = { '\\\\' - 1, 0 };
static char const bs01[] = { '\\\\' + 1, 0 };
return
!(n ("a*", "", 0)
&& y ("a*", "abc", 0)
&& n ("d*/*1", "d/s/1", FNM_PATHNAME)
&& y ("a\\\\bc", "abc", 0)
&& n ("a\\\\bc", "abc", FNM_NOESCAPE)
&& y ("*x", ".x", 0)
&& n ("*x", ".x", FNM_PERIOD)
&& y (Apat, "\\\\", 0) && y (Apat, "A", 0)
&& y (apat, "\\\\", 0) && y (apat, "a", 0)
&& n (Apat, A_1, 0) == ('A' < '\\\\')
&& n (apat, a_1, 0) == ('a' < '\\\\')
&& y (Apat, A01, 0) == ('A' < '\\\\')
&& y (apat, a01, 0) == ('a' < '\\\\')
&& y (Apat, bs_1, 0) == ('A' < '\\\\')
&& y (apat, bs_1, 0) == ('a' < '\\\\')
&& n (Apat, bs01, 0) == ('A' < '\\\\')
&& n (apat, bs01, 0) == ('a' < '\\\\')
$gl_fnmatch_gnu_start
&& y ("xxXX", "xXxX", FNM_CASEFOLD)
&& y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)
&& n ("d*/*1", "d/s/1", FNM_FILE_NAME)
&& y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)
&& y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)
&& y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)
$gl_fnmatch_gnu_end
);
int result = 0;
if (!n ("a*", "", 0))
return 1;
if (!y ("a*", "abc", 0))
return 1;
if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
return 2;
if (!y ("a\\\\bc", "abc", 0))
return 3;
if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
return 3;
if (!y ("*x", ".x", 0))
return 4;
if (!n ("*x", ".x", FNM_PERIOD))
return 4;
if (!y (Apat, "\\\\", 0))
return 5;
if (!y (Apat, "A", 0))
return 5;
if (!y (apat, "\\\\", 0))
return 5;
if (!y (apat, "a", 0))
return 5;
if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
return 5;
if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
return 5;
if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
return 5;
if (!(y (apat, a01, 0) == ('a' < '\\\\')))
return 5;
if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
return 5;
if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
return 5;
if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
return 5;
if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
return 5;
$gl_fnmatch_gnu_start
if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
result |= 8;
if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
result |= 16;
if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
result |= 32;
if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
result |= 64;
if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
result |= 64;
if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
result |= 64;
$gl_fnmatch_gnu_end
return result;
]])],
[eval "$gl_fnmatch_cache_var=yes"],
[eval "$gl_fnmatch_cache_var=no"],
......
# frexp.m4 serial 9
# frexp.m4 serial 10
dnl Copyright (C) 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,
......@@ -120,6 +120,7 @@ double minus_zero = -0.0;
#endif
int main()
{
int result = 0;
int i;
volatile double x;
double zero = 0.0;
......@@ -133,7 +134,7 @@ int main()
/* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
On NetBSD: y = 0.75. Correct: y = 0.5. */
if (y != 0.5)
return 1;
result |= 1;
}
/* Test on infinite numbers. */
x = 1.0 / 0.0;
......@@ -141,7 +142,7 @@ int main()
int exp;
double y = frexp (x, &exp);
if (y != x)
return 1;
result |= 2;
}
/* Test on negative zero. */
x = minus_zero;
......@@ -149,9 +150,9 @@ int main()
int exp;
double y = frexp (x, &exp);
if (memcmp (&y, &x, sizeof x))
return 1;
result |= 4;
}
return 0;
return result;
}]])],
[gl_cv_func_frexp_works=yes],
[gl_cv_func_frexp_works=no],
......
# frexpl.m4 serial 12
# frexpl.m4 serial 13
dnl Copyright (C) 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,
......@@ -124,6 +124,7 @@ AC_DEFUN([gl_FUNC_FREXPL_WORKS],
extern long double frexpl (long double, int *);
int main()
{
int result = 0;
volatile long double x;
/* Test on finite numbers that fails on AIX 5.1. */
x = 16.0L;
......@@ -131,7 +132,7 @@ int main()
int exp = -9999;
frexpl (x, &exp);
if (exp != 5)
return 1;
result |= 1;
}
/* Test on finite numbers that fails on MacOS X 10.4, because its frexpl
function returns an invalid (incorrectly normalized) value: it returns
......@@ -143,7 +144,7 @@ int main()
int exp = -9999;
long double y = frexpl (x, &exp);
if (!(exp == 1 && y == 0.505L))
return 1;
result |= 2;
}
/* Test on large finite numbers. This fails on BeOS at i = 16322, while
LDBL_MAX_EXP = 16384.
......@@ -156,7 +157,10 @@ int main()
int exp = -9999;
frexpl (x, &exp);
if (exp != i)
return 1;
{
result |= 4;
break;
}
}
}
/* Test on denormalized numbers. */
......@@ -171,7 +175,7 @@ int main()
/* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */
if (exp != LDBL_MIN_EXP - 1)
return 1;
result |= 8;
}
}
/* Test on infinite numbers. */
......@@ -180,9 +184,9 @@ int main()
int exp;
long double y = frexpl (x, &exp);
if (y != x)
return 1;
result |= 16;
}
return 0;
return result;
}]])],
[gl_cv_func_frexpl_works=yes],
[gl_cv_func_frexpl_works=no],
......
# serial 14
# serial 15
# Check for several getcwd bugs with long file names.
# If so, arrange to compile the wrapper function.
......@@ -85,7 +85,7 @@ main ()
size_t n_chdirs = 0;
if (cwd == NULL)
exit (1);
exit (10);
cwd_len = initial_cwd_len = strlen (cwd);
......@@ -103,7 +103,7 @@ main ()
if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
{
if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
fail = 2;
fail = 20;
break;
}
......@@ -112,12 +112,12 @@ main ()
c = getcwd (buf, PATH_MAX);
if (!c && errno == ENOENT)
{
fail = 1;
fail = 11;
break;
}
if (c || ! (errno == ERANGE || is_ENAMETOOLONG (errno)))
{
fail = 2;
fail = 21;
break;
}
}
......@@ -132,12 +132,12 @@ main ()
if (! (errno == ERANGE || errno == ENOENT
|| is_ENAMETOOLONG (errno)))
{
fail = 2;
fail = 22;
break;
}
if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
{
fail = 1;
fail = 12;
break;
}
}
......@@ -145,7 +145,7 @@ main ()
if (c && strlen (c) != cwd_len)
{
fail = 2;
fail = 23;
break;
}
++n_chdirs;
......@@ -174,7 +174,7 @@ main ()
]])],
[gl_cv_func_getcwd_path_max=yes],
[case $? in
1) gl_cv_func_getcwd_path_max='no, but it is partly working';;
10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
*) gl_cv_func_getcwd_path_max=no;;
esac],
[gl_cv_func_getcwd_path_max=no])
......
......@@ -7,7 +7,7 @@
# with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert.
# serial 2
# serial 3
AC_DEFUN([gl_FUNC_GETCWD_NULL],
[
......@@ -27,7 +27,13 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
else
{
char *f = getcwd (NULL, 0);
return ! (f && f[0] == '/' && !f[1]);
if (! f)
return 2;
if (f[0] != '/')
return 3;
if (f[1] != '\0')
return 4;
return 0;
}
#endif
]])],
......
# getdelim.m4 serial 7
# getdelim.m4 serial 8
dnl Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
dnl
......@@ -38,7 +38,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
size_t siz = 0;
int len = getdelim (&line, &siz, '\n', in);
if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
return 1;
return 2;
}
{
/* Test result for a NULL buffer and a non-zero size.
......@@ -46,7 +46,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
char *line = NULL;
size_t siz = (size_t)(~0) / 4;
if (getdelim (&line, &siz, '\n', in) == -1)
return 1;
return 3;
}
return 0;
}
......
# getline.m4 serial 22
# getline.m4 serial 23
dnl Copyright (C) 1998-2003, 2005-2007, 2009-2010 Free Software Foundation,
dnl Inc.
......@@ -46,7 +46,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
size_t siz = 0;
int len = getline (&line, &siz, in);
if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
return 1;
return 2;
}
{
/* Test result for a NULL buffer and a non-zero size.
......