annotate m4/link.m4 @ 13918:d5a74c6ec06b

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.
author Bruno Haible <bruno@clisp.org>
date Mon, 06 Dec 2010 22:57:23 +0100
parents c2cbabec01dd
children 97fc9a21a8fb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13918
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
1 # link.m4 serial 5
12559
c2cbabec01dd update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents: 12263
diff changeset
2 dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
11041
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
6
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
7 AC_DEFUN([gl_FUNC_LINK],
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
8 [
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
10 AC_CHECK_FUNCS_ONCE([link])
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
11 if test $ac_cv_func_link = no; then
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
12 HAVE_LINK=0
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
13 AC_LIBOBJ([link])
11981
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
14 else
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
15 AC_CACHE_CHECK([whether link handles trailing slash correctly],
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
16 [gl_cv_func_link_works],
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
17 [touch conftest.a
12263
c689d1419da9 link: detect FreeBSD bug
Eric Blake <ebb9@byu.net>
parents: 12048
diff changeset
18 # Assume that if we have lstat, we can also check symlinks.
c689d1419da9 link: detect FreeBSD bug
Eric Blake <ebb9@byu.net>
parents: 12048
diff changeset
19 if test $ac_cv_func_lstat = yes; then
c689d1419da9 link: detect FreeBSD bug
Eric Blake <ebb9@byu.net>
parents: 12048
diff changeset
20 ln -s conftest.a conftest.lnk
c689d1419da9 link: detect FreeBSD bug
Eric Blake <ebb9@byu.net>
parents: 12048
diff changeset
21 fi
11981
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
22 AC_RUN_IFELSE(
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
23 [AC_LANG_PROGRAM(
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
24 [[#include <unistd.h>
13918
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
25 ]],
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
26 [[int result = 0;
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
27 if (!link ("conftest.a", "conftest.b/"))
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
28 result |= 1;
12263
c689d1419da9 link: detect FreeBSD bug
Eric Blake <ebb9@byu.net>
parents: 12048
diff changeset
29 #if HAVE_LSTAT
13918
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
30 if (!link ("conftest.lnk/", "conftest.b"))
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
31 result |= 2;
12263
c689d1419da9 link: detect FreeBSD bug
Eric Blake <ebb9@byu.net>
parents: 12048
diff changeset
32 #endif
13918
d5a74c6ec06b Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
33 return result;
12263
c689d1419da9 link: detect FreeBSD bug
Eric Blake <ebb9@byu.net>
parents: 12048
diff changeset
34 ]])],
11981
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
35 [gl_cv_func_link_works=yes], [gl_cv_func_link_works=no],
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
36 [gl_cv_func_link_works="guessing no"])
12263
c689d1419da9 link: detect FreeBSD bug
Eric Blake <ebb9@byu.net>
parents: 12048
diff changeset
37 rm -f conftest.a conftest.b conftest.lnk])
12048
0f01e7ffb856 link: fix quoting
Eric Blake <ebb9@byu.net>
parents: 11981
diff changeset
38 if test "$gl_cv_func_link_works" != yes; then
11981
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
39 REPLACE_LINK=1
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
40 AC_LIBOBJ([link])
7e5f9267c62e link: fix platform bugs
Eric Blake <ebb9@byu.net>
parents: 11041
diff changeset
41 fi
11041
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
42 fi
894d336e6216 New module 'link'.
Martin Lambers <marlam@marlam.de>
parents:
diff changeset
43 ])