aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-09-23 18:24:04 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-09-23 21:02:25 +0000
commitaa10b1d2da3ecf9672ae915a49073bd30ee0a785 (patch)
treea1816d96cf875f7208fb518172a5a92a512fe3e4 /meson.build
parentMerge branch 'nightfly-and-moonfly' (diff)
Add support for creating utmp records
This patch adds support for creating utmp records using the ‘utempter’ helper binary from the ‘libutempter’ package. * New config option ‘main.utempter’ * New meson command line option, -Ddefault-utempter-path. Defaults to auto-detecting the path. The default value of the new ‘main.utempter’ config option depends on the meson command line option ‘-Ddefault-utempter-path’. If ‘main.utempter’ is *not* set to ‘none’, foot will try to execute the utempter helper binary to create utmp records when a new terminal is instantiated. The record is removed when the terminal instance is destroyed.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build24
1 files changed, 23 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 61837459..4d3b6213 100644
--- a/meson.build
+++ b/meson.build
@@ -16,9 +16,30 @@ if cc.has_function('memfd_create')
add_project_arguments('-DMEMFD_CREATE', language: 'c')
endif
+utempter_path = get_option('default-utempter-path')
+if utempter_path == ''
+ utempter = find_program(
+ 'utempter',
+ required: false,
+ dirs: [join_paths(get_option('prefix'), get_option('libdir'), 'utempter'),
+ join_paths(get_option('prefix'), get_option('libexecdir'), 'utempter'),
+ '/usr/lib/utempter',
+ '/usr/libexec/utempter',
+ '/lib/utempter']
+ )
+ if utempter.found()
+ utempter_path = utempter.full_path()
+ else
+ utempter_path = ''
+ endif
+elif utempter_path == 'none'
+ utempter_path = ''
+endif
+
add_project_arguments(
['-D_GNU_SOURCE=200809L',
- '-DFOOT_DEFAULT_TERM="@0@"'.format(get_option('default-terminfo'))] +
+ '-DFOOT_DEFAULT_TERM="@0@"'.format(get_option('default-terminfo')),
+ '-DFOOT_DEFAULT_UTEMPTER_PATH="@0@"'.format(utempter_path)] +
(is_debug_build
? ['-D_DEBUG']
: [cc.get_supported_arguments('-fno-asynchronous-unwind-tables')]) +
@@ -321,6 +342,7 @@ summary(
'Themes': get_option('themes'),
'IME': get_option('ime'),
'Grapheme clustering': utf8proc.found(),
+ 'Utempter path': utempter_path,
'Build terminfo': tic.found(),
'Terminfo install location': terminfo_install_location,
'Default TERM': get_option('default-terminfo'),