diff --git a/meson.build b/meson.build index 0ba5c57a8..472b97705 100644 --- a/meson.build +++ b/meson.build @@ -277,11 +277,9 @@ endforeach cdata.set('HAVE_PIDFD_OPEN', cc.get_define('SYS_pidfd_open', prefix: '#include ') != '') -systemd = dependency('systemd', required: get_option('systemd')) -systemd_dep = dependency('libsystemd',required: get_option('systemd')) -summary({'systemd conf data': systemd.found()}, bool_yn: true) +systemd_dep = dependency('libsystemd', required: get_option('libsystemd')) summary({'libsystemd': systemd_dep.found()}, bool_yn: true) -cdata.set('HAVE_SYSTEMD', systemd.found() and systemd_dep.found()) +cdata.set('HAVE_SYSTEMD', systemd_dep.found()) logind_dep = dependency(get_option('logind-provider'), required: get_option('logind')) summary({'logind': logind_dep.found()}, bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index c5464e063..206d68659 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -30,8 +30,8 @@ option('gstreamer-device-provider', description: 'Build GStreamer device provider plugin', type: 'feature', value: 'auto') -option('systemd', - description: 'Enable systemd integration', +option('libsystemd', + description: 'Enable code that depends on libsystemd', type: 'feature', value: 'auto') option('logind', @@ -48,9 +48,9 @@ option('systemd-system-service', type: 'feature', value: 'disabled') option('systemd-user-service', - description: 'Install systemd user service file (ignored without systemd)', + description: 'Install systemd user service file', type: 'feature', - value: 'enabled') + value: 'auto') option('selinux', description: 'Enable SELinux integration', type: 'feature', diff --git a/src/daemon/meson.build b/src/daemon/meson.build index b2ebb9375..e7e482f73 100644 --- a/src/daemon/meson.build +++ b/src/daemon/meson.build @@ -161,6 +161,4 @@ custom_target('pipewire-uninstalled', #endif subdir('filter-chain') -if systemd.found() - subdir('systemd') -endif +subdir('systemd') diff --git a/src/daemon/systemd/meson.build b/src/daemon/systemd/meson.build index 482a44c4b..e07449c00 100644 --- a/src/daemon/systemd/meson.build +++ b/src/daemon/systemd/meson.build @@ -1,6 +1,2 @@ -if get_option('systemd-system-service').allowed() - subdir('system') -endif -if get_option('systemd-user-service').allowed() - subdir('user') -endif +subdir('system') +subdir('user') diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build index 0cc17670e..02efc7a41 100644 --- a/src/daemon/systemd/system/meson.build +++ b/src/daemon/systemd/system/meson.build @@ -1,3 +1,8 @@ +systemd = dependency('systemd', required : get_option('systemd-system-service')) +if not systemd.found() + subdir_done() +endif + systemd_system_services_dir = systemd.get_variable('systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix]) if get_option('systemd-system-unit-dir') != '' systemd_system_services_dir = get_option('systemd-system-unit-dir') diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build index a96409f2b..1b65d5f7a 100644 --- a/src/daemon/systemd/user/meson.build +++ b/src/daemon/systemd/user/meson.build @@ -1,3 +1,8 @@ +systemd = dependency('systemd', required : get_option('systemd-user-service')) +if not systemd.found() + subdir_done() +endif + systemd_user_services_dir = systemd.get_variable('systemduserunitdir', pkgconfig_define : [ 'prefix', prefix]) if get_option('systemd-user-unit-dir') != '' systemd_user_services_dir = get_option('systemd-user-unit-dir') diff --git a/test/test-logger.c b/test/test-logger.c index 81132bffa..178263ada 100644 --- a/test/test-logger.c +++ b/test/test-logger.c @@ -496,6 +496,9 @@ PWTEST(logger_journal) pwtest_ptr_notnull(iface); rc = sd_journal_open(&journal, SD_JOURNAL_LOCAL_ONLY|SD_JOURNAL_CURRENT_USER); + if (rc == -ENOSYS) + return PWTEST_SKIP; + pwtest_neg_errno_ok(rc); sd_journal_seek_head(journal); @@ -565,6 +568,9 @@ PWTEST(logger_journal_chain) pwtest_ptr_notnull(iface); rc = sd_journal_open(&journal, SD_JOURNAL_LOCAL_ONLY); + if (rc == -ENOSYS) + return PWTEST_SKIP; + pwtest_neg_errno_ok(rc); sd_journal_seek_head(journal); if (sd_journal_next(journal) == 0) { /* No entries? We don't have a journal */