c78952
From 8eaf2f497a6bcffc5554509533940ac2b764b981 Mon Sep 17 00:00:00 2001
0ac23e
From: Peter Jones <pjones@redhat.com>
0ac23e
Date: Wed, 3 Apr 2013 14:35:34 -0400
31cddd
Subject: [PATCH] Move bash completion script (#922997)
0ac23e
0ac23e
Apparently these go in a new place now.
0ac23e
---
0ac23e
 configure.ac                       | 11 +++++++++++
0ac23e
 util/bash-completion.d/Makefile.am |  1 -
0ac23e
 2 files changed, 11 insertions(+), 1 deletion(-)
0ac23e
0ac23e
diff --git a/configure.ac b/configure.ac
ec4acb
index 571f7a0b5aa..9ae97f026ab 100644
0ac23e
--- a/configure.ac
0ac23e
+++ b/configure.ac
6f1e3d
@@ -288,6 +288,14 @@ AC_SUBST(grubdirname)
0ac23e
 AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
0ac23e
     [Default grub directory name])
0ac23e
 
0ac23e
+PKG_PROG_PKG_CONFIG
0ac23e
+AS_IF([$($PKG_CONFIG --exists bash-completion)], [
0ac23e
+	bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
0ac23e
+] , [
0ac23e
+	bashcompletiondir=${datadir}/bash-completion/completions
0ac23e
+])
0ac23e
+AC_SUBST(bashcompletiondir)
0ac23e
+
0ac23e
 #
0ac23e
 # Checks for build programs.
0ac23e
 #
6f1e3d
@@ -497,6 +505,9 @@ HOST_CFLAGS="$HOST_CFLAGS $grub_cv_cc_w_extra_flags"
0ac23e
 # Check for target programs.
0ac23e
 #
0ac23e
 
0ac23e
+# This makes sure pkg.m4 is available.
0ac23e
+m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
0ac23e
+
0ac23e
 # Find tools for the target.
0ac23e
 if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
0ac23e
   tmp_ac_tool_prefix="$ac_tool_prefix"
0ac23e
diff --git a/util/bash-completion.d/Makefile.am b/util/bash-completion.d/Makefile.am
ec4acb
index 136287cf1bf..61108f05429 100644
0ac23e
--- a/util/bash-completion.d/Makefile.am
0ac23e
+++ b/util/bash-completion.d/Makefile.am
0ac23e
@@ -6,7 +6,6 @@ EXTRA_DIST = $(bash_completion_source)
0ac23e
 
0ac23e
 CLEANFILES = $(bash_completion_script) config.log
0ac23e
 
0ac23e
-bashcompletiondir = $(sysconfdir)/bash_completion.d
0ac23e
 bashcompletion_DATA = $(bash_completion_script)
0ac23e
 
0ac23e
 $(bash_completion_script): $(bash_completion_source) $(top_builddir)/config.status