annotate m4/sys_resource_h.m4 @ 17602:f98ee53d8e71

tests: simplify porting to Solaris 10 /bin/sh Some test cases in 'grep' need a shell that groks '$('; export re_shell_ for their benefit. Problem reported for 'grep' by Dagobert Michelsen in <http://bugs.gnu.org/16380>. * tests/init.sh (re_shell_): Export if it's used.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 07 Jan 2014 11:46:27 -0800
parents 344018b6e5d7
children ab58d4870664
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16777
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
1 # sys_resource_h.m4 serial 2
17587
344018b6e5d7 maint: update copyright
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
2 dnl Copyright (C) 2012-2014 Free Software Foundation, Inc.
16775
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 AC_DEFUN([gl_HEADER_SYS_RESOURCE],
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 [
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 AC_REQUIRE([gl_SYS_RESOURCE_H_DEFAULTS])
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 dnl <sys/resource.h> is always overridden, because of GNULIB_POSIXCHECK.
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 gl_CHECK_NEXT_HEADERS([sys/resource.h])
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 if test $ac_cv_header_sys_resource_h = yes; then
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 HAVE_SYS_RESOURCE_H=1
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 else
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 HAVE_SYS_RESOURCE_H=0
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 fi
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 AC_SUBST([HAVE_SYS_RESOURCE_H])
16777
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
18
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
19 dnl Check for declarations of anything we want to poison if the
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
20 dnl corresponding gnulib module is not in use.
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
21 gl_WARN_ON_USE_PREPARE([[
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
22 #if HAVE_SYS_RESOURCE_H
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
23 /* At least FreeBSD 5.0 needs extra headers before <sys/resource.h>
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
24 will compile. */
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
25 # include <sys/types.h>
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
26 # include <sys/time.h>
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
27 # include <sys/resource.h>
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
28 #endif
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
29 ]],
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
30 [getrusage])
16775
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 ])
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 AC_DEFUN([gl_SYS_RESOURCE_MODULE_INDICATOR],
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 [
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 AC_REQUIRE([gl_SYS_RESOURCE_H_DEFAULTS])
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 dnl Define it also as a C macro, for the benefit of the unit tests.
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 gl_MODULE_INDICATOR_FOR_TESTS([$1])
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 ])
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 AC_DEFUN([gl_SYS_RESOURCE_H_DEFAULTS],
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 [
16777
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
44 GNULIB_GETRUSAGE=0; AC_SUBST([GNULIB_GETRUSAGE])
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
45 dnl Assume proper GNU behavior unless another module says otherwise.
30ef6011648b New module 'getrusage'.
Bruno Haible <bruno@clisp.org>
parents: 16775
diff changeset
46 HAVE_GETRUSAGE=1; AC_SUBST([HAVE_GETRUSAGE])
16775
fc64f4cef353 New module 'sys_resource'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 ])