@@ -19,6 +19,20 @@ AC_PROG_MAKE_SET
1919
2020AM_MAINTAINER_MODE
2121
22+ # Install bash completion script
23+ AC_ARG_WITH ( [ bash-completion-path] ,
24+ [ AS_HELP_STRING ( [ --with-bash-completion-path=DIR] ,
25+ [ Custom installation directory for the bash completion script (Default=/usr/share/bash-completion/completions)] ) ] ,
26+ [ bash_completion_dir="$withval"] ,
27+ [ bash_completion_dir="/usr/share/bash-completion/completions"] )
28+
29+ # Install zsh completion script
30+ AC_ARG_WITH ( [ zsh-completion-path] ,
31+ [ AS_HELP_STRING ( [ --with-zsh-completion-path=DIR] ,
32+ [ Custom installation directory for the zsh completion script (Default=/usr/share/zsh/site-functions)] ) ] ,
33+ [ zsh_completion_dir="$withval"] ,
34+ [ zsh_completion_dir="/usr/share/zsh/site-functions"] )
35+
2236m4_pattern_forbid ( [ ^AX_] ,[ => GNU autoconf-archive not present. <=] )
2337AS_IF ( [ test "x$orig_CFLAGS" = "x"] , [
2438 CFLAGS=""
@@ -61,8 +75,14 @@ AS_IF([test "x$LIBBSD_NEEDED" = "xyes"], [
6175 [ AC_MSG_ERROR ( [ BSD functions not found, libbsd is required] ) ] )
6276] )
6377
78+ AM_CONDITIONAL(BASH, [ test "x$bash_completion_dir" != "xno"] )
79+ AM_CONDITIONAL(ZSH, [ test "x$zsh_completion_dir" != "xno"] )
80+
6481AC_SUBST ( [ LIBS] , [ "$SCROT_DEPS_LIBS $LIBBSD_LIBS $LIBS"] )
6582AC_SUBST ( [ CPPFLAGS] , [ "$SCROT_DEPS_CFLAGS $LIBBSD_CFLAGS $CPPFLAGS"] )
6683
84+ AC_SUBST ( [ bash_completion_dir] )
85+ AC_SUBST ( [ zsh_completion_dir] )
86+
6787AC_CONFIG_FILES ( [ Makefile src/Makefile] )
6888AC_OUTPUT
0 commit comments