From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RWK1A-0005YS-Au for garchives@archives.gentoo.org; Fri, 02 Dec 2011 03:42:32 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C1A8821C0AA; Fri, 2 Dec 2011 03:42:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8444D21C039 for ; Fri, 2 Dec 2011 03:41:44 +0000 (UTC) Received: by smtp.gentoo.org (Postfix, from userid 2297) id 14F2C1B400A; Fri, 2 Dec 2011 03:41:44 +0000 (UTC) Date: Fri, 2 Dec 2011 03:37:25 +0000 From: Nathan Phillip Brink To: Willian Vale da Rocha Cc: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Linking Stage, building a ebuild Message-ID: <20111202033725.GB10880@ohnopublishing.net> References: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1cuoifddPMEMFeiS" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Archives-Salt: c68a20b4-fc0c-4f52-b3a0-6819c57f72c1 X-Archives-Hash: 41bfd596ca07ad27c55a89a2f4b9025d --1cuoifddPMEMFeiS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 LDFLA= GS > 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 >
> ./configure --prefix=3D$HOME/image LDFLAGS=3D"-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
>=20
> Sorry about the english

Just so you know, such questions generally belong on the
gentoo-devhelp mailing list or in
irc://chat.freenode.net/gentoo-dev-help.

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 \
		-Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/special_package

	econf
}

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=3D-L"${HOME}"/image/lib64\ -Wl,-rpath,"${HOME}"/images/lib64 emer=
ge -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 :-).

--=20
binki

Look out for missing or extraneous apostrophes!

--1cuoifddPMEMFeiS
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iQIcBAEBCAAGBQJO2Ef1AAoJEHQ6UuhrqBBQy3oP/icxUd4vK6C0toN/ythvWIEQ
Ay4G9dv1w5wdbr8+DecAcYB1gg3FqwTJVhu44XwmvX3ZEQ9ecgrtWO3EaqudMB5x
HOyYVsCOLlsgXNSg5dAEm9lYkVZwMz5XlHj+YkuYzOmMGp4gjYxvqdqQ+cwFL57z
BRISNEukuTDesVIGX068r6VnyC3+FcfknbXclONU2T00GCbHsOeaWCt2VUia0K00
41CtmFLaoCJd3uHSqywlyBHC0umI4Zurynyw0PhQNE8AYLC1fm8nEFSl9DkL4Fq1
L4X9W2u2aLXFx3L2PKP8PqCvV0bDlA2SAzzRa/A4ZjQpjSLxwwQwr/nM8NsRQYGk
KklI79BIdyASDKSiGlOY58THr8VRW5e973FO4jXtzbX7RKWd+rdLD5LttimvfET5
K5N2tukLjRGivet3VnPLbH/7p88AoKLES9IJR4lfiRZBhYsK4/Zqd0Ybnp39uy/u
oan8YtsoAYjbC+oVz8hsgO+uf62+OpvLOrg7tDS8E7J7UojSRQjtxJ8Y43fppxTt
1AeqJXnsZ5xXWqr18Fq2nmzrgB6kBnt6ZxuhNnLTymOG/L7+zGf5ls19HaoaIBAI
+9j0uuQKyeJnG2sqzDL0oBQ9IQ0Q4LfbESmgFoXtwRqe1/EfRL93AK0WiXkOEF9H
N6pdy90ljQBUVQmnRP0v
=MTzF
-----END PGP SIGNATURE-----

--1cuoifddPMEMFeiS--