]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: move declarations of kernel-install and sulogin-shell 28620/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 25 Jun 2023 18:44:39 +0000 (03:44 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 1 Aug 2023 12:37:31 +0000 (21:37 +0900)
meson.build
src/kernel-install/meson.build
src/sulogin-shell/meson.build [new file with mode: 0644]

index 94eff0cace068fcdf74b8af218d0135487303d0b..eba5cf3739afdc42035504e7bd567d9837aa58cc 100644 (file)
@@ -2441,6 +2441,7 @@ subdir('src/sleep')
 subdir('src/socket-activate')
 subdir('src/socket-proxy')
 subdir('src/stdio-bridge')
+subdir('src/sulogin-shell')
 subdir('src/sysctl')
 subdir('src/sysext')
 subdir('src/system-update-generator')
@@ -2692,26 +2693,6 @@ if want_tests != 'false'
              depends : exe)
 endif
 
-executable(
-        'systemd-sulogin-shell',
-        'src/sulogin-shell/sulogin-shell.c',
-        include_directories : includes,
-        link_with : [libshared],
-        dependencies : [userspace],
-        install_rpath : pkglibdir,
-        install : true,
-        install_dir : libexecdir)
-
-kernel_install = executable(
-        'kernel-install',
-        'src/kernel-install/kernel-install.c',
-        include_directories : includes,
-        link_with : [libshared],
-        dependencies : [userspace],
-        install_rpath : pkglibdir,
-        install : want_kernel_install)
-public_programs += kernel_install
-
 ukify = custom_target(
         'ukify',
         input : 'src/ukify/ukify.py',
@@ -2724,7 +2705,8 @@ if want_ukify
         public_programs += ukify
 endif
 
-if want_tests != 'false' and want_kernel_install
+if want_tests != 'false' and conf.get('ENABLE_KERNEL_INSTALL') == 1
+        kernel_install = executables_by_name.get('kernel-install')
         args = [kernel_install.full_path(), loaderentry_install.full_path(), uki_copy_install]
         deps = [kernel_install, loaderentry_install]
         if want_ukify and boot_stubs.length() > 0
index 29a3d2c5f6030424cfbe898e8a3b4631d8be8cc8..0fa0c37ae28ac80901d7b4882623b38f4eb5584c 100644 (file)
@@ -2,6 +2,15 @@
 
 want_kernel_install = conf.get('ENABLE_KERNEL_INSTALL') == 1
 
+executables += [
+        executable_template + {
+                'name' : 'kernel-install',
+                'public' : true,
+                'conditions' : ['ENABLE_KERNEL_INSTALL'],
+                'sources' : files('kernel-install.c'),
+        },
+]
+
 ukify_install = custom_target(
         '60-ukify.install',
         input : '60-ukify.install.in',
@@ -22,10 +31,9 @@ loaderentry_install = custom_target(
 
 uki_copy_install = files('90-uki-copy.install')
 
-kernel_install_files = [
-        files('50-depmod.install'),
-        uki_copy_install,
-]
+kernel_install_files = uki_copy_install + files(
+        '50-depmod.install',
+)
 
 if want_kernel_install
         install_data(kernel_install_files,
@@ -39,6 +47,6 @@ if want_kernel_install
                 meson.add_install_script('sh', '-c',
                                          mkdir_p.format(sysconfdir / 'kernel/install.d'))
         endif
-
-        test_kernel_install_sh = find_program('test-kernel-install.sh')
 endif
+
+test_kernel_install_sh = find_program('test-kernel-install.sh')
diff --git a/src/sulogin-shell/meson.build b/src/sulogin-shell/meson.build
new file mode 100644 (file)
index 0000000..34b2b32
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+executables += [
+        libexec_template + {
+                'name' : 'systemd-sulogin-shell',
+                'sources' : files('sulogin-shell.c'),
+        },
+]