[pulseaudio-discuss] [PATCH] build-sys: Fix up setting the bash completion dir

arun at accosted.net arun at accosted.net
Mon Jul 27 21:40:41 PDT 2015


From: Arun Raghavan <git at arunraghavan.net>

This makes setting up the bash completion dir consistent with the other
cases that we need to deal with, and also handles distcheck correctly.
---
 Makefile.am  |  2 +-
 configure.ac | 17 ++++++-----------
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 887cbe5..8af6b37 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -113,4 +113,4 @@ $(top_srcdir)/.version:
 DISTCLEANFILES = \
         po/.intltool-merge-cache
 
-DISTCHECK_CONFIGURE_FLAGS = --with-udev-rules-dir="$$dc_install_base/lib/udev/rules.d" --with-systemduserunitdir="$$dc_install_base/lib/systemd/user"
+DISTCHECK_CONFIGURE_FLAGS = --with-udev-rules-dir="$$dc_install_base/lib/udev/rules.d" --with-systemduserunitdir="$$dc_install_base/lib/systemd/user" --with-bash-completion-dir="$$dc_install_base/etc/bash_completion.d"
diff --git a/configure.ac b/configure.ac
index 9e65684..6a6d584 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1436,17 +1436,12 @@ AC_ARG_WITH(
 
 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_ARG_WITH([bash-completion-dir],
+        AS_HELP_STRING([--with-bash-completion-dir=DIR], [Directory for bash completion files]),
+        [bashcompletiondir=$withval], [bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)])
+if test "x$bashcompletionsdir" = ""; then
+	bashcompletiondir="${sysconfdir}/bash_completion.d"
+fi
 
 AC_SUBST(bashcompletiondir)
 
-- 
2.4.3



More information about the pulseaudio-discuss mailing list