annotate m4/strerror.m4 @ 267:bec6d2480f08 2.6

Added add'l generated files for release
author lost
date Tue, 22 Dec 2009 05:33:32 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
267
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
1 # strerror.m4 serial 9
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
2 dnl Copyright (C) 2002, 2007-2008 Free Software Foundation, Inc.
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
6
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
7 AC_DEFUN([gl_FUNC_STRERROR],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
8 [
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
9 AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
10 if test $REPLACE_STRERROR = 1; then
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
11 AC_LIBOBJ([strerror])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
12 AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
13 [Define this to 1 if strerror is broken.])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
14 fi
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
15 ])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
16
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
17 # Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ).
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
18 AC_DEFUN([gl_FUNC_STRERROR_SEPARATE],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
19 [
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
20 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
21 AC_REQUIRE([gl_HEADER_ERRNO_H])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
22 if test -z "$ERRNO_H"; then
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
23 AC_CACHE_CHECK([for working strerror function],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
24 [gl_cv_func_working_strerror],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
25 [AC_RUN_IFELSE(
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
26 [AC_LANG_PROGRAM(
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
27 [[#include <string.h>
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
28 ]],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
29 [[return !*strerror (-2);]])],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
30 [gl_cv_func_working_strerror=yes],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
31 [gl_cv_func_working_strerror=no],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
32 [dnl Assume crossbuild works if it compiles.
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
33 AC_COMPILE_IFELSE(
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
34 [AC_LANG_PROGRAM(
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
35 [[#include <string.h>
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
36 ]],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
37 [[return !*strerror (-2);]])],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
38 [gl_cv_func_working_strerror=yes],
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
39 [gl_cv_func_working_strerror=no])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
40 ])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
41 ])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
42 if test $gl_cv_func_working_strerror = no; then
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
43 dnl The system's strerror() fails to return a string for out-of-range
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
44 dnl integers. Replace it.
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
45 REPLACE_STRERROR=1
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
46 fi
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
47 else
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
48 dnl The system's strerror() cannot know about the new errno values we add
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
49 dnl to <errno.h>. Replace it.
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
50 REPLACE_STRERROR=1
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
51 fi
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
52 if test $REPLACE_STRERROR = 1; then
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
53 gl_PREREQ_STRERROR
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
54 fi
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
55 ])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
56
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
57 # Prerequisites of lib/strerror.c.
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
58 AC_DEFUN([gl_PREREQ_STRERROR], [
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
59 AC_CHECK_DECLS([strerror])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
60 AC_CHECK_HEADERS_ONCE([sys/socket.h])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
61 if test $ac_cv_header_sys_socket_h != yes; then
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
62 dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
63 dnl the check for those headers unconditional; yet cygwin reports
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
64 dnl that the headers are present but cannot be compiled (since on
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
65 dnl cygwin, all socket information should come from sys/socket.h).
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
66 AC_CHECK_HEADERS([winsock2.h])
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
67 fi
bec6d2480f08 Added add'l generated files for release
lost
parents:
diff changeset
68 ])