mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
utmp: rewrite utmp logging
This patch generalizes the utmp support, to not only support libutempter, but also ulog (and in the future, even more interfaces). * Rename config option main.utempter to main.utmp-helper * Add meson option -Dutmp-backend=none|libutempter|ulog|auto * Rename meson option -Ddefault-utempter-path to -Dutmp-default-helper-path * utmp is no longer detected at compile time, but at runtime instead. Meson will configure the following pre-processor macros, based on the selected utmp backend: * UTMP_ADD - argument to pass to utmp helper when adding a record (starting foot) * UTMP_DEL - argument to pass to utmp helper when removing a record (exiting foot) * UTMP_DEL_HAVE_ARGUMENT - if defined, UTMP_DEL expects an extra argument ($WAYLAND_DISPLAY) * UTMP_DEFAULT_HELPER_PATH - path to the default utmp helper binary The documentation has been updated to mention which arguments are passed to the helper binary. Closes #1314
This commit is contained in:
parent
a2f765b72a
commit
e78319fccd
11 changed files with 159 additions and 58 deletions
|
|
@ -2,16 +2,26 @@ sh = find_program('sh', native: true)
|
|||
|
||||
scdoc_prog = find_program(scdoc.get_variable('scdoc'), native: true)
|
||||
|
||||
if utempter_path == ''
|
||||
default_utempter_value = 'not set'
|
||||
if utmp_backend != 'none'
|
||||
utmp_add_args = '@0@ $WAYLAND_DISPLAY'.format(utmp_add)
|
||||
utmp_del_args = (utmp_del_have_argument
|
||||
? '@0@ $WAYLAND_DISPLAY'.format(utmp_del)
|
||||
: '@0@'.format(utmp_del))
|
||||
utmp_path = utmp_default_helper_path
|
||||
else
|
||||
default_utempter_value = utempter_path
|
||||
utmp_add_args = '<no utmp support in foot>'
|
||||
utmp_del_args = '<no utmp support in foot>'
|
||||
utmp_path = 'none'
|
||||
endif
|
||||
|
||||
|
||||
conf_data = configuration_data(
|
||||
{
|
||||
'default_terminfo': get_option('default-terminfo'),
|
||||
'utempter': default_utempter_value,
|
||||
'utmp_backend': utmp_backend,
|
||||
'utmp_add_args': utmp_add_args,
|
||||
'utmp_del_args': utmp_del_args,
|
||||
'utmp_helper_path': utmp_path,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue