(gl_READUTMP): Don't check for sys/param.h.
[gnulib.git] / m4 / readutmp.m4
1 # readutmp.m4 serial 5
2 dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License.  As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
8
9 AC_DEFUN([gl_READUTMP],
10 [
11   dnl Prerequisites of lib/readutmp.h.
12   AC_CHECK_HEADERS(utmp.h utmpx.h)
13   AC_CHECK_FUNCS(utmpname utmpxname)
14   AC_CHECK_DECLS(getutent,,,[
15 #ifdef HAVE_UTMP_H
16 # include <utmp.h>
17 #endif
18 ])
19   if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
20     utmp_includes="\
21 $ac_includes_default
22 #ifdef HAVE_UTMPX_H
23 # include <utmpx.h>
24 #endif
25 #ifdef HAVE_UTMP_H
26 # include <utmp.h>
27 #endif
28 "
29     AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
30     AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
31     AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
32     AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
33     AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
34     AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
35     AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
36     AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
37     AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
38     AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
39     AC_CHECK_MEMBERS([struct utmpx.ut_exit],,,[$utmp_includes])
40     AC_CHECK_MEMBERS([struct utmp.ut_exit],,,[$utmp_includes])
41
42     AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
43     AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
44     AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
45     AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
46
47     AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
48     AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
49     AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
50     AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
51
52     AC_LIBOBJ(readutmp)
53     gl_PREREQ_READUTMP
54   fi
55 ])
56
57 # Prerequisites of lib/readutmp.c.
58 AC_DEFUN([gl_PREREQ_READUTMP],
59 [
60   AC_REQUIRE([gl_FUNC_FREE])
61 ])