.pc file installation location

Dan Nicholson dbn.lists at gmail.com
Thu Feb 18 11:04:51 PST 2010


On Thu, Feb 18, 2010 at 10:41 AM, Daniel Macks <dmacks at netspace.org> wrote:
> On Thu, Feb 18, 2010 at 09:39:25AM -0800, Dan Nicholson wrote:
>> On Thu, Feb 18, 2010 at 08:59:33AM -0800, Jim Graf wrote:
>> > On Thu, Feb 18, 2010 at 8:06 AM, Thomas Moulard <thomas.moulard at gmail.com>wrote:
>> >
>> > > On Thu, Feb 18, 2010 at 4:29 PM, Peter Johansson <trojkan at gmail.com>
>> > > wrote:
>> > > > Jeff Squyres wrote:
>> > > >> Greetings.  I'm creating .pc files for our project (www.open-mpi.org).
>> > > >>
>> > > >> Where does one typically install these files?  I see that pkg-config(1)
>> > > v0.23 says:
>> > > >>
>> > > >>     ...By default, pkg-config looks in the directory
>> > > prefix/lib/pkgconfig for these files;...
>> > > >>
>> > > >> Does that really mean $prefix/lib/pkgconfig?  Or does it actually mean
>> > > $libdir/pkgconfig?
>> > > >>
>> > > >>
>> > > > I use the latter: $(libdir)/pkgconfig
>> > >
>> > > Two usual cases which justify a custom libdir is:
>> > > - release/debug libraries
>> > > - different instruction sets (32/64 bits for instance)
>> > >
>> > > ...and in both case you really want to maintain two different sets of .pc
>> > > files.
>> > > So yes, IMHO $(libdir)/pkgconfig is the good solution.
>> > > --
>> > >
>> >
>> > I've been following this discussion and I have some confusion in my head.
>> > The OP stated they wanted to put the .pc file in the 'usual' location. I am
>> > presuming usual means default pkg-config search path, which depends on where
>> > pkg-config itself is installed.
>>
>> Here's how the built in path is determined:
>>
>> # This is slightly wrong, but hopefully causes less confusion than
>> # people being unable to find their .pc files in the standard location.
>> if test "${prefix}" = "NONE"; then
>>         pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig'
>> else
>>         pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig'
>> fi
>>
>> > I wish I could participate more fully, but all my apps/libs are used
>> > internally, and we find it expeditious to avoid root installs, so I tend
>> > towards mucking with PKG_CONFIG_PATH and then I don't have to depend on my
>> > own installation of the pkg-config app. It's a good solution to our very
>> > particular problem. I can't use the default location. :(
>> >
>> > I also wish there was an option for pkg-config to print out it's default
>> > search path. Then in configure.ac, one could make some decisions.
>> >
>> > strings `which pkg-config`|grep "/pkgconfig"
>> >
>> > lacks a certain something...
>>
>> Something like the patch below?
>
> Should this give the *default* search path (interrogating the
> intrinsic behavior of pkg-config) or the one used at this time (as
> adjusted/overwritten by various env vars)? I can see reasons for
> wanting each bahavior, needs to be clear which one is happening.

I think it should give whatever is the current setting (including env
vars) so you can also confirm that the right thing is happening if you
need to tweak them.

--
Dan


More information about the pkg-config mailing list