summaryrefslogtreecommitdiff
blob: d6a796ab9796d35c42ec0299d2467e7bb94ae1a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
https://github.com/pmem/ndctl/pull/174

From 92485810ce872c92b925ccdf4e3b58fa37ccbb8e Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Sat, 17 Jul 2021 19:31:56 +0100
Subject: [PATCH] change bash-completion

---
 configure.ac | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5ec8d2f..f7b1aed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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@:>@]),
-- 
2.32.0