From 038c0a136053dc89f162b38f003e9ededdb88281 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 24 Mar 2015 13:13:29 -0400 Subject: [PATCH] bash-completion: Respect the prefix Don't try and install the bash helpers outside the defined prefix. https://bugzilla.gnome.org/show_bug.cgi?id=744877 --- configure.ac | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 9e4582662b..8013c9665e 100644 --- a/configure.ac +++ b/configure.ac @@ -141,12 +141,20 @@ AC_ARG_WITH([bash-completion-dir], [], [with_bash_completion_dir=yes]) -if test "x$with_bash_completion_dir" = "xyes"; then +if test "x$with_bash_completion_dir" = "xyes" +then + extra_args= + + if test "x$prefix" != "xNONE" + then + extra_args="--define-variable=prefix=\"$prefix\"" + fi + PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], - [BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"], + [BASH_COMPLETION_DIR="`eval pkg-config $extra_args --variable=completionsdir bash-completion`"], [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"]) PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], - [BASH_HELPERS_DIR="`pkg-config --variable=helpersdir bash-completion`"], + [BASH_HELPERS_DIR="`eval pkg-config $extra_args --variable=helpersdir bash-completion`"], [BASH_HELPERS_DIR="$datadir/bash-completion/helpers"]) else BASH_COMPLETION_DIR="$with_bash_completion_dir/completions"