diff --git a/.gitignore b/.gitignore index 0004bb6..8818ab0 100644 --- a/.gitignore +++ b/.gitignore @@ -22,8 +22,6 @@ depcomp config.log scripts/roswell* scripts/homebrew -scripts/completions/ros -scripts/completions/_ros *~ #* /documents/.sass-cache/ diff --git a/Makefile.am b/Makefile.am index 997155b..36ee4b6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = lisp src documents +SUBDIRS = lisp src documents scripts debian: ros scripts/debian.ros prepare: @@ -10,3 +10,4 @@ release-2: test: run-prove roswell-test.asd .PHONY: debian prepare-release test + diff --git a/configure.ac b/configure.ac index 650f77f..2cf4dec 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AC_PREREQ([2.65]) AC_INIT([roswell],[0.0.5.58],snmsts@gmail.com) AM_CONFIG_HEADER(config.h) -AC_CONFIG_FILES([Makefile src/Makefile documents/Makefile lisp/Makefile]) +AC_CONFIG_FILES([Makefile src/Makefile documents/Makefile lisp/Makefile scripts/Makefile]) AC_CONFIG_SRCDIR([src/Makefile.am]) AM_INIT_AUTOMAKE([foreign]) AM_MAINTAINER_MODE([enable]) @@ -80,4 +80,43 @@ AC_ARG_ENABLE([html_generation], esac],[]) AM_CONDITIONAL(HTML_GENERATE,[test x$html_generate = x"true"]) + + +AC_ARG_WITH([bash-completion], + AS_HELP_STRING([--with-bash-completion@<:@=INSTALL_DIR@:>@], + [Install the bash auto-completion script in this directory. default: yes, + and INSTALL_DIR will be the correct pathname given by pkg-config.]), + [], + [with_bash_completion=yes]) + +AS_IF([test "x$with_bash_completion" = "xyes"], + [PKG_CHECK_MODULES( + [BASH_COMPLETION], [bash-completion >= 2.0], + [BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"], + [with_bash_completion=no])]) + +AC_SUBST([BASH_COMPLETION_DIR]) +AM_CONDITIONAL([ENABLE_BASH_COMPLETION],[test "x$with_bash_completion" != "xno"]) + + +AC_ARG_WITH([zsh-completion], + AS_HELP_STRING([--with-zsh-completion@<:@=INSTALL_DIR@:>@], + [Install the zsh auto-completion script in this directory. default: yes, + and INSTALL_DIR will be the correct pathname given by pkg-config.]), + [], + [with_zsh_completion=yes]) + +AS_IF([test "x$with_zsh_completion" = "xyes"], + [PKG_CHECK_MODULES( + [ZSH_COMPLETION], [zsh-completion >= 2.0], + [ZSH_COMPLETION_DIR="`pkg-config --variable=completionsdir zsh-completion`"], + [with_zsh_completion=no])]) + +AC_SUBST([ZSH_COMPLETION_DIR]) +AM_CONDITIONAL([ENABLE_ZSH_COMPLETION],[test "x$with_zsh_completion" != "xno"]) + + + + + AC_OUTPUT diff --git a/lisp/Makefile.am b/lisp/Makefile.am index 735fc3c..55afd56 100644 --- a/lisp/Makefile.am +++ b/lisp/Makefile.am @@ -1,2 +1,3 @@ roslispdir = $(datadir)/common-lisp/source/$(PACKAGE) -roslisp_DATA = $(wildcard *.lisp) $(wildcard *.ros) $(wildcard *.asd) ../scripts/completions/ros-completion.bash ../scripts/completions/ros-completion.zsh +roslisp_DATA = $(wildcard *.lisp) $(wildcard *.ros) $(wildcard *.asd) + diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 0000000..6c6d70d --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,10 @@ + +if ENABLE_BASH_COMPLETION +bashcompletiondir = $(BASH_COMPLETION_DIR) +bashcompletion_DATA = completions/ros-completion.bash +endif + +if ENABLE_ZSH_COMPLETION +zshcompletiondir = $(ZSH_COMPLETION_DIR) +zshcompletion_DATA = completions/ros-completion.zsh +endif diff --git a/src/Makefile.am b/src/Makefile.am index f48a5f8..8ad5079 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,7 +19,7 @@ ros_SOURCES = ros.c opt.c download.c archive.c html.c \ noinst_HEADERS = util.h opt.h cmd-install.h gend.h -CLEANFILES = gend.h $(bashcompletion_DATA) $(zshcompletion_DATA) +CLEANFILES = gend.h FORCE: .PHONY: FORCE