summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am12
-rw-r--r--bash-completion/ct-ng.in (renamed from ct-ng.comp.in)0
-rw-r--r--configure.ac28
3 files changed, 16 insertions, 24 deletions
diff --git a/Makefile.am b/Makefile.am
index 768a3c5..88ac882 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,12 +6,12 @@ include verbatim-data.mk
SUBDIRS = kconfig
bin_SCRIPTS = ct-ng
-CLEANFILES = ct-ng ct-ng.comp docs/ct-ng.1
-EXTRA_DIST = bootstrap ct-ng.in ct-ng.comp.in docs/ct-ng.1.in maintainer
+CLEANFILES = ct-ng bash-completion/ct-ng docs/ct-ng.1
+EXTRA_DIST = bootstrap ct-ng.in bash-completion/ct-ng.in docs/ct-ng.1.in maintainer
if INSTALL_BASH_COMPLETION
-compdir = $(sysconfdir)/@BASH_COMPLETION_DIR@
-comp_SCRIPTS = ct-ng.comp
+compdir = @BASH_COMPLETION_DIR@
+comp_SCRIPTS = bash-completion/ct-ng
endif
man1_MANS = docs/ct-ng.1
@@ -53,8 +53,8 @@ ct-ng: ct-ng.in Makefile
docs/ct-ng.1: docs/ct-ng.1.in Makefile
$(AM_V_GEN)$(MKDIR_P) docs && $(do_subst) < $< >$@-t && mv -f $@-t $@
-ct-ng.comp: ct-ng.comp.in Makefile
- $(AM_V_GEN)$(do_subst) < $< >$@-t && mv -f $@-t $@
+bash-completion/ct-ng: bash-completion/ct-ng.in Makefile
+ $(AM_V_GEN)$(MKDIR_P) bash-completion && $(do_subst) < $< >$@-t && mv -f $@-t $@
dist-hook: maintainer/download-docs.sh
$< $(top_distdir) $(USER_MANUAL_FILES)
diff --git a/ct-ng.comp.in b/bash-completion/ct-ng.in
index f38c881..f38c881 100644
--- a/ct-ng.comp.in
+++ b/bash-completion/ct-ng.in
diff --git a/configure.ac b/configure.ac
index 920e42d..c19d6ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,27 +33,19 @@ AC_ARG_ENABLE(
[run ct-ng from the current directory; 'make install' unsupported])])
AC_SUBST([enable_local], [${enable_local:-no}])
-AC_ARG_WITH([bash-completion-dir],
+AC_ARG_WITH([bash-completion],
[AS_HELP_STRING(
[--with-bash-completion],
- [install bash(1) command completion for ct-ng into specified directory,
- relative to sysconfdir])],
+ [install bash(1) command completion; can specify a path where it will be installed])],
[],
- [with_bash_completion_dir=bash_completion.d])
-AM_CONDITIONAL([INSTALL_BASH_COMPLETION], [test "${with_bash_completion_dir}" != "no" ])
-AC_SUBST([BASH_COMPLETION_DIR], [${with_bash_completion_dir}])
-
-# FIXME: I don't know why we have this. Will remove after the 1.24 release.
-AC_ARG_ENABLE(
- [shared],
- [AS_HELP_STRING(
- [--enable-shared],
- [build shared libraries (deprecated, ignored)])])
-AC_ARG_ENABLE(
- [static],
- [AS_HELP_STRING(
- [--enable-static],
- [build static libraries (deprecated, ignored)])])
+ [with_bash_completion=yes])
+AS_IF([test "${with_bash_completion}" = "no"],
+ [BASH_COMPLETION_DIR=],
+ [test "${with_bash_completion}" != "yes"],
+ [BASH_COMPLETION_DIR="${with_bash_completion}"],
+ [BASH_COMPLETION_DIR='${datadir}/bash-completion/completions'])
+AM_CONDITIONAL([INSTALL_BASH_COMPLETION], [test -n "${BASH_COMPLETION_DIR}"])
+AC_SUBST([BASH_COMPLETION_DIR])
# Check for --build and --host...
AC_CANONICAL_BUILD