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

Re: Adding (compiling) a module to already build Zsh

On Wed, Sep 14, 2016 at 10:54 AM, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Sebastian Gniazdowski wrote:
>> > On Sep 12,  8:12am, Sebastian Gniazdowski wrote:
>> > } I think gdbm and pcre add linkage to additional libraries to
>> > } the Zsh binary itself.
> You can usually prevent that with something like
>   LDFLAGS='-Wl,--as-needed'
> Depending on you linker, the option might be -zignore.
> Or you can retrospectively remove the library from the NEEDED list with
> a tool like patchelf.
> The limitation is really with autoconf or at least our use of it.
> We add checks for libraries such as pcre and it adds -lpcre to the
> global list of linker options. I don't know whether anything has changed
> in autoconf to make it easier to limit that so it would only be used
> when linking the pcre module - anyone?


I did this at least 5 years ago so I didn't know as much then as I do
know about autoconf, but I think AC_CHECK_LIB is a convenience macro
for something that first checks if a lib is linkable, and then adds it
to the list of things to link to globally. We could just expand those
to the full thing that only does the check without adding, and since
the lib is always the same, the part of the patch that has the
unconditional lib names in the .mdd files should be fine?

ah, actually we can just provide the action-if-found action and it
won't add the name to LIBS for us, even better.

Mikael Magnusson

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