]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: move declarations of logind and friends
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 25 Jun 2023 06:38:19 +0000 (15:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Jul 2023 17:31:36 +0000 (02:31 +0900)
meson.build
src/login/meson.build

index 939ed66fa18f2b2aec8db4ca0ec50618b3177c13..d7a297584aec2ef4f483cd8417bc4136aff94e15 100644 (file)
@@ -2558,82 +2558,6 @@ if want_tests != 'false'
              depends : exe)
 endif
 
-if conf.get('ENABLE_LOGIND') == 1
-        dbus_programs += executable(
-                'systemd-logind',
-                systemd_logind_sources,
-                include_directories : includes,
-                link_with : [liblogind_core,
-                             libshared],
-                dependencies : [libacl,
-                                threads,
-                                userspace],
-                install_rpath : pkglibdir,
-                install : true,
-                install_dir : libexecdir)
-
-        public_programs += executable(
-                'loginctl',
-                loginctl_sources,
-                include_directories : includes,
-                link_with : [libshared],
-                dependencies : [liblz4,
-                                libxz,
-                                libzstd,
-                                threads,
-                                userspace],
-                install_rpath : pkglibdir,
-                install : true)
-
-        public_programs += executable(
-                'systemd-inhibit',
-                'src/login/inhibit.c',
-                include_directories : includes,
-                link_with : [libshared],
-                dependencies : [userspace],
-                install_rpath : pkglibdir,
-                install : true)
-
-        if conf.get('HAVE_PAM') == 1
-                version_script_arg = project_source_root / pam_systemd_sym
-                pam_systemd = shared_library(
-                        'pam_systemd',
-                        pam_systemd_c,
-                        name_prefix : '',
-                        include_directories : includes,
-                        link_args : ['-shared',
-                                     '-Wl,--version-script=' + version_script_arg],
-                        link_with : [libsystemd_static,
-                                     libshared_static],
-                        dependencies : [libpam_misc,
-                                        libpam,
-                                        threads,
-                                        userspace],
-                        link_depends : pam_systemd_sym,
-                        install : true,
-                        install_tag : 'pam',
-                        install_dir : pamlibdir)
-
-                if want_tests != 'false'
-                        test('dlopen-pam_systemd',
-                             test_dlopen,
-                             # path to dlopen must include a slash
-                             args : pam_systemd.full_path(),
-                             depends : pam_systemd)
-                endif
-        endif
-
-        executable(
-                'systemd-user-runtime-dir',
-                user_runtime_dir_sources,
-                include_directories : includes,
-                link_with : [libshared],
-                dependencies : userspace,
-                install_rpath : pkglibdir,
-                install : true,
-                install_dir : libexecdir)
-endif
-
 if conf.get('HAVE_PAM') == 1
         executable(
                 'systemd-user-sessions',
index 473cf340893ba405e89d2f3c64ce696df879c67d..c641cc700e083b084e662685992bbf51034db112 100644 (file)
@@ -44,10 +44,57 @@ loginctl_sources = files(
         'sysfs-show.c',
 )
 
-user_runtime_dir_sources = files('user-runtime-dir.c')
+executables += [
+        libexec_template + {
+                'name' : 'systemd-logind',
+                'dbus' : true,
+                'conditions' : ['ENABLE_LOGIND'],
+                'sources' : systemd_logind_sources,
+                'link_with' : [
+                        liblogind_core,
+                        libshared,
+                ],
+                'dependencies' : [
+                        libacl,
+                        threads,
+                ],
+        },
+        executable_template + {
+                'name' : 'loginctl',
+                'public' : true,
+                'conditions' : ['ENABLE_LOGIND'],
+                'sources' : loginctl_sources,
+                'dependencies' : [
+                        liblz4,
+                        libxz,
+                        libzstd,
+                        threads,
+                ],
+        },
+        executable_template + {
+                'name' : 'systemd-inhibit',
+                'public' : true,
+                'conditions' : ['ENABLE_LOGIND'],
+                'sources' : files('inhibit.c'),
+        },
+        libexec_template + {
+                'name' : 'systemd-user-runtime-dir',
+                'conditions' : ['ENABLE_LOGIND'],
+                'sources' : files('user-runtime-dir.c'),
+        },
+]
 
-pam_systemd_sym = 'src/login/pam_systemd.sym'
-pam_systemd_c = files('pam_systemd.c')
+modules += [
+        pam_template + {
+                'name' : 'pam_systemd',
+                'conditions' : [
+                        'ENABLE_LOGIND',
+                        'HAVE_PAM',
+                ],
+                'sources' : files('pam_systemd.c'),
+                'link_depends' : files('pam_systemd.sym'),
+        },
+]
 
 enable_logind = conf.get('ENABLE_LOGIND') == 1