summaryrefslogtreecommitdiff
path: root/m4/readutmp.m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-08-17 17:58:01 +0000
committerJim Meyering <jim@meyering.net>2003-08-17 17:58:01 +0000
commit22e0b84f86ca7f9e0e426fd23066ec6d6666e716 (patch)
tree069903d92b379e78c329091c29b475fe34fcd28c /m4/readutmp.m4
parent69d741ae8e8fcd1c18c965bac6e7cf147e96361b (diff)
downloadcoreutils-22e0b84f86ca7f9e0e426fd23066ec6d6666e716.tar.xz
New file, from gnulib.
Diffstat (limited to 'm4/readutmp.m4')
-rw-r--r--m4/readutmp.m463
1 files changed, 63 insertions, 0 deletions
diff --git a/m4/readutmp.m4 b/m4/readutmp.m4
new file mode 100644
index 000000000..d6732d577
--- /dev/null
+++ b/m4/readutmp.m4
@@ -0,0 +1,63 @@
+# readutmp.m4 serial 2
+dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+AC_DEFUN([gl_READUTMP],
+[
+ dnl Prerequisites of lib/readutmp.h.
+ AC_CHECK_HEADERS_ONCE(sys/param.h)
+ AC_CHECK_HEADERS(utmp.h utmpx.h)
+ AC_CHECK_FUNCS(utmpname utmpxname)
+ AC_CHECK_DECLS(getutent,,,[
+#ifdef HAVE_UTMP_H
+# include <utmp.h>
+#endif
+])
+ if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
+ utmp_includes="\
+$ac_includes_default
+#ifdef HAVE_UTMPX_H
+# include <utmpx.h>
+#endif
+#ifdef HAVE_UTMP_H
+# include <utmp.h>
+#endif
+"
+ AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmpx.ut_exit],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmp.ut_exit],,,[$utmp_includes])
+
+ AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
+
+ AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
+ AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
+
+ AC_LIBOBJ(readutmp)
+ gl_PREREQ_READUTMP
+ fi
+])
+
+# Prerequisites of lib/readutmp.c.
+AC_DEFUN([gl_PREREQ_READUTMP],
+[
+ AC_REQUIRE([AC_HEADER_STDC])
+ AC_CHECK_HEADERS_ONCE(string.h)
+])