1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2026-10-24 00:48:56 +03:00
Files
gnulib/m4/wtmpdb.m4
Bruno Haible e7714db1af readutmp: Add option to make use of wtmpdb.
* m4/wtmpdb.m4: New file.
* m4/readutmp.m4 (gl_READUTMP): Invoke gl_WTMPDB_CHOICE. Define
READUTMP_USE_WTMPDB. Take it into account for READUTMP_LIB.
* lib/readutmp.h (WTMPDB_FILE): New macro.
* lib/readutmp.c: Include <wtmpdb.h>.
(wtmpdb_time_to_timespec): New function.
(struct wtmpdb_locals): New type.
(wtmpdb_callback, read_utmp_from_wtmpdb): New functions.
(read_utmp): For WTMP_FILE, conditionally use read_utmp_from_wtmpdb.
* modules/readutmp (Files): Add m4/wtmpdb.m4.
(Depends-on): Add str_endswith.
* DEPENDENCIES: Mention libwtmpdb.
2026-08-04 17:03:56 +02:00

26 lines
885 B
Plaintext

# wtmpdb.m4
# serial 1
dnl Copyright (C) 2026 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This file is offered as-is, without any warranty.
# Sets WTMPDB_CHOICE to 'yes' or 'no', depending on the preferred use of
# wtmpdb APIs.
AC_DEFUN([gl_WTMPDB_CHOICE],
[
AC_MSG_CHECKING([whether to use wtmpdb APIs])
AC_ARG_WITH([wtmpdb],
[ --with-wtmpdb use wtmpdb APIs],
[WTMPDB_CHOICE="$withval"],
[WTMPDB_CHOICE=no])
AC_MSG_RESULT([$WTMPDB_CHOICE])
AC_SUBST([WTMPDB_CHOICE])
])
# Pre-built package name for the libwtmpdb library:
# - On Debian and Debian-based systems: libwtmpdb-dev,
# - On Red Hat distributions: --.
# - Other: https://repology.org/project/wtmpdb/versions