zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: Sebastian Gniazdowski <sgniazdowski@gmail.com>,
	Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Adding (compiling) a module to already build Zsh
Date: Wed, 14 Sep 2016 21:03:16 +0200	[thread overview]
Message-ID: <CAHYJk3TiGCvpnpGNCaAhgG6O-RxVqgg__Sx9SQ8pKUyDXOp92g@mail.gmail.com> (raw)
In-Reply-To: <45670.1473843287@hydra.kiddle.eu>

On Wed, Sep 14, 2016 at 10:54 AM, Oliver Kiddle <okiddle@yahoo.co.uk> 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?

http://cgit.mika.l3ib.org/cgit/zsh-cvs/commit/?h=a095c720fff0893b9f1ca3f96bb28de125aa155f

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?

https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Libraries.html
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


  parent reply	other threads:[~2016-09-14 19:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12  6:12 Sebastian Gniazdowski
2016-09-12 17:38 ` Bart Schaefer
2016-09-14  7:16   ` Sebastian Gniazdowski
2016-09-14  8:54     ` Oliver Kiddle
2016-09-14 16:19       ` Bart Schaefer
2016-09-14 19:03       ` Mikael Magnusson [this message]
2016-09-15 12:22         ` Sebastian Gniazdowski
2016-09-14 15:09     ` Lawrence Velázquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHYJk3TiGCvpnpGNCaAhgG6O-RxVqgg__Sx9SQ8pKUyDXOp92g@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=okiddle@yahoo.co.uk \
    --cc=sgniazdowski@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).