source: trunk/coreutils/m4/readutmp.m4@ 2747

Last change on this file since 2747 was 2554, checked in by bird, 20 years ago

coretuils-5.94

File size: 2.2 KB
Line 
1# readutmp.m4 serial 9
2dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_READUTMP],
8[
9 AC_LIBSOURCES([readutmp.c, readutmp.h])
10 AC_LIBOBJ([readutmp])
11
12 dnl Prerequisites of lib/readutmp.h and lib/readutmp.c.
13 AC_REQUIRE([AC_C_INLINE])
14 AC_REQUIRE([gl_FUNC_FREE])
15 AC_CHECK_HEADERS_ONCE(utmp.h utmpx.h)
16 AC_CHECK_FUNCS_ONCE(utmpname utmpxname)
17 AC_CHECK_DECLS(getutent,,,[
18#ifdef HAVE_UTMP_H
19# include <utmp.h>
20#endif
21])
22 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
23 utmp_includes="\
24$ac_includes_default
25#ifdef HAVE_UTMPX_H
26# include <utmpx.h>
27#endif
28#ifdef HAVE_UTMP_H
29# include <utmp.h>
30#endif
31"
32 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
33 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
34 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
35 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
36 AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
37 AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
38 AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
39 AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
40 AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
41 AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
42 AC_CHECK_MEMBERS([struct utmpx.ut_exit],,,[$utmp_includes])
43 AC_CHECK_MEMBERS([struct utmp.ut_exit],,,[$utmp_includes])
44
45 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
46 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
47 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
48 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
49
50 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
51 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
52 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
53 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
54 fi
55])
Note: See TracBrowser for help on using the repository browser.