1 # SPDX-License-Identifier: LGPL-2.1+
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
5 # systemd is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
10 # systemd is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
18 bashcompletiondir = get_option('bashcompletiondir')
19 if bashcompletiondir == ''
20 bash_completion = dependency('bash-completion', required : false)
21 if bash_completion.found()
22 bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir')
24 bashcompletiondir = join_paths(datadir, 'bash-completion/completions')
27 message('bash completions: @0@'.format(bashcompletiondir))
30 if bashcompletiondir != 'no'
31 bash_systemctl = configure_file(
32 input : 'systemctl.in',
34 configuration : substs)
36 items = [['busctl', ''],
38 ['systemd-analyze', ''],
41 ['systemd-cgtop', ''],
42 ['systemd-delta', ''],
43 ['systemd-detect-virt', ''],
44 ['systemd-nspawn', ''],
48 ['kernel-install', ''],
50 ['bootctl', 'ENABLE_EFI'],
51 ['coredumpctl', 'ENABLE_COREDUMP'],
52 ['hostnamectl', 'ENABLE_HOSTNAMED'],
53 ['localectl', 'ENABLE_LOCALED'],
54 ['loginctl', 'ENABLE_LOGIND'],
55 ['machinectl', 'ENABLE_MACHINED'],
56 ['networkctl', 'ENABLE_NETWORKD'],
57 ['systemd-resolve', 'ENABLE_RESOLVE'],
58 ['timedatectl', 'ENABLE_TIMEDATED'],
62 if item[1] == '' or conf.get(item[1]) == 1
64 install_dir : bashcompletiondir)