bin_SCRIPTS = curl-config
-SUBDIRS = lib src include
+SUBDIRS = lib src include scripts
DIST_SUBDIRS = $(SUBDIRS) tests packages docs
pkgconfigdir = $(libdir)/pkgconfig
fi
+dnl **********************************************************************
+dnl Check for zsh completion path
+dnl **********************************************************************
+
+OPT_ZSH_FPATH=default
+AC_ARG_WITH(zsh-functions-dir,
+AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
+AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
+ [OPT_ZSH_FPATH=$withval])
+case "$OPT_ZSH_FPATH" in
+ no)
+ dnl --without-zsh-functions-dir option used
+ ;;
+ default|yes)
+ dnl --with-zsh-functions-dir option used without path
+ ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
+ AC_SUBST(ZSH_FUNCTIONS_DIR)
+ ;;
+ *)
+ dnl --with-zsh-functions-dir option used with path
+ ZSH_FUNCTIONS_DIR="$withval"
+ AC_SUBST(ZSH_FUNCTIONS_DIR)
+ ;;
+esac
+
dnl **********************************************************************
dnl Back to "normal" configuring
dnl **********************************************************************
include/curl/Makefile \
src/Makefile \
lib/Makefile \
+ scripts/Makefile \
lib/libcurl.vers \
tests/Makefile \
tests/certs/Makefile \
--- /dev/null
+ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@
+PERL = @PERL@
+
+ZSH_COMPLETION_FUNCTION_FILENAME = _curl
+
+all-local: $(ZSH_COMPLETION_FUNCTION_FILENAME)
+
+$(ZSH_COMPLETION_FUNCTION_FILENAME): zsh.pl
+ $(PERL) $< > $@
+
+install-data-local:
+ $(MKDIR_P) $(ZSH_FUNCTIONS_DIR)
+ $(INSTALL_DATA) $(ZSH_COMPLETION_FUNCTION_FILENAME) $(ZSH_FUNCTIONS_DIR)/$(ZSH_COMPLETION_FUNCTION_FILENAME)