diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2021-08-22 13:09:30 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2021-09-04 16:01:29 -0500 |
commit | d6622a1156929294b909d08273fd227c7d817bb9 (patch) | |
tree | 29df9fc3ecae9e72e467effc91f3985eafaccd82 /src | |
parent | 92004a2ed65045b7ca79063dda8fc5b4ac761606 (diff) |
add meson build files
Closes #116.
Closes #171.
Closes #172.
Closes #175.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/meson.build | 6 | ||||
-rw-r--r-- | src/common/version.h.in | 18 | ||||
-rw-r--r-- | src/common/version.in | 1 | ||||
-rw-r--r-- | src/libeinfo/meson.build | 12 | ||||
-rw-r--r-- | src/librc/meson.build | 33 | ||||
-rw-r--r-- | src/meson.build | 4 | ||||
-rw-r--r-- | src/rc/meson.build | 302 |
7 files changed, 376 insertions, 0 deletions
diff --git a/src/common/meson.build b/src/common/meson.build new file mode 100644 index 00000000..2e421658 --- /dev/null +++ b/src/common/meson.build @@ -0,0 +1,6 @@ +version_h = vcs_tag( + input : 'version.h.in', + output : 'version.h') +version_f = vcs_tag( + input : 'version.in', + output : 'version') diff --git a/src/common/version.h.in b/src/common/version.h.in new file mode 100644 index 00000000..59d648d3 --- /dev/null +++ b/src/common/version.h.in @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2007-2015 The OpenRC Authors. + * See the Authors file at the top-level directory of this distribution and + * https://github.com/OpenRC/openrc/blob/master/AUTHORS + * + * This file is part of OpenRC. It is subject to the license terms in + * the LICENSE file found in the top-level directory of this + * distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE + * This file may not be copied, modified, propagated, or distributed + * except according to the terms contained in the LICENSE file. + */ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +#define VERSION "@VCS_TAG@" + +#endif diff --git a/src/common/version.in b/src/common/version.in new file mode 100644 index 00000000..42179405 --- /dev/null +++ b/src/common/version.in @@ -0,0 +1 @@ +@VCS_TAG@ diff --git a/src/libeinfo/meson.build b/src/libeinfo/meson.build new file mode 100644 index 00000000..16e82978 --- /dev/null +++ b/src/libeinfo/meson.build @@ -0,0 +1,12 @@ +libeinfo_version = '1' + +libeinfo = library('einfo', ['libeinfo.c'], + c_args : termcap_flags, + include_directories : incdir, + dependencies : termcap_dep, + link_depends : 'einfo.map', + version : libeinfo_version, + install : true, + install_dir : libdir) + +install_headers('einfo.h') diff --git a/src/librc/meson.build b/src/librc/meson.build new file mode 100644 index 00000000..4e560483 --- /dev/null +++ b/src/librc/meson.build @@ -0,0 +1,33 @@ +rc_h_conf_data = configuration_data() +if root_prefix == '/' + rc_h_conf_data.set('PREFIX', '') + else + rc_h_conf_data.set('PREFIX', root_prefix) + endif +rc_h_conf_data.set('LIB', libname) +rc_h_conf_data.set('LIBEXECDIR', rc_libexecdir) +rc_h_conf_data.set('LOCAL_PREFIX', local_prefix) +rc_h_conf_data.set('PKG_PREFIX', pkg_prefix) +rc_h_conf_data.set('SYSCONFDIR', get_option('sysconfdir')) + +librc_version = '1' + +librc_sources = [ + 'librc.c', + 'librc-daemon.c', + 'librc-depend.c', + 'librc-misc.c', + 'librc-stringlist.c', + ] + +rc_h = configure_file(input : 'rc.h.in', output : 'rc.h', + configuration : rc_h_conf_data) + +librc = library('rc', librc_sources, + include_directories : [incdir, einfo_incdir], + link_depends : 'rc.map', + version : librc_version, + install : true, + install_dir : libdir) + +install_headers(rc_h) diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000..d7390f54 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,4 @@ +subdir('common') +subdir('libeinfo') +subdir('librc') +subdir('rc') diff --git a/src/rc/meson.build b/src/rc/meson.build new file mode 100644 index 00000000..97fb84e8 --- /dev/null +++ b/src/rc/meson.build @@ -0,0 +1,302 @@ +rc_misc_c = files([ + 'rc-misc.c', + ]) + +rc_plugin_c = ([ + 'rc-plugin.c', + ]) + +rc_schedules_c = files([ + 'rc-schedules.c', + ]) + +usage_c = files([ + '_usage.c', + ]) + +if get_option('selinux').enabled() + rc_selinux_c = files([ + 'rc-selinux.c', + ]) +else + rc_selinux_c = [] +endif + +rc_wtmp_c = files([ + 'rc-wtmp.c', + ]) + +rc_bindir = rc_libexecdir / 'bin' +rc_sbindir = rc_libexecdir / 'sbin' + +executable('rc-status', + ['rc-status.c', rc_misc_c, usage_c, version_h], + c_args : cc_branding_flags, + link_with: [libeinfo, librc], + dependencies: [util_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: bindir) + +executable('openrc', + ['rc.c', 'rc-logger.c', rc_misc_c, rc_plugin_c, usage_c, + version_h], + c_args : cc_branding_flags, + link_with: [libeinfo, librc], + dependencies: [dl_dep, util_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +executable('openrc-run', + ['openrc-run.c', rc_misc_c, rc_plugin_c, usage_c, + rc_selinux_c, version_h], + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], + link_with: [libeinfo, librc], + dependencies: [dl_dep, libpam, selinux_dep, util_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +executable('rc', + ['rc.c', 'rc-logger.c', rc_misc_c, rc_plugin_c, usage_c, version_h], + c_args : cc_branding_flags, + link_with: [libeinfo, librc], + dependencies: [dl_dep, util_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +executable('rc-service', + ['rc-service.c', rc_misc_c, usage_c, version_h], + c_args : cc_branding_flags, + link_with: [libeinfo, librc], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +executable('rc-update', + ['rc-update.c', rc_misc_c, usage_c, version_h], + c_args : cc_branding_flags, + link_with: [libeinfo, librc], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +executable('runscript', + ['openrc-run.c', rc_misc_c, usage_c, 'rc-plugin.c', + rc_selinux_c, version_h], + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], + link_with: [libeinfo, librc], + dependencies: [dl_dep, libpam, util_dep, selinux_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +executable('start-stop-daemon', + ['start-stop-daemon.c', 'rc-pipes.c', rc_misc_c, rc_schedules_c, + rc_selinux_c, usage_c, version_h], + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], + link_with: [libeinfo, librc], + dependencies: [dl_dep, libpam, util_dep, selinux_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +executable('supervise-daemon', + ['supervise-daemon.c', rc_misc_c, rc_plugin_c, rc_schedules_c, + usage_c, version_h], + c_args : [cc_branding_flags, cc_pam_flags, cc_selinux_flags], + link_with: [libeinfo, librc], + dependencies: [dl_dep, libpam, util_dep, selinux_dep], + include_directories: [incdir, einfo_incdir, rc_incdir], + install: true, + install_dir: sbindir) + +if os == 'Linux' + executable('openrc-init', + ['openrc-init.c', rc_plugin_c, rc_wtmp_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + dependencies: [dl_dep], + install: true, + install_dir: sbindir) + + executable('openrc-shutdown', + ['openrc-shutdown.c', 'broadcast.c', 'rc-sysvinit.c', rc_misc_c, + usage_c, rc_wtmp_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: sbindir) +endif + +einfo_execs = [ + 'einfon', + 'einfo', + 'ewarnn', + 'ewarn', + 'eerrorn', + 'eerror', + 'ebegin', + 'eend', + 'ewend', + 'eindent', + 'eoutdent', + 'esyslog', + 'eval_ecolors', + 'ewaitfile', + 'veinfo', + 'vewarn', + 'vebegin', + 'veend', + 'vewend', + 'veindent', + 'veoutdent', + ] + +foreach exec: einfo_execs + executable(exec, + ['do_e.c', rc_misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) +endforeach + +executable('checkpath', + ['checkpath.c', rc_misc_c, usage_c, rc_selinux_c, + version_h], + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + dependencies: [libpam, selinux_dep], + install: true, + install_dir: rc_bindir) + +executable('fstabinfo', + ['fstabinfo.c', rc_misc_c, usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) + +executable('mountinfo', + ['mountinfo.c', rc_misc_c, usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) + +executable('rc-depend', + ['rc-depend.c', rc_misc_c, usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) + +executable('is_newer_than', + ['is_newer_than.c', rc_misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) + +executable('is_older_than', + ['is_older_than.c', rc_misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) + +service_execs = [ + 'service_starting', + 'service_started', + 'service_stopping', + 'service_stopped', + 'service_inactive', + 'service_wasinactive', + 'service_hotplugged', + 'service_started_daemon', + 'service_crashed', + ] + +foreach exec : service_execs + executable(exec, + ['do_service.c', rc_misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) +endforeach + +value_execs = [ + 'service_get_value', + 'service_set_value', + 'get_options', + 'save_options', + ] + +foreach exec : value_execs + executable(exec, + ['do_value.c', rc_misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo, librc], + install: true, + install_dir: rc_bindir) +endforeach + +if os == 'Linux' + executable('kill_all', + ['kill_all.c', usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo,librc], + install: true, + install_dir: rc_bindir) + endif + +executable('shell_var', + ['shell_var.c'], + install: true, + install_dir: rc_bindir) + +mark_service_execs = [ + 'mark_service_starting', + 'mark_service_started', + 'mark_service_stopping', + 'mark_service_stopped', + 'mark_service_inactive', + 'mark_service_wasinactive', + 'mark_service_hotplugged', + 'mark_service_failed', + 'mark_service_crashed', + ] + +foreach exec : mark_service_execs + executable(exec, + ['do_mark_service.c', rc_misc_c, version_h], + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo,librc], + install: true, + install_dir: rc_sbindir) +endforeach + +executable('rc-abort', + 'rc-abort.c', + include_directories: [einfo_incdir], + link_with: [libeinfo], + install: true, + install_dir: rc_sbindir) + +executable('swclock', + ['swclock.c', rc_misc_c, usage_c, version_h], + c_args : cc_branding_flags, + include_directories: [incdir, einfo_incdir, rc_incdir], + link_with: [libeinfo,librc], + install: true, + install_dir: rc_sbindir) |