sys_times, sys_utsname: use include_next
[gnulib.git] / m4 / sys_times_h.m4
1 # Configure a replacement for <sys/times.h>.
2 # serial 2
3
4 # Copyright (C) 2008, 2009 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # Written by Simon Josefsson.
10
11 AC_DEFUN([gl_SYS_TIMES_H],
12 [
13   AC_REQUIRE([gl_SYS_TIMES_H_DEFAULTS])
14
15   gl_CHECK_NEXT_HEADERS([sys/times.h])
16   AC_CHECK_HEADERS_ONCE([sys/times.h])
17   if test $ac_cv_header_sys_times_h = yes; then
18     SYS_TIMES_H=
19     HAVE_SYS_TIMES_H=1
20     AC_CHECK_TYPES([struct tms], [], [HAVE_STRUCT_TMS=0], [[
21 #include <sys/times.h>
22       ]])
23   else
24     SYS_TIMES_H=sys/times.h
25     HAVE_SYS_TIMES_H=0
26     HAVE_STRUCT_TMS=0
27   fi
28   AC_SUBST([SYS_TIMES_H])
29   AC_SUBST([HAVE_SYS_TIMES_H])
30 ])
31
32 AC_DEFUN([gl_SYS_TIMES_MODULE_INDICATOR],
33 [
34   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
35   AC_REQUIRE([gl_SYS_TIMES_H_DEFAULTS])
36   GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
37 ])
38
39 AC_DEFUN([gl_SYS_TIMES_H_DEFAULTS],
40 [
41   GNULIB_TIMES=0;     AC_SUBST([GNULIB_TIMES])
42   HAVE_STRUCT_TMS=1;  AC_SUBST([HAVE_STRUCT_TMS])
43   HAVE_TIMES=1;       AC_SUBST([HAVE_TIMES])
44 ])