mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Add support for configurable bash completion path
Rewrote the configure script to support the following options: --with-bash-completion-dir=PATH --without-bash-completion-dir
This commit is contained in:
parent
ce15665214
commit
d574172205
2 changed files with 24 additions and 4 deletions
19
configure.ac
19
configure.ac
|
|
@ -6,9 +6,24 @@ 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_ARG_WITH([bash-completion-dir],
|
||||
AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
|
||||
[Install the bash auto-completion script in this directory. @<:@default=yes@:>@]),
|
||||
[],
|
||||
[with_bash_completion_dir=yes])
|
||||
|
||||
if test "x$with_bash_completion_dir" = "xyes"; then
|
||||
PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
|
||||
[BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"],
|
||||
[BASH_COMPLETION_DIR="${sysconfdir}/bash_completion.d"])
|
||||
else
|
||||
BASH_COMPLETION_DIR="$with_bash_completion_dir"
|
||||
fi
|
||||
AC_SUBST([BASH_COMPLETION_DIR])
|
||||
AM_CONDITIONAL([ENABLE_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"])
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_CONFIG_FILES([src/Makefile])
|
||||
AC_CONFIG_FILES([man/Makefile])
|
||||
|
|
|
|||
|
|
@ -3,9 +3,14 @@ gotty_SOURCES = tty.c \
|
|||
options.c \
|
||||
time.c \
|
||||
main.c \
|
||||
log.c \
|
||||
include/gotty/tty.h \
|
||||
include/gotty/options.h \
|
||||
include/gotty/time.h \
|
||||
include/gotty/print.h
|
||||
bashcompletiondir=@bashcompdir@
|
||||
include/gotty/print.h \
|
||||
include/gotty/log.h
|
||||
|
||||
if ENABLE_BASH_COMPLETION
|
||||
bashcompletiondir=@BASH_COMPLETION_DIR@
|
||||
dist_bashcompletion_DATA=bash-completion/gotty
|
||||
endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue