~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to m4/perror.m4

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# perror.m4 serial 3
2
 
dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 
1
# perror.m4 serial 6
 
2
dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
27
27
           [AC_LANG_PROGRAM(
28
28
              [[#include <errno.h>
29
29
                #include <stdio.h>
 
30
                #include <stdlib.h>
 
31
                #include <string.h>
30
32
              ]],
31
33
              [[char *str = strerror (-1);
32
34
                if (!getenv("CONFTEST_OUTPUT")) return 0;
34
36
                puts (str);
35
37
                errno = -1;
36
38
                perror ("");
 
39
                return 0;
37
40
              ]])],
38
 
           [CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2
39
 
            if cmp conftest.txt1 conftest.txt2 >/dev/null; then
 
41
           [if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \
 
42
               && cmp conftest.txt1 conftest.txt2 >/dev/null; then
40
43
              gl_cv_func_perror_works=yes
41
44
            else
42
45
              gl_cv_func_perror_works=no
44
47
            rm -rf conftest.txt1 conftest.txt2],
45
48
           [gl_cv_func_perror_works=no],
46
49
           [dnl Guess no when cross-compiling.
47
 
            gl_cv_func_perror_works="guessing no"])])
48
 
       if test "$gl_cv_func_perror_works" != yes; then
49
 
         REPLACE_PERROR=1
50
 
       fi ;;
51
 
    *) dnl The system's perror() probably inherits the bugs in the
52
 
       dnl system's strerror_r(). Replace it.
53
 
      REPLACE_PERROR=1 ;;
 
50
            gl_cv_func_perror_works="guessing no"
 
51
           ])
 
52
        ])
 
53
      if test "$gl_cv_func_perror_works" != yes; then
 
54
        REPLACE_PERROR=1
 
55
      fi
 
56
      ;;
 
57
    *)
 
58
      dnl The system's perror() probably inherits the bugs in the
 
59
      dnl system's strerror_r(). Replace it.
 
60
      REPLACE_PERROR=1
 
61
      ;;
54
62
  esac
55
63
])