build-sys: Install bash completion to where bash-completion.pc says

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

changes over Ville Skyttä's patch:
define PKG_CHECK_VAR macro which became available only in pkg-config 0.28

see https://bugs.freedesktop.org/show_bug.cgi?id=88782 and
https://bugs.freedesktop.org/show_bug.cgi?id=89540

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
Ville Skyttä 2015-01-25 13:38:43 +02:00 committed by Peter Meerwald
parent a26defed9e
commit 84dff820ed
2 changed files with 16 additions and 1 deletions

View file

@ -59,7 +59,7 @@ endif
cmakedir = $(libdir)/cmake/PulseAudio cmakedir = $(libdir)/cmake/PulseAudio
cmake_DATA = PulseAudioConfig.cmake PulseAudioConfigVersion.cmake cmake_DATA = PulseAudioConfig.cmake PulseAudioConfigVersion.cmake
bashcompletiondir=$(sysconfdir)/bash_completion.d bashcompletiondir=@bashcompletiondir@
dist_bashcompletion_DATA = shell-completion/bash/pulseaudio dist_bashcompletion_DATA = shell-completion/bash/pulseaudio
install-bashcompletion-aliases: install-bashcompletion-aliases:

View file

@ -1436,6 +1436,20 @@ AC_ARG_WITH(
AC_SUBST(udevrulesdir) AC_SUBST(udevrulesdir)
# PKG_CHECK_VAR available with pkg-config 0.28
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])
PKG_CHECK_VAR(bashcompletiondir, [bash-completion], [completionsdir], ,
bashcompletiondir="${sysconfdir}/bash_completion.d")
AC_SUBST(bashcompletiondir)
AC_ARG_WITH( AC_ARG_WITH(
[zsh-completion-dir], [zsh-completion-dir],
AS_HELP_STRING([--with-zsh-completion-dir], [Zsh completions directory (defaults to ${datadir}/zsh/site-functions)]), AS_HELP_STRING([--with-zsh-completion-dir], [Zsh completions directory (defaults to ${datadir}/zsh/site-functions)]),
@ -1563,6 +1577,7 @@ echo "
System State Path: ${PA_SYSTEM_STATE_PATH} System State Path: ${PA_SYSTEM_STATE_PATH}
System Config Path: ${PA_SYSTEM_CONFIG_PATH} System Config Path: ${PA_SYSTEM_CONFIG_PATH}
Zsh completions directory: ${zshcompletiondir} Zsh completions directory: ${zshcompletiondir}
Bash completions directory: ${bashcompletiondir}
Compiler: ${CC} Compiler: ${CC}
CFLAGS: ${CFLAGS} CFLAGS: ${CFLAGS}
CPPFLAGS: ${CPPFLAGS} CPPFLAGS: ${CPPFLAGS}