Gentoo Logo
Gentoo Spaceship

Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
To: Willian Vale da Rocha <will.vdr@...>
From: Nathan Phillip Brink <binki@g.o>
Subject: Re: Linking Stage, building a ebuild
Date: Fri, 2 Dec 2011 03:37:25 +0000
On Fri, Dec 02, 2011 at 12:22:30AM -0300, Willian Vale da Rocha wrote:
> I'm writing a ebuild for GNU Radio, just to learn how to write and i
> doesn't found any where(or i was looking for wrong) how to define a LDFLAGS
> for the linking stage. GNU Radio need this because they use their library.
> If i don't explain correct, i going to show the line command that i trying
> to explain
> <pre>
> ./configure --prefix=$HOME/image LDFLAGS="-L$HOME/image/lib64
> <\pre>
> If i need to define prefix, how can i do it, and How can i use the LDFLAGS
> in ebuild
> Sorry about the english

Just so you know, such questions generally belong on the
gentoo-devhelp mailing list or in

In an attempt to answer your question, you should use the flag-o-matic
eclass to append directives to LDFLAGS. For example:

inherit flag-o-matic multilib

src_configure() {
	append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/special_package \


But you appear to be trying to link to something outside of a normal
Gentoo install. If a user wanted to link a program against his own
compiled copy of the library, he would instead just invoke emerge with
the proper LDFLAGS:

# LDFLAGS=-L"${HOME}"/image/lib64\ -Wl,-rpath,"${HOME}"/images/lib64 emerge -v my_package

If you are writing your ebuild to compile against a package/library
which is not available in portage, your first step should be to write
an ebuild for _that_ package. I.e., write the ebuild for the library
your program needs before writing the ebuild for the program. Then the
library would be properly installed into /usr/$(get_libdir) and appear
in GCC's normal searchpaths.

If this does not help, please ask again in #gentoo-dev-help or the
gentoo-devhelp ML :-).


Look out for missing or extraneous apostrophes!
pgpZFulQRwRi2.pgp (PGP signature)
Linking Stage, building a ebuild
-- Willian Vale da Rocha
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Linking Stage, building a ebuild
Next by thread:
Re: Linking Stage, building a ebuild
Previous by date:
Re: Linking Stage, building a ebuild
Next by date:
Re: Bleeding edge hardened-sources: move PaX markings from ELF to Extended Attributes

Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.