conf.set10('HAVE_SPLIT_BIN', split_bin,
description : 'bin and sbin directories are separate')
-have_standalone_binaries = get_option('standalone-binaries')
+standalone_binaries = get_option('standalone-binaries').split(',')
+if standalone_binaries == ['']
+ standalone_binaries = []
+endif
conf.set10('CREATE_LOG_DIRS', get_option('create-log-dirs'))
# The 'install' field is extended to also control whether the automatically
# added variant, which is statically linked with libsystemd-shared, is installed:
-# 'yes' : Mapped to true. The static variant will not be installed.
-# 'no' : Mapped to false. The static variant will not be installed either.
-# 'both' : Mapped to true. The static variant will also be installed.
+# 'yes' : Mapped to true.
+# 'no' : Mapped to false.
# 'static' : Mapped to false, and its target name is suffixed with '.shared'.
# The static variant will be installed instead using the original name
# (without the '.standalone' suffix).
# Currently, test and fuzzer executables only support 'yes' or 'no'.
+#
+# For executables matched by the install-standalone list, a .standalone variant
+# will be installed if install is true.
executable_template = {
'include_directories' : includes,
'link_with' : [libshared],
name_static = name + '.standalone'
install = dict.get('install')
build_by_default = dict.get('build_by_default')
- if install == 'yes'
- install_shared = true
- install_static = false
- build_by_default_shared = build_by_default
- build_by_default_static = false
- elif install == 'no'
- install_shared = false
- install_static = false
- build_by_default_shared = build_by_default
- build_by_default_static = false
- elif install == 'both'
- if is_test or is_fuzz
- error('Install mode "@0@" is not supported for test or fuzzer target "@1@"'.format(install, name))
- endif
- install_shared = true
- install_static = true
+ install_standalone = false
+ if not (is_test or is_fuzz)
+ foreach pattern : standalone_binaries
+ if name.contains(pattern)
+ install_standalone = true
+ endif
+ endforeach
+ endif
+
+ if install in ['yes', 'no']
+ install_shared = install == 'yes'
+ install_static = install_shared and install_standalone
build_by_default_shared = build_by_default
- build_by_default_static = build_by_default
+ build_by_default_static = build_by_default and install_standalone
elif install == 'static'
if is_test or is_fuzz
error('Install mode "@0@" is not supported for test or fuzzer target "@1@"'.format(install, name))
['link-portabled-shared', get_option('link-portabled-shared')],
['first-boot-full-preset'],
['fexecve'],
- ['standalone-binaries', get_option('standalone-binaries')],
['coverage', get_option('b_coverage')],
]
option('static-libudev', type : 'combo',
choices : ['false', 'true', 'pic', 'no-pic'],
description : 'install a static library for libudev')
-option('standalone-binaries', type : 'boolean', value : false,
- description : 'also build standalone versions of supported binaries')
+option('standalone-binaries', type : 'string',
+ deprecated : { 'true' : 'repart,report,shutdown,sysusers,tmpfiles', 'false' : '' },
+ description : 'comma-separated list of patterns specifying binaries to install as .standalone')
option('build-static', type : 'boolean', value : false,
description : 'build static versions of supported binaries')
libopenssl_cflags,
tpm2_cflags,
],
- 'install' : have_standalone_binaries ? 'both' : 'yes',
},
]
'dependencies' : [
libcurl_cflags,
],
- 'install' : have_standalone_binaries ? 'both' : 'yes',
},
libexec_template + {
'name' : 'systemd-report-basic',
'report-basic.c',
'report-basic-server.c',
),
- 'install' : have_standalone_binaries ? 'both' : 'yes',
},
libexec_template + {
'name' : 'systemd-report-cgroup',
'report-cgroup.c',
'report-cgroup-server.c',
),
- 'install' : have_standalone_binaries ? 'both' : 'yes',
},
libexec_template + {
'name' : 'systemd-report-files',
'report-files.c',
'report-files-server.c',
),
- 'install' : have_standalone_binaries ? 'both' : 'yes',
},
libexec_template + {
'name' : 'systemd-report-sign-plain',
),
'dependencies' : libopenssl_cflags,
'conditions' : ['HAVE_OPENSSL'],
- 'install' : have_standalone_binaries ? 'both' : 'yes',
},
libexec_template + {
'name' : 'systemd-report-sign-tsm',
'export' : files(
'report-sign-tsm.c',
),
- 'install' : have_standalone_binaries ? 'both' : 'yes',
},
]
'shutdown.c',
) + shutdown_detach_sources,
'dependencies' : libmount_cflags,
- 'install' : have_standalone_binaries ? 'both' : 'yes',
},
test_template + {
'sources' : files('test-umount.c') +
'public' : true,
'export' : files('sysusers.c'),
'dependencies' : libaudit_cflags,
- 'install' : have_standalone_binaries ? 'both' : 'yes',
},
]
libacl_cflags,
libselinux_cflags,
],
- 'install' : have_standalone_binaries ? 'both' : 'yes',
},
test_template + {
'sources' : files('test-offline-passwd.c') +
env : test_env,
suite : 'sysusers')
- if have_standalone_binaries
+ if 'systemd-sysusers.standalone' in executables_by_name
exe = executables_by_name.get('systemd-sysusers.standalone')
test('test-sysusers.standalone',
test_sysusers_sh,
depends : exe,
suite : 'tmpfiles')
- if have_standalone_binaries
+ if 'systemd-tmpfiles.standalone' in executables_by_name
exe = executables_by_name.get('systemd-tmpfiles.standalone')
test('test-systemd-tmpfiles.standalone',
test_systemd_tmpfiles_py,