Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Building a new ZSH module outside the ZSH source tree

On 25 maja 2017 at 00:41:41, tetsujin@xxxxxxxxxxxxx (tetsujin@xxxxxxxxxxxxx) wrote:
> Perhaps the best answer is to call into the script from my module's
> build system, and then use the Makefile it generates. Perhaps that
> could even work without having to place my module in a subdirectory of
> the shell's build tree? (Not sure about that one.)

I think it will work, all is needed is what is automatically generated from .c files – functions marked with /**/ are exported, etc. I didn't do this, have this in back of my head, currently I focus on the body of the topic – the actual modules – having the Zsh's configure script handling things for me.

One thing: from Zsh 5.2 there was introduced addmodulefd() call. Created file descriptors should be registered with it. So module will need #ifdefs disabling this call to properly load on zsh-5.0.8 or similar. I think what the addmodulefd() does isn't actually or fully used within shell, the fd-management still actually relies on dup, dup2 knowing which FDs are taken and which are free. Am I right, could someone clarify?

I'm looking for a way to disable addmodule fd call, either at compile time (would have to guess that user has zsh < 5.2, or use --disable-addfd configure option), or at run-time.

Sebastian Gniazdowski
psprint /at/ zdharma.org

Messages sorted by: Reverse Date, Date, Thread, Author