From: Evgeni Golov Date: Sat, 12 Nov 2016 13:44:40 +0000 (+0100) Subject: install bash completion where pkg-config tells us to X-Git-Tag: lxc-1.0.9~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb8b3a8ebecf9658082514805ea58cdda5a7ac44;p=thirdparty%2Flxc.git install bash completion where pkg-config tells us to Signed-off-by: Evgeni Golov --- diff --git a/config/bash/Makefile.am b/config/bash/Makefile.am index b1768c9e1..b97e2a499 100644 --- a/config/bash/Makefile.am +++ b/config/bash/Makefile.am @@ -1,14 +1,5 @@ EXTRA_DIST = lxc if ENABLE_BASH -install-bash: - $(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/ - $(INSTALL_DATA) lxc $(DESTDIR)$(sysconfdir)/bash_completion.d/ - -uninstall-bash: - rm -f $(DESTDIR)$(sysconfdir)/bash_completion.d/lxc - rmdir $(DESTDIR)$(sysconfdir)/bash_completion.d/ || : - -install-data-local: install-bash -uninstall-local: uninstall-bash +dist_bashcomp_DATA = lxc endif diff --git a/configure.ac b/configure.ac index 44a6286d2..29105fb4a 100644 --- a/configure.ac +++ b/configure.ac @@ -413,6 +413,14 @@ AC_ARG_ENABLE([bash], [], [enable_bash=yes]) AM_CONDITIONAL([ENABLE_BASH], [test "x$enable_bash" = "xyes"]) +AM_COND_IF([ENABLE_BASH], + [AC_MSG_CHECKING([bash completion directory]) + PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], , + bashcompdir="${sysconfdir}/bash_completion.d") + AC_MSG_RESULT([$bashcompdir]) + AC_SUBST(bashcompdir) + ]) + # Optional test binaries AC_ARG_ENABLE([tests], [AC_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])],