From: Stefan Schantl Date: Fri, 24 Feb 2023 16:22:06 +0000 (+0100) Subject: Install bash-completion files. X-Git-Tag: 0.9.17~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e52c3bc57ea17cd558204a4038c2e0f1bf8de40;p=location%2Flibloc.git Install bash-completion files. Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 7f0d8d0..01e4f01 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,8 @@ if ENABLE_PERL BINDINGS += perl endif +bashcompletiondir = @bashcompletiondir@ + AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ @@ -175,6 +177,13 @@ EXTRA_DIST += \ CLEANFILES += \ src/libloc.pc +#dist_bashcompletion_DATA = + +if BUILD_BASH_COMPLETION +dist_bashcompletion_DATA = \ + bash-completion/location +endif + dist_pkgpython_PYTHON = \ src/python/location/__init__.py \ src/python/location/database.py \ diff --git a/configure.ac b/configure.ac index 96e6b0e..0144dbe 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,41 @@ AC_CHECK_PROGS(ASCIIDOC, [asciidoc]) if test "${have_man_pages}" = "yes" && test -z "${ASCIIDOC}"; then AC_MSG_ERROR([Required program 'asciidoc' not found]) fi + +# - pkg-config ----------------------------------------------------------------- + +m4_ifndef([PKG_PROG_PKG_CONFIG], + [m4_fatal([Could not locate the pkg-config autoconf + macros. These are usually located in /usr/share/aclocal/pkg.m4. + If your macros are in a different location, try setting the + environment variable AL_OPTS="-I/other/macro/dir" before running + ./autogen.sh or autoreconf again. Make sure pkg-config is installed.])]) + +PKG_PROG_PKG_CONFIG +PKG_INSTALLDIR(['${usrlib_execdir}/pkgconfig']) + +# - bash-completion ------------------------------------------------------------ + +#enable_bash_completion=yes +AC_ARG_WITH([bashcompletiondir], + AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]), + [], + [AS_IF([`$PKG_CONFIG --exists bash-completion`], [ + with_bashcompletiondir=`$PKG_CONFIG --variable=completionsdir bash-completion` + ], [ + with_bashcompletiondir=${datadir}/bash-completion/completions + ]) +]) + +AC_SUBST([bashcompletiondir], [$with_bashcompletiondir]) + +AC_ARG_ENABLE([bash-completion], + AS_HELP_STRING([--disable-bash-completion], [do not install bash completion files]), + [], [enable_bash_completion=yes] +) + +AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes]) + # - debug ---------------------------------------------------------------------- AC_ARG_ENABLE([debug], @@ -229,6 +264,7 @@ AC_MSG_RESULT([ database path: ${with_database_path} debug: ${enable_debug} systemd support: ${have_systemd} + bash-completion: ${enable_bash_completion} Bindings: Perl: ${enable_perl}