Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure.ac: Use standard --with-bash-completion-dir option #174

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions configure.ac
Expand Up @@ -133,19 +133,22 @@ PKG_CHECK_MODULES([UUID], [uuid],
[AC_DEFINE([HAVE_UUID], [1], [Define to 1 if using libuuid])])
PKG_CHECK_MODULES([JSON], [json-c])

AC_ARG_WITH([bash],
AS_HELP_STRING([--with-bash],
[Enable bash auto-completion. @<:@default=yes@:>@]),
AC_ARG_WITH([bash-completion-dir],
AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
[Enable bash auto-completion. Uses pkgconfig if no path given. @<:@default=yes@:>@]),
[],
[with_bash=yes])
[with_bash_completion_dir=yes])

if test "x$with_bash" = "xyes"; then
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=$($PKG_CONFIG --variable=completionsdir bash-completion)],
[BASH_COMPLETION_DIR="$datadir/bash-completion/completions"])
else
BASH_COMPLETION_DIR="$with_bash_completion_dir"
fi

AC_SUBST([BASH_COMPLETION_DIR])
AM_CONDITIONAL([ENABLE_BASH_COMPLETION], [test "x$with_bash" = "xyes"])
AM_CONDITIONAL([ENABLE_BASH_COMPLETION], [test "x$with_bash_completion_dir" != "xno"])

AC_ARG_ENABLE([local],
AS_HELP_STRING([--disable-local], [build against kernel ndctl.h @<:@default=system@:>@]),
Expand Down