diff --git a/Makefile.tools b/Makefile.tools
index b6b99d2..81ed2e3 100644
--- a/Makefile.tools
+++ b/Makefile.tools
$(GLIB_LIBS) $(DBUS_LIBS) -lreadline
endif
+if ZSH_COMPLETIONS
+zshcompletiondir=$(ZSH_COMPLETIONDIR)
+dist_zshcompletion_DATA = completion/zsh/_bluetoothctl
+endif
+
if MONITOR
bin_PROGRAMS += monitor/btmon
diff --git a/configure.ac b/configure.ac
index 0afe1e6..76612ff 100644
--- a/configure.ac
+++ b/configure.ac
fi
AC_SUBST(DBUS_SESSIONBUSDIR, [${path_dbussessionbusdir}])
+AC_ARG_WITH([zsh-completion-dir], AC_HELP_STRING([--with-zsh-completion-dir=DIR],
+ [path to install zsh completions]),
+ [path_zshcompletiondir=${withval}],
+ [path_zshcompletiondir="yes"])
+
+if (test "${path_zshcompletiondir}" = "yes"); then
+ path_zshcompletiondir="$datarootdir/zsh/site-functions"
+ AC_MSG_RESULT([${path_zshcompletiondir}])
+fi
+AC_SUBST(ZSH_COMPLETIONDIR, [${path_zshcompletiondir}])
+AM_CONDITIONAL(ZSH_COMPLETIONS, test "${path_zshcompletiondir}" != "no")
+
AC_ARG_ENABLE(backtrace, AC_HELP_STRING([--enable-backtrace],
[compile backtrace support]), [enable_backtrace=${enableval}])