bash-completion: Detect the appropriate directory for installation

This commit is contained in:
Mike Swanson 2015-10-27 09:30:24 -07:00
parent 6ce8514c98
commit c3e5879502
3 changed files with 16 additions and 1 deletions

View file

@ -117,6 +117,13 @@ AC_SDL_MAIN_WORKAROUND([
AC_CHECK_LIB(amd64, amd64_iopl)
])
AC_ARG_WITH([bashcompletiondir],
AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completion directory]),
[],
[AS_IF([$($PKG_CONFIG --exists bash-completion)],
[bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)],
[bashcompletiondir=${datadir}/bash-completion/completions])])
case $host in
*cygwin* | *mingw* )
AC_CHECK_TOOL(WINDRES, windres, )
@ -167,6 +174,8 @@ AC_SUBST(PACKAGE_MAINTAINER)
AC_SUBST(PACKAGE_URL)
AC_SUBST(PACKAGE_ISSUES)
AC_SUBST(bashcompletiondir)
dnl Shut up the datarootdir warnings.
AC_DEFUN([AC_DATAROOTDIR_CHECKED])

4
man/bash-completion/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
*doom
*heretic
*hexen
*strife

View file

@ -1,3 +1,5 @@
bashcompletiondir=@bashcompletiondir@
BASH_COMPLETION_TEMPLATES = \
doom.template \
heretic.template \
@ -12,7 +14,7 @@ BASH_COMPLETION_SCRIPTLETS = \
@PROGRAM_PREFIX@hexen \
@PROGRAM_PREFIX@strife
noinst_DATA = $(BASH_COMPLETION_SCRIPTLETS)
bashcompletion_DATA = $(BASH_COMPLETION_SCRIPTLETS)
CLEANFILES = $(BASH_COMPLETION_SCRIPTLETS)
MANDIR = $(top_srcdir)/man