summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-08-05 20:10:02 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-08-05 20:16:34 -0400
commita5ba84b7f242b209691d926f786bd48953a43803 (patch)
treee11c4d05215c884d8a534ba17d7b8de18639c9ea
parente6898d854d3fc49879c9c9ef61c5212e2d23a0fc (diff)
build-sys: allow skipping installation of completions
./configure --with-bashcompletiondir=no or --without-bashcompletiondir now works as expected. Similarly for zsh. https://github.com/systemd/systemd/issues/533
-rw-r--r--Makefile.am36
-rw-r--r--configure.ac2
2 files changed, 36 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 7cfa527f6f..a8aaaf43d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -414,6 +414,7 @@ systemgenerator_PROGRAMS = \
systemd-system-update-generator \
systemd-debug-generator
+if ENABLE_BASH_COMPLETION
dist_bashcompletion_DATA = \
shell-completion/bash/busctl \
shell-completion/bash/journalctl \
@@ -430,7 +431,9 @@ dist_bashcompletion_DATA = \
nodist_bashcompletion_DATA = \
shell-completion/bash/systemctl
+endif
+if ENABLE_ZSH_COMPLETION
dist_zshcompletion_DATA = \
shell-completion/zsh/_busctl \
shell-completion/zsh/_journalctl \
@@ -447,6 +450,7 @@ dist_zshcompletion_DATA = \
nodist_zshcompletion_DATA = \
shell-completion/zsh/_systemctl
+endif
EXTRA_DIST += \
shell-completion/bash/systemctl.in \
@@ -2228,8 +2232,10 @@ SYSINIT_TARGET_WANTS += \
systemd-tmpfiles-setup-dev.service \
systemd-tmpfiles-setup.service
+if ENABLE_ZSH_COMPLETION
dist_zshcompletion_DATA += \
shell-completion/zsh/_systemd-tmpfiles
+endif
TIMERS_TARGET_WANTS += \
systemd-tmpfiles-clean.timer
@@ -2460,12 +2466,16 @@ bootctl_LDADD = \
bin_PROGRAMS += \
bootctl
+if ENABLE_BASH_COMPLETION
dist_bashcompletion_DATA += \
shell-completion/bash/bootctl
+endif
+if ENABLE_ZSH_COMPLETION
dist_zshcompletion_DATA += \
shell-completion/zsh/_bootctl
endif
+endif
# ------------------------------------------------------------------------------
if HAVE_GNUEFI
@@ -4247,11 +4257,15 @@ test_coredump_vacuum_SOURCES = \
test_coredump_vacuum_LDADD = \
libshared.la
+if ENABLE_BASH_COMPLETION
dist_bashcompletion_DATA += \
shell-completion/bash/coredumpctl
+endif
+if ENABLE_ZSH_COMPLETION
dist_zshcompletion_DATA += \
shell-completion/zsh/_coredumpctl
+endif
nodist_sysctl_DATA = \
sysctl.d/50-coredump.conf
@@ -4499,12 +4513,15 @@ hostnamectl_LDADD = \
bin_PROGRAMS += \
hostnamectl
+if ENABLE_BASH_COMPLETION
dist_bashcompletion_DATA += \
shell-completion/bash/hostnamectl
+endif
+if ENABLE_ZSH_COMPLETION
dist_zshcompletion_DATA += \
shell-completion/zsh/_hostnamectl
-
+endif
endif
polkitpolicy_in_files += \
@@ -4570,12 +4587,15 @@ localectl_LDADD = \
bin_PROGRAMS += \
localectl
+if ENABLE_BASH_COMPLETION
dist_bashcompletion_DATA += \
shell-completion/bash/localectl
+endif
+if ENABLE_ZSH_COMPLETION
dist_zshcompletion_DATA += \
shell-completion/zsh/_localectl
-
+endif
endif
.PHONY: update-kbd-model-map
@@ -4627,12 +4647,16 @@ timedatectl_LDADD = \
bin_PROGRAMS += \
timedatectl
+if ENABLE_BASH_COMPLETION
dist_bashcompletion_DATA += \
shell-completion/bash/timedatectl
+endif
+if ENABLE_ZSH_COMPLETION
dist_zshcompletion_DATA += \
shell-completion/zsh/_timedatectl
endif
+endif
polkitpolicy_in_files += \
src/timedate/org.freedesktop.timedate1.policy.in
@@ -4738,8 +4762,10 @@ machinectl_LDADD = \
rootbin_PROGRAMS += \
machinectl
+if ENABLE_BASH_COMPLETION
dist_bashcompletion_DATA += \
shell-completion/bash/machinectl
+endif
test_machine_tables_SOURCES = \
src/machine/test-machine-tables.c
@@ -4768,9 +4794,11 @@ dist_dbuspolicy_DATA += \
polkitpolicy_files += \
src/machine/org.freedesktop.machine1.policy
+if ENABLE_ZSH_COMPLETION
dist_zshcompletion_DATA += \
shell-completion/zsh/_machinectl \
shell-completion/zsh/_sd_machines
+endif
SYSTEM_UNIT_ALIASES += \
systemd-machined.service dbus-org.freedesktop.machine1.service
@@ -5330,12 +5358,16 @@ loginctl_LDADD = \
rootbin_PROGRAMS += \
loginctl
+if ENABLE_BASH_COMPLETION
dist_bashcompletion_DATA += \
shell-completion/bash/loginctl
+endif
+if ENABLE_ZSH_COMPLETION
dist_zshcompletion_DATA += \
shell-completion/zsh/_loginctl \
shell-completion/zsh/_systemd-inhibit
+endif
systemd_inhibit_SOURCES = \
src/login/inhibit.c
diff --git a/configure.ac b/configure.ac
index f1ce9ff300..a9de4d62a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1340,11 +1340,13 @@ AC_ARG_WITH([bashcompletiondir],
] , [
with_bashcompletiondir=${datadir}/bash-completion/completions
])])
+AM_CONDITIONAL(ENABLE_BASH_COMPLETION, [test "$with_bashcompletiondir" != "no"])
AX_NORMALIZE_PATH([with_bashcompletiondir])
AC_ARG_WITH([zshcompletiondir],
AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
[], [with_zshcompletiondir=${datadir}/zsh/site-functions])
+AM_CONDITIONAL(ENABLE_ZSH_COMPLETION, [test "$with_zshcompletiondir" != "no"])
AX_NORMALIZE_PATH([with_zshcompletiondir])
AC_ARG_WITH([rootprefix],