annotate m4/strerror.m4 @ 421:3c2e1f24cc7d 3.0-beta2

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