From cf5f62ffb609876e288fc475f80253c055c5ab08 Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Sat, 30 Apr 2016 16:57:24 +0200 Subject: [PATCH] Don't hardcode path for bash completions Instead, use pkg-config to find out where the completions should go. --- configure.ac | 3 +++ src/Makefile.am | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 415b43f..e168e64 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,9 @@ AM_SILENT_RULES([yes]) AC_PROG_CC AC_LANG([C]) AC_PROG_INSTALL +PKG_PROG_PKG_CONFIG +PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], , bashcompdir="${sysconfdir}/bash_completion.d") +AC_SUBST(bashcompdir) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([src/Makefile]) AC_CONFIG_FILES([man/Makefile]) diff --git a/src/Makefile.am b/src/Makefile.am index 124cf94..321b201 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,5 +7,5 @@ gotty_SOURCES = tty.c \ include/gotty/options.h \ include/gotty/time.h \ include/gotty/print.h -bashcompletiondir=$(sysconfdir)/bash_completion.d +bashcompletiondir=@bashcompdir@ dist_bashcompletion_DATA=bash-completion/gotty