Skip to content

Commit

Permalink
scripts: fix zsh completion generation
Browse files Browse the repository at this point in the history
The script should use the just-built curl, not the system one. This fixes
zsh completion generation when no system curl is installed.
  • Loading branch information
ghedo authored and bagder committed Jan 11, 2016
1 parent 92a2041 commit fb7cbf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/Makefile.am
Expand Up @@ -28,7 +28,7 @@ all-local: $(ZSH_COMPLETION_FUNCTION_FILENAME)

$(ZSH_COMPLETION_FUNCTION_FILENAME): zsh.pl
@if ! test -x "$(PERL)"; then echo "No perl: can't install zsh.pl"; exit 0; fi
$(PERL) $(srcdir)/zsh.pl > $@
$(PERL) $(srcdir)/zsh.pl $(top_builddir)/src/curl > $@

install-data-local:
$(MKDIR_P) $(DESTDIR)$(ZSH_FUNCTIONS_DIR)
Expand Down

1 comment on commit fb7cbf7

@pghmcfc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change can break dynamic builds where there is no existing libcurl on the system:

Making all in scripts
make[1]: Entering directory `/builddir/build/BUILD/curl-7.47.0/scripts'
/usr/bin/perl ./zsh.pl ../src/curl > _curl
/builddir/build/BUILD/curl-7.47.0/src/.libs/lt-curl: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
curl returned 127 with output:
make[1]: *** [_curl] Error 127
make[1]: Leaving directory `/builddir/build/BUILD/curl-7.47.0/scripts'
make: *** [all-recursive] Error 1

I've been able to work around this by changing scripts/Makefile.am (and the resulting scripts/Makefile.in) to use LD_LIBRARY_PATH to specify the library location:

--- scripts/Makefile.am
+++ scripts/Makefile.am
@@ -31,7 +31,7 @@ if CROSSCOMPILING
    @echo "NOTICE: we can't generate zsh completion when cross-compiling!"
 else # if not cross-compiling:
    @if ! test -x "$(PERL)"; then echo "No perl: can't install zsh.pl"; exit 0; fi
-   $(PERL) $(srcdir)/zsh.pl $(top_builddir)/src/curl > $@
+   LD_LIBRARY_PATH=$(top_builddir)/lib/.libs $(PERL) $(srcdir)/zsh.pl $(top_builddir)/src/curl > $@
 endif

 install-data-local:

I suspect that's not a very portable fix though.

Please sign in to comment.