Skip to content

Commit

Permalink
build: Install zsh completion
Browse files Browse the repository at this point in the history
Fixes curl#534
  • Loading branch information
danielshahaf committed Nov 20, 2015
1 parent 8056208 commit 79b00ed
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -49,3 +49,4 @@ missing
mkinstalldirs
tags
test-driver
scripts/_curl
2 changes: 1 addition & 1 deletion Makefile.am
Expand Up @@ -140,7 +140,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \

bin_SCRIPTS = curl-config

SUBDIRS = lib src include
SUBDIRS = lib src include scripts
DIST_SUBDIRS = $(SUBDIRS) tests packages docs

pkgconfigdir = $(libdir)/pkgconfig
Expand Down
26 changes: 26 additions & 0 deletions configure.ac
Expand Up @@ -3030,6 +3030,31 @@ if test X"$want_h2" != Xno; then

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-nghttp2],[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-nghttp2 option used with path
ZSH_FUNCTIONS_DIR="$withval"
AC_SUBST(ZSH_FUNCTIONS_DIR)
;;
esac

dnl **********************************************************************
dnl Back to "normal" configuring
dnl **********************************************************************
Expand Down Expand Up @@ -3797,6 +3822,7 @@ AC_CONFIG_FILES([Makefile \
include/curl/Makefile \
src/Makefile \
lib/Makefile \
scripts/Makefile \
lib/libcurl.vers \
tests/Makefile \
tests/certs/Makefile \
Expand Down
13 changes: 13 additions & 0 deletions scripts/Makefile.am
@@ -0,0 +1,13 @@
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)

0 comments on commit 79b00ed

Please sign in to comment.