From 2a4566203ea8cee9847f9097173c51b68f532aeb Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 25 Jun 2023 15:20:29 +0900 Subject: [PATCH] meson: move declarations of several generators --- meson.build | 66 +++---------------------- src/debug-generator/meson.build | 8 +++ src/environment-d-generator/meson.build | 16 ++++++ src/fstab-generator/meson.build | 12 +++++ src/getty-generator/meson.build | 8 +++ src/run-generator/meson.build | 8 +++ 6 files changed, 58 insertions(+), 60 deletions(-) create mode 100644 src/debug-generator/meson.build create mode 100644 src/environment-d-generator/meson.build create mode 100644 src/fstab-generator/meson.build create mode 100644 src/getty-generator/meson.build create mode 100644 src/run-generator/meson.build diff --git a/meson.build b/meson.build index c6d0459f619..8482d0cc8d2 100644 --- a/meson.build +++ b/meson.build @@ -2377,6 +2377,10 @@ subdir('src/busctl') subdir('src/coredump') subdir('src/cryptenroll') subdir('src/cryptsetup') +subdir('src/debug-generator') +subdir('src/environment-d-generator') +subdir('src/fstab-generator') +subdir('src/getty-generator') subdir('src/home') subdir('src/hostname') subdir('src/import') @@ -2397,6 +2401,7 @@ subdir('src/portable') subdir('src/pstore') subdir('src/resolve') subdir('src/rpm') +subdir('src/run-generator') subdir('src/shutdown') subdir('src/sysext') subdir('src/systemctl') @@ -2540,51 +2545,8 @@ if want_tests != 'false' args : exe.full_path()) endif -executable( - 'systemd-getty-generator', - 'src/getty-generator/getty-generator.c', - include_directories : includes, - link_with : [libshared], - dependencies : userspace, - install_rpath : pkglibdir, - install : true, - install_dir : systemgeneratordir) - -executable( - 'systemd-debug-generator', - 'src/debug-generator/debug-generator.c', - include_directories : includes, - link_with : [libshared], - dependencies : userspace, - install_rpath : pkglibdir, - install : true, - install_dir : systemgeneratordir) - -executable( - 'systemd-run-generator', - 'src/run-generator/run-generator.c', - include_directories : includes, - link_with : [libshared], - dependencies : userspace, - install_rpath : pkglibdir, - install : true, - install_dir : systemgeneratordir) - -exe = executable( - 'systemd-fstab-generator', - 'src/fstab-generator/fstab-generator.c', - include_directories : includes, - link_with : [libshared], - dependencies : userspace, - install_rpath : pkglibdir, - install : true, - install_dir : systemgeneratordir) - -meson.add_install_script(meson_make_symlink, - systemgeneratordir / 'systemd-fstab-generator', - libexecdir / 'systemd-sysroot-fstab-check') - if want_tests != 'false' + exe = executables_by_name.get('systemd-fstab-generator') test('test-fstab-generator', test_fstab_generator_sh, # https://github.com/mesonbuild/meson/issues/2681 @@ -2593,22 +2555,6 @@ if want_tests != 'false' depends : exe) endif -if conf.get('ENABLE_ENVIRONMENT_D') == 1 - executable( - '30-systemd-environment-d-generator', - 'src/environment-d-generator/environment-d-generator.c', - include_directories : includes, - link_with : [libshared], - dependencies : userspace, - install_rpath : pkglibdir, - install : true, - install_dir : userenvgeneratordir) - - meson.add_install_script(meson_make_symlink, - sysconfdir / 'environment', - environmentdir / '99-environment.conf') -endif - if conf.get('ENABLE_HIBERNATE') == 1 executable( 'systemd-hibernate-resume-generator', diff --git a/src/debug-generator/meson.build b/src/debug-generator/meson.build new file mode 100644 index 00000000000..33cb3446dec --- /dev/null +++ b/src/debug-generator/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +executables += [ + generator_template + { + 'name' : 'systemd-debug-generator', + 'sources' : files('debug-generator.c'), + }, +] diff --git a/src/environment-d-generator/meson.build b/src/environment-d-generator/meson.build new file mode 100644 index 00000000000..6ff82b2a325 --- /dev/null +++ b/src/environment-d-generator/meson.build @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +executables += [ + executable_template + { + 'name' : '30-systemd-environment-d-generator', + 'conditions' : ['ENABLE_ENVIRONMENT_D'], + 'sources' : files('environment-d-generator.c'), + 'install_dir' : userenvgeneratordir, + }, +] + +if conf.get('ENABLE_ENVIRONMENT_D') == 1 + meson.add_install_script(meson_make_symlink, + sysconfdir / 'environment', + environmentdir / '99-environment.conf') +endif diff --git a/src/fstab-generator/meson.build b/src/fstab-generator/meson.build new file mode 100644 index 00000000000..11de6ffd809 --- /dev/null +++ b/src/fstab-generator/meson.build @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +executables += [ + generator_template + { + 'name' : 'systemd-fstab-generator', + 'sources' : files('fstab-generator.c'), + }, +] + +meson.add_install_script(meson_make_symlink, + systemgeneratordir / 'systemd-fstab-generator', + libexecdir / 'systemd-sysroot-fstab-check') diff --git a/src/getty-generator/meson.build b/src/getty-generator/meson.build new file mode 100644 index 00000000000..44eeb869a3c --- /dev/null +++ b/src/getty-generator/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +executables += [ + generator_template + { + 'name' : 'systemd-getty-generator', + 'sources' : files('getty-generator.c'), + }, +] diff --git a/src/run-generator/meson.build b/src/run-generator/meson.build new file mode 100644 index 00000000000..9a4e4ad4a6b --- /dev/null +++ b/src/run-generator/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +executables += [ + generator_template + { + 'name' : 'systemd-run-generator', + 'sources' : files('run-generator.c'), + }, +]