[pulseaudio-discuss] [PATCH] build-sys: Install bash completion to where bash-completion.pc says

Ville Skyttä ville.skytta at iki.fi
Sun Jan 25 03:42:16 PST 2015


Fall back to the previous /etc/bash_completion.d dir on failures
(either old bash completion or not installed).

Signed-off-by: Ville Skyttä <ville.skytta at iki.fi>
---
 Makefile.am  | 2 +-
 configure.ac | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 75b784f..b39fc41 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,7 +59,7 @@ endif
 cmakedir = $(libdir)/cmake/PulseAudio
 cmake_DATA = PulseAudioConfig.cmake PulseAudioConfigVersion.cmake
 
-bashcompletiondir=$(sysconfdir)/bash_completion.d
+bashcompletiondir=@bashcompletiondir@
 dist_bashcompletion_DATA = shell-completion/bash/pulseaudio
 
 install-bashcompletion-aliases:
diff --git a/configure.ac b/configure.ac
index 3c71472..a79dff8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1421,6 +1421,11 @@ AC_ARG_WITH(
 
 AC_SUBST(udevrulesdir)
 
+PKG_CHECK_VAR(bashcompletiondir, [bash-completion], [completionsdir], ,
+    bashcompletiondir="${sysconfdir}/bash_completion.d")
+
+AC_SUBST(bashcompletiondir)
+
 AC_ARG_WITH(
         [zsh-completion-dir],
         AS_HELP_STRING([--with-zsh-completion-dir], [Zsh completions directory (defaults to ${datadir}/zsh/site-functions)]),
@@ -1547,6 +1552,7 @@ echo "
     System Runtime Path:           ${PA_SYSTEM_RUNTIME_PATH}
     System State Path:             ${PA_SYSTEM_STATE_PATH}
     System Config Path:            ${PA_SYSTEM_CONFIG_PATH}
+    Bash completions directory:    ${bashcompletiondir}
     Zsh completions directory:     ${zshcompletiondir}
     Compiler:                      ${CC}
     CFLAGS:                        ${CFLAGS}
-- 
1.9.3



More information about the pulseaudio-discuss mailing list