]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: add bash completetion configure option
authorSami Kerola <kerolasa@iki.fi>
Tue, 19 Mar 2013 22:24:41 +0000 (22:24 +0000)
committerSami Kerola <kerolasa@iki.fi>
Sat, 30 Mar 2013 10:17:49 +0000 (10:17 +0000)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Makefile.am
configure.ac
shell-completion/Makemodule.am [new file with mode: 0644]

index 3afcad16d3908820e71d21aeabed067f66d8fa1f..b963af941fd9d5cae5c56f91f3d2b8eca5fc1a70 100644 (file)
@@ -27,6 +27,8 @@ ul_libfdisk_incdir  = $(top_srcdir)/libfdisk/src
 
 pkgconfigdir = $(usrlib_execdir)/pkgconfig
 
+bashcompletiondir = @bashcompletiondir@
+
 dist_noinst_HEADERS =
 noinst_PROGRAMS =
 noinst_LTLIBRARIES =
@@ -87,6 +89,8 @@ include misc-utils/Makemodule.am
 include disk-utils/Makemodule.am
 include fdisks/Makemodule.am
 
+include shell-completion/Makemodule.am
+
 include tests/Makemodule.am
 
 #
@@ -158,6 +162,7 @@ checkdecl:
 ENABLE_ALL = --enable-static-programs --enable-most-builds
 DISTCHECK_CONFIGURE_FLAGS = --disable-use-tty-group \
                            --disable-silent-rules $(ENABLE_ALL) \
+                           --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
                            --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
 
 
index 92a5a3b124be1563abb170a3a65c943085e0d90f..cd4e826a9656f56e46b554f3a3d822fdfe5ca64d 100644 (file)
@@ -1342,6 +1342,18 @@ fi
 AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != "xno" ])
 
 
+AC_ARG_WITH([bashcompletiondir],
+  AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
+  [],
+  [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
+    with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
+  ], [
+    with_bashcompletiondir=${datadir}/bash-completion/completions
+  ])
+])
+AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
+
+
 AC_ARG_ENABLE([pg-bell],
   AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
   [], enable_pg_bell=yes
@@ -1463,6 +1475,7 @@ AC_MSG_RESULT([
        suid cflags:       ${SUID_CFLAGS}
        ldflags:           ${LDFLAGS}
        suid ldflags:      ${SUID_LDFLAGS}
+       Bash completions dir: ${with_bashcompletiondir}
 
        warnings:
 
diff --git a/shell-completion/Makemodule.am b/shell-completion/Makemodule.am
new file mode 100644 (file)
index 0000000..b784ec7
--- /dev/null
@@ -0,0 +1 @@
+dist_bashcompletion_DATA =