public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Albert Hopkins <marduk@letterboxes.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Building static libraries
Date: Sun, 13 Dec 2009 15:40:34 -0500	[thread overview]
Message-ID: <1260736834.11448.15.camel@centar> (raw)
In-Reply-To: <20091213201857.48f77322@gmx.net>

On Sun, 2009-12-13 at 20:18 +0100, Renat Golubchyk wrote:
> Hi everyone!
> 
> I need to build a static binary of a program I wrote. The problem is
> that most packages only install dynamic version of the libraries.
> There
> are the "static" and "static-libs" USE flags, but only a tiny fraction
> of packages support them. Modifying every relevant ebuild is not
> really
> a viable solution since the list of packages is quite long and could
> change later.
> 
> So what can I do if I'd like to avoid compiling every package
> manually?

There is no easy answer to your question. I think because, with a lot of
programs it "just depends". Some packages already include static
libraries (e.g. python and it doesn't make sense to compile the python
package statically because it will break a great many things).  Some
programs just weren't designed to be static (e.g. imagemagick or
apache).  GTK+, i believe, can't be built statically as it uses dynload
for themes, input methods, etc etc.  Even most proprietary gtk-based
software that I know of (e.g. Adobe Flash and VMWare) either are
distributed with GTK+ linked dynamically or they provide their own GTK
libs).  

You can apply "-static" to CFLAGS, but make sure you have a binpkg built
first, as there is a chance you may break something.  You can also try
passing "--enable-static" to EXTRA_ECONF.  That's probably safer than
the former, but the same caveat applies.

Most of the things where static is "useful" and safe already have a
static flag though or provide static libs by default.  I think the only
exception I've encountered was e2fsprogs.  For that I usually compile my
own static executables.

HTH,
-a





  reply	other threads:[~2009-12-13 20:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-13 19:18 [gentoo-user] Building static libraries Renat Golubchyk
2009-12-13 20:40 ` Albert Hopkins [this message]
2009-12-14  0:27   ` Renat Golubchyk
2009-12-13 22:47 ` [gentoo-user] " walt
2009-12-14  0:27   ` Renat Golubchyk
2009-12-14  1:53     ` Albert Hopkins
2009-12-14  2:19       ` Renat Golubchyk
2009-12-14 18:28     ` walt
2009-12-14 20:19       ` Allan Gottlieb
2009-12-14 20:25       ` Alan McKinnon
2009-12-15  6:53         ` Renat Golubchyk
2009-12-14 21:16       ` Renat Golubchyk

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=1260736834.11448.15.camel@centar \
    --to=marduk@letterboxes.org \
    --cc=gentoo-user@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox