[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: *-config programs and multi-arch

On Fri, Sep 16, 2011 at 02:38:50PM +0900, Miles Bader wrote:
> I earlier wrote:
> > AFAICT, the easiest way to handle all this is just to make a missing
> > cross-pkg-config look like a missing pkg-config to the configure
> > script.  Then whatever logic the script may have for detecting the
> > "not pkg-config at all" case, will do the right thing for the cross
> > case too.
> Currently I just have my configure script completely disable use of
> pkg-config when cross-compiling (by setting PKG_CONFIG=""), but
> obviously this is undesirable if a cross-version of pkg-config was
> actually found...

How can you link to libraries that require special handling then? 
Do you hard-code the compiler/linker arguments?  That seems fragile,
especially with library/include paths changing weekly these days.

For example, with my member of an upstream team hat on, here's what I use
for cross builds.  This works well on a squeeze-based cross setup, and I was
told someone used it successfully on something RPMy:

($ARCH is mostly `cc -dumpmachine` with some MacOS related variations, this
can break if pkg-config is available only in a multiarch but not GNU triplet
location on i386.)

if (cross-compiling)
        ifneq (,$($shell which $(ARCH)-pkg-config 2>/dev/null))
          PKGCONFIG = $(ARCH)-pkg-config
          ifneq (,$(wildcard /usr/$(ARCH)/lib/pkgconfig))
            PKGCONFIG = PKG_CONFIG_LIBDIR=/usr/$(ARCH)/lib/pkgconfig pkg-config
            ... force convenience copies of libraries to be built

On Debian, the second stanza matches where squeeze's xapt puts .pc files of
packages it mangles.  This does work, although such a line looks repulsive
to me, and again, might break on new i386 with triplet!=multiarch.

Thus, please, could we get a $(TRIPLET)-pkg-config binary that does know all
the magic needed?  I insist on this name because this is what the whole rest
of the toolchain does.  Even on obscure targets like, say, win64, you know
the compiler is x86_64-w64-mingw32-gcc, strip is x86_64-w64-mingw32-strip
and so on.  Having pkg-config there would gain us consistency and sanity.
(Speaking of the user-visible command you run, of course, I couldn't care
less about physical directories as long as they're hidden.)

1KB		// Yo momma uses IPv4!

Attachment: signature.asc
Description: Digital signature

Reply to: