Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Making libraries available to the system
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Zephire
n00b
n00b


Joined: 29 Jan 2013
Posts: 3

PostPosted: Wed Jan 30, 2013 10:45 am    Post subject: Making libraries available to the system Reply with quote

If I write an ebuild for a library, what is the right way to install it so other ebuilds can use it?

1. Think of a good name and directory and install it there and never never ever change it so other ebuilds can hardcode the path for the compiler.

2. Always install a .pc file in the right directory so other ebuilds can use pkg-config to find my library and they don't have to rely on me fixing the path forever.

3. There is a clever gentoo way for making the system aware of my library? (Like for runtime linking env-update collects LDPATH in /etc/env.d/ and automatically writes ld config file)

I looked a bit inside the Development Guide but could not find anything about.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9523
Location: beyond the rim

PostPosted: Wed Jan 30, 2013 3:33 pm    Post subject: Reply with quote

The standard answer is to put it into /usr/$(get_libdir), there both the linker and the runtime linker will find it by default. If for some reason you can't or don't want to do that the next best thing is to install a pkgconfig file to specify locations for libraries and header files.
Note that this is the standard answer, there are exceptions to this (precompiled packages, special upstream/community requirements, ...).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum