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

« back to all changes in this revision

Viewing changes to m4/sys_resource_h.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
# sys_resource_h.m4 serial 2
 
2
dnl Copyright (C) 2012 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_HEADER_SYS_RESOURCE],
 
8
[
 
9
  AC_REQUIRE([gl_SYS_RESOURCE_H_DEFAULTS])
 
10
  dnl <sys/resource.h> is always overridden, because of GNULIB_POSIXCHECK.
 
11
  gl_CHECK_NEXT_HEADERS([sys/resource.h])
 
12
  if test $ac_cv_header_sys_resource_h = yes; then
 
13
    HAVE_SYS_RESOURCE_H=1
 
14
  else
 
15
    HAVE_SYS_RESOURCE_H=0
 
16
  fi
 
17
  AC_SUBST([HAVE_SYS_RESOURCE_H])
 
18
 
 
19
  dnl Check for declarations of anything we want to poison if the
 
20
  dnl corresponding gnulib module is not in use.
 
21
  gl_WARN_ON_USE_PREPARE([[
 
22
#if HAVE_SYS_RESOURCE_H
 
23
/* At least FreeBSD 5.0 needs extra headers before <sys/resource.h>
 
24
   will compile.  */
 
25
# include <sys/types.h>
 
26
# include <sys/time.h>
 
27
# include <sys/resource.h>
 
28
#endif
 
29
    ]],
 
30
    [getrusage])
 
31
])
 
32
 
 
33
AC_DEFUN([gl_SYS_RESOURCE_MODULE_INDICATOR],
 
34
[
 
35
  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
 
36
  AC_REQUIRE([gl_SYS_RESOURCE_H_DEFAULTS])
 
37
  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
 
38
  dnl Define it also as a C macro, for the benefit of the unit tests.
 
39
  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 
40
])
 
41
 
 
42
AC_DEFUN([gl_SYS_RESOURCE_H_DEFAULTS],
 
43
[
 
44
  GNULIB_GETRUSAGE=0;     AC_SUBST([GNULIB_GETRUSAGE])
 
45
  dnl Assume proper GNU behavior unless another module says otherwise.
 
46
  HAVE_GETRUSAGE=1;       AC_SUBST([HAVE_GETRUSAGE])
 
47
])