Skip to content

Commit

Permalink
Use meson feature and not combo options
Browse files Browse the repository at this point in the history
  • Loading branch information
thkukuk committed Jan 28, 2025
1 parent 3933aec commit 72addf4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 44 deletions.
5 changes: 2 additions & 3 deletions man/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
want_man = get_option('man')
xsltproc_exe = find_program('xsltproc', required : want_man == 'true')
want_man = want_man != 'false' and xsltproc_exe.found()
xsltproc_exe = find_program('xsltproc', required : get_option('man'))
want_man = (get_option('man').enabled() or get_option('man').auto()) and xsltproc_exe.found()
xsltproc_flags = [
'--nonet',
'--xinclude',
Expand Down
41 changes: 11 additions & 30 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -94,39 +94,20 @@ tmpfilesdir = prefixdir / 'lib/tmpfiles.d'
libpam = cc.find_library('pam')
libsqlite3 = cc.find_library('sqlite3')

want_audit = get_option('audit')
if want_audit != 'false'
libaudit = dependency('audit', required : want_audit == 'true')
have_audit = libaudit.found()
else
have_audit = false
libaudit = []
endif
conf.set10('HAVE_AUDIT', have_audit)
libaudit = dependency('audit', required : get_option('audit'))
conf.set10('HAVE_AUDIT', libaudit.found())

want_wtmpdbd = get_option('wtmpdbd')
if want_wtmpdbd != 'false'
libsystemd = dependency('libsystemd', version: '>= 257', required : want_wtmpdbd == 'true')
have_systemd257 = libsystemd.found()
else
have_systemd257 = false
libsystemd = []
endif
conf.set10('WITH_WTMPDBD', have_systemd257)

want_systemd = get_option('systemd')
if have_systemd257 == false
if want_systemd != 'false'
libsystemd = dependency('libsystemd', required : want_systemd == 'true')
have_systemd = libsystemd.found()
else
have_systemd = false
libsystemd = []
endif
libsystemd = dependency('libsystemd', version: '>= 257', required : get_option('wtmpdbd'))
conf.set10('WITH_WTMPDBD', libsystemd.found())

if libsystemd.found()
have_systemd257 = true
else
have_systemd = true
# for soft-reboot older libsystemd with sd_bus is good enough
have_systemd257 = false
libsystemd = dependency('libsystemd', required : get_option('systemd'))
endif
conf.set10('HAVE_SYSTEMD', have_systemd)
conf.set10('HAVE_SYSTEMD', libsystemd.found())

libwtmpdb_c = files('lib/libwtmpdb.c', 'lib/logwtmpdb.c', 'lib/sqlite.c', 'lib/varlink.c', 'lib/mkdir_p.c')
libwtmpdb_map = 'lib/libwtmpdb.map'
Expand Down
17 changes: 6 additions & 11 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
option('wtmpdbd', type : 'combo', choices : ['auto', 'true', 'false'],
value : 'auto',
option('wtmpdbd', type : 'feature', value : 'auto',
description : 'build daemon with sd-varlink support')
option('split-usr', type : 'combo', choices : ['auto', 'true', 'false'],
description : '''/bin, /sbin aren't symlinks into /usr''')
option('rootprefix', type : 'string',
description : '''override the root prefix [default '/' if split-usr and '/usr' otherwise]''')
option('rootlibdir', type : 'string',
description : '''[/usr]/lib/x86_64-linux-gnu or such''')
description : '''[/usr]/lib or such''')
option('pamlibdir', type : 'string',
description : 'directory for PAM modules')
option('man', type : 'combo', choices : ['auto', 'true', 'false'],
value : 'auto',
option('man', type : 'feature', value : 'auto',
description : 'build and install man pages')
option('audit', type : 'combo', choices : ['auto', 'true', 'false'],
value : 'auto',
option('audit', type : 'feature', value : 'auto',
description : 'libaudit support')
option('systemd', type : 'combo', choices : ['auto', 'true', 'false'],
value : 'auto',
option('systemd', type : 'feature', value : 'auto',
description : 'systemd support to detect soft-reboots')
option('compat-symlink', type : 'boolean',
value : false,
option('compat-symlink', type : 'boolean', value : false,
description : 'create last compat symlink')

0 comments on commit 72addf4

Please sign in to comment.