Installing proto pc files in /usr/share/pkgconfig?
Yaakov (Cygwin/X)
yselkowitz at users.sourceforge.net
Mon Sep 24 08:04:47 PDT 2012
On Mon, 2012-09-24 at 07:15 -0700, Dan Nicholson wrote:
> On Sep 23, 2012 9:59 PM, "Yaakov (Cygwin/X)" wrote:
> >
> > On 2012-09-23 12:35, Matt Turner wrote:
> >> The proto packages install their pc files in $(libdir)/pkgconfig,
> >> but this leads to files being installed in /usr/lib32 or /usr/lib64
> >> when there's nothing ABI specific about them.
> >>
> >> Would it be reasonable to install them to $(prefix)/share/pkgconfig instead?
> >
> > Absolutely NOT. If you do this, then they will be picked up when
> > cross-compiling, adding e.g. -I/usr/include to CFLAGS, which will
> > then cause the build-system's headers to be used instead of the
> > cross-host's.
>
> Can you explain how this affects cross-compiling?
Unlike /usr/lib/pkgconfig, /usr/share/pkgconfig is meant to be used even
when cross-compiling. If you put the *proto.pc in the latter, then
cross-compile anything which requires *proto, pkg-config will use the
native proto and do one of two things:
1) if PKG_CONFIG_SYSTEM_INCLUDE_DIR is unset, no -I flag will be printed
(since by default pkg-config doesn't print -I/-L flags to default search
dirs), in which case the cross-compiler will not find the headers
(since /usr/include isn't in a cross-compiler's default include search
path);
2) or, if PKG_CONFIG_SYSTEM_INCLUDE_DIR is correctly set for
cross-compiling, -I/usr/include will be added to CFLAGS, causing
anything else in /usr/include (e.g. the build-system's native system
headers) to be picked up BEFORE the cross-host's.
There is also the matter of xproto and xtrans not being truly
cross-platform (e.g. NARROWPROTO and FUNCPROTO in Xfuncproto.h), so each
platform anyway needs their own copy.
Yaakov
Cygwin/X
More information about the xorg-devel
mailing list