]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: move declaration of systemctl
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 25 Jun 2023 06:44:30 +0000 (15:44 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Jul 2023 20:52:50 +0000 (05:52 +0900)
meson.build
src/systemctl/meson.build

index 36453bfcd1ed9ba25b5d5371c059d33a36157a0e..27166ed58a43ac4832b3648d4c393e296acf1d9c 100644 (file)
@@ -2570,22 +2570,6 @@ if conf.get('HAVE_BLKID') == 1 and conf.get('ENABLE_BOOTLOADER') == 1
         endif
 endif
 
-systemctl = executable(
-        'systemctl',
-        systemctl_sources,
-        include_directories : includes,
-        link_with : systemctl_link_with,
-        dependencies : [libcap,
-                        liblz4,
-                        libselinux,
-                        libxz,
-                        libzstd,
-                        threads,
-                        userspace],
-        install_rpath : pkglibdir,
-        install : true)
-public_programs += systemctl
-
 if conf.get('ENABLE_PORTABLED') == 1
         if get_option('link-portabled-shared')
                 portabled_link_with = [libshared]
@@ -2739,13 +2723,6 @@ if conf.get('ENABLE_HOMED') == 1
         endif
 endif
 
-foreach alias : (['halt', 'poweroff', 'reboot', 'shutdown'] +
-                 (conf.get('HAVE_SYSV_COMPAT') == 1 ? ['runlevel', 'telinit'] : []))
-        meson.add_install_script(meson_make_symlink,
-                                 bindir / 'systemctl',
-                                 sbindir / alias)
-endforeach
-
 meson.add_install_script(meson_make_symlink,
                          bindir / 'udevadm',
                          libexecdir / 'systemd-udevd')
@@ -3481,6 +3458,7 @@ systemd_id128 = executable(
 public_programs += systemd_id128
 
 if want_tests != 'false'
+        systemctl = executables_by_name.get('systemctl')
         test('test-systemctl-enable',
              test_systemctl_enable_sh,
              # https://github.com/mesonbuild/meson/issues/2681
index f45cbc47d305780e2bb02d7015435a087ab00b53..e7e1a1964b9800580dfdaeb8ac7d2672ee40f5fe 100644 (file)
@@ -48,6 +48,30 @@ else
                                libbasic_gcrypt]
 endif
 
+executables += [
+        executable_template + {
+                'name' : 'systemctl',
+                'public' : true,
+                'sources' : systemctl_sources,
+                'link_with' : systemctl_link_with,
+                'dependencies' : [
+                        libcap,
+                        liblz4,
+                        libselinux,
+                        libxz,
+                        libzstd,
+                        threads,
+                ],
+        },
+]
+
+foreach alias : (['halt', 'poweroff', 'reboot', 'shutdown'] +
+                 (conf.get('HAVE_SYSV_COMPAT') == 1 ? ['runlevel', 'telinit'] : []))
+        meson.add_install_script(meson_make_symlink,
+                                 bindir / 'systemctl',
+                                 sbindir / alias)
+endforeach
+
 fuzzers += [
         {
                 'sources' : [