~ubuntu-branches/ubuntu/vivid/diffutils/vivid

« back to all changes in this revision

Viewing changes to m4/strerror.m4

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2010-02-13 11:49:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100213114900-09lz8jx6wct52qp8
Tags: 1:2.9-1
* New upstream release, now under GPL version 3 or later.
* There is now a --tab-size option. Closes: #82923.
* Manpage for cmp describes exit status. Closes: #200614.
* Manpage for diff describes exit status. Closes: #228441, #473233.
* The file de.po is now more recent. Closes: #313686.
* Fixed bad sdiff behaviour. Closes: #320222.
* Added wdiff to Suggests. Closes: #324627.
* Fixed cmp behaviour regarding stdout and stderr. Closes: #356083.
* The file ru.po is now more recent. Closes: #409274.
* The file es.po is now more recent. Closes: #418005, #481708.
* The file nl.po is now more recent. Closes: #427370.
* Modified watch file to use http instead of ftp.
* Removed .comment section from executables.
* Added Homepage field to control file.

Show diffs side-by-side

added added

removed removed

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