From ab173d14437b4eea67bea139a5c28645d6b2ae88 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 1 Mar 2024 18:27:35 -0800 Subject: [PATCH] configure: Don't build shell completions when disabled With the recent changes to completion file building, the files were built always and only installation was selectively disabled. Now, when they are disabled they aren't even built, avoiding a build-time error in environments where it's not possible to run the curl binary that was just created (e.g. if library paths were not set up correctly). Follow-up to 0f7aba83c Reported-by: av223119 on github Fixes #13027 Closes #13030 --- scripts/Makefile.am | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e3e056ca7a..4a30d41755 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -29,13 +29,18 @@ ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@ FISH_FUNCTIONS_DIR = @FISH_FUNCTIONS_DIR@ PERL = @PERL@ +if USE_ZSH_COMPLETION ZSH_COMPLETION_FUNCTION_FILENAME = _curl +endif +if USE_FISH_COMPLETION FISH_COMPLETION_FUNCTION_FILENAME = curl.fish +endif CLEANFILES = $(ZSH_COMPLETION_FUNCTION_FILENAME) $(FISH_COMPLETION_FUNCTION_FILENAME) all-local: $(ZSH_COMPLETION_FUNCTION_FILENAME) $(FISH_COMPLETION_FUNCTION_FILENAME) +if USE_ZSH_COMPLETION $(ZSH_COMPLETION_FUNCTION_FILENAME): completion.pl if CROSSCOMPILING @echo "NOTICE: we can't generate zsh completion when cross-compiling!" @@ -43,7 +48,9 @@ else # if not cross-compiling: if test -z "$(PERL)"; then echo "No perl: can't install completion script"; else \ $(PERL) $(srcdir)/completion.pl --curl $(top_builddir)/src/curl$(EXEEXT) --shell zsh > $@ ; fi endif +endif +if USE_FISH_COMPLETION $(FISH_COMPLETION_FUNCTION_FILENAME): completion.pl if CROSSCOMPILING @echo "NOTICE: we can't generate fish completion when cross-compiling!" @@ -51,6 +58,7 @@ else # if not cross-compiling: if test -z "$(PERL)"; then echo "No perl: can't install completion script"; else \ $(PERL) $(srcdir)/completion.pl --curl $(top_builddir)/src/curl$(EXEEXT) --shell fish > $@ ; fi endif +endif install-data-local: if CROSSCOMPILING