diff options
author | Ali Abdallah <ali.abdallah@suse.com> | 2020-07-16 11:30:14 +0200 |
---|---|---|
committer | Ali Abdallah <ali.abdallah@suse.com> | 2020-07-16 11:30:14 +0200 |
commit | 4102ed6bcdc609dbace91378327be83fb0e4bac7 (patch) | |
tree | ec8b3f070512fa576f6621ad477a999fc3a395fb /configure.ac.in | |
parent | 25a7e40d75e48202fcce540e7e43cd6a7a3c4689 (diff) | |
download | xfconf-4102ed6bcdc609dbace91378327be83fb0e4bac7.tar.gz |
Fix distcheck bash-completion file error
Diffstat (limited to 'configure.ac.in')
-rw-r--r-- | configure.ac.in | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/configure.ac.in b/configure.ac.in index 92b6818..ff3ad14 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -196,20 +196,24 @@ AM_CONDITIONAL([ENABLE_PROFILING], [test "x$enable_profiling" = "xyes"]) dnl Bash completion for xfconf-query. AC_ARG_WITH([bash-completion-dir], - AS_HELP_STRING([--with-bash-completion-dir[=PATH]], - [Install the bash auto-completion script in this directory. @<:@default=yes@:>@]), - [], - [with_bash_completion_dir=yes]) - -if test "x$with_bash_completion_dir" = "xyes"; then - PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], - [BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"], - [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"]) -else - BASH_COMPLETION_DIR="$with_bash_completion_dir/completions" -fi + AS_HELP_STRING([--with-bash-completion-dir[=PATH]], + [Install the bash-completion script in this directory. @<:@default=yes@:>@]), + [], + [with_bash_completion_dir=yes]) +AS_IF([test "x$with_bash_completion_dir" = xyes], + [AC_MSG_CHECKING([for bash-completion directory]) + AS_IF([test "x$PKG_CONFIG" != x \ + && bash_completion_prefix=`$PKG_CONFIG --print-errors --variable=prefix bash-completion 2>&AS_MESSAGE_LOG_FD` \ + && bash_completion_dir=`"$PKG_CONFIG --print-errors --variable=completionsdir bash-completion 2>&AS_MESSAGE_LOG_FD`], + [bash_completion_dir="${bash_completion_dir#"$bash_completion_prefix"}" + bash_completion_dir="${bash_completion_dir#/}" + BASH_COMPLETION_DIR='${prefix}'/"$bash_completion_dir"], + [BASH_COMPLETION_DIR='${datadir}/bash-completion/completions']) + AC_MSG_RESULT([$BASH_COMPLETION_DIR])], + [BASH_COMPLETION_DIR="$with_bash_completion_dir"]) AC_SUBST([BASH_COMPLETION_DIR]) -AM_CONDITIONAL([ENABLE_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"]) +AM_CONDITIONAL([ENABLE_BASH_COMPLETION], + [test "x$with_bash_completion_dir" != xno]) AC_OUTPUT([ Makefile |