diff --git a/config.h.meson b/config.h.meson index 885cab07c..874c74af3 100644 --- a/config.h.meson +++ b/config.h.meson @@ -51,8 +51,8 @@ /* libwacom has get_num_rings() */ #mesondefine HAVE_LIBWACOM_GET_NUM_RINGS -/* Building with libsystemd */ -#mesondefine HAVE_LIBSYSTEMD +/* Building with logind */ +#mesondefine HAVE_LOGIND /* Define if you want to enable the native (KMS) backend based on systemd */ #mesondefine HAVE_NATIVE_BACKEND diff --git a/meson.build b/meson.build index 1aaa759a7..23cb479ad 100644 --- a/meson.build +++ b/meson.build @@ -239,6 +239,19 @@ if have_wayland endif endif +have_logind = get_option('logind') +if have_logind + logind_dep = dependency('libsystemd', required: false) + + if not logind_dep.found() + logind_dep = dependency('libelogind', required: false) + endif + + if not logind_dep.found() + error('No logind provider dependency found: tried libsystemd and libelogind') + endif +endif + have_libgudev = get_option('udev') if have_libgudev libudev_dep = dependency('libudev', version: udev_req) @@ -251,18 +264,13 @@ if have_libgudev endif endif -have_libsystemd = get_option('systemd') -libsystemd_dep = dependency('libsystemd', required: have_libsystemd) - have_native_backend = get_option('native_backend') if have_native_backend libgbm_dep = dependency('gbm', version: gbm_req) libinput_dep = dependency('libinput', version: libinput_req) - if libsystemd_dep.found() - logind_provider_dep = libsystemd_dep - else - logind_provider_dep = dependency('libelogind') + if not have_logind + error('The native backend requires logind to be enabled') endif if not have_egl @@ -557,7 +565,7 @@ cdata.set('HAVE_WAYLAND', have_wayland) cdata.set('HAVE_XWAYLAND', have_xwayland) cdata.set('HAVE_X11', have_x11) cdata.set('HAVE_X11_CLIENT', have_x11_client) -cdata.set('HAVE_LIBSYSTEMD', have_libsystemd) +cdata.set('HAVE_LOGIND', have_logind) cdata.set('HAVE_NATIVE_BACKEND', have_native_backend) cdata.set('HAVE_REMOTE_DESKTOP', have_remote_desktop) cdata.set('HAVE_GNOME_DESKTOP', have_gnome_desktop) diff --git a/meson.options b/meson.options index c708b5491..31f72e9c9 100644 --- a/meson.options +++ b/meson.options @@ -51,10 +51,10 @@ option('x11', description: 'Enable X11 support' ) -option('systemd', +option('logind', type: 'boolean', value: true, - description: 'Enable systemd support' + description: 'Enable logind support' ) option('native_backend', diff --git a/src/core/window.c b/src/core/window.c index a3c1bfa9b..b18b463d6 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -109,7 +109,7 @@ #include "wayland/meta-window-xwayland.h" #endif -#ifdef HAVE_LIBSYSTEMD +#ifdef HAVE_LOGIND #include #endif @@ -6813,7 +6813,7 @@ meta_window_get_pid (MetaWindow *window) GFile * meta_window_get_unit_cgroup (MetaWindow *window) { -#ifdef HAVE_LIBSYSTEMD +#ifdef HAVE_LOGIND g_autofree char *contents = NULL; g_autofree char *complete_path = NULL; g_autofree char *unit_name = NULL; diff --git a/src/meson.build b/src/meson.build index 1702433f1..b594c4298 100644 --- a/src/meson.build +++ b/src/meson.build @@ -135,9 +135,9 @@ if have_wayland ] endif -if have_libsystemd +if have_logind mutter_pkg_private_deps += [ - libsystemd_dep, + logind_dep, ] endif @@ -145,7 +145,6 @@ if have_native_backend mutter_pkg_private_deps += [ libinput_dep, libgbm_dep, - logind_provider_dep, xkbcommon_dep, ] endif