bug-libunistring
[Top][All Lists]
Advanced

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

Re: [bug-libunistring] pkg-config support, please


From: Paolo Bonzini
Subject: Re: [bug-libunistring] pkg-config support, please
Date: Fri, 23 Jan 2015 10:01:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0


On 22/01/2015 15:52, Daiki Ueno wrote:
> In other context, he pointed that pkg-config is not very good at
> cross-compiling:
> http://git.savannah.gnu.org/cgit/gettext.git/tree/gnulib-local/m4/libxml.m4#n36

It's actually really good at cross compiling.

You just have to treat it like the compiler or a binutil.  For example
Fedora provides /usr/bin/x86_64-w64-mingw32-pkg-config.

In fact, cross-compilation is the main advantage of pkg-config over
scripts such as xml2-config also mentioned in libxml.m4.  With
pkg-config, only one macro (PKG_PROG_PKG_CONFIG) has to get things
right, and it does:

if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi

(see AC_PATH_TOOL instead of AC_PATH_PROG).

> and it still seems to be the case.  One would need to maintain a
> separate pkg-config database per target platform.

What's wrong with that?  It's pretty obvious that the dependencies of a
library are different for each platform, or that the include paths could
be different.  The former only matters for static linking, but include
paths matter even if you're linking dynamically.

It's okay not to provide pkg-config if you're willing to provide an
"official" macro to find libunistring.  But stating that pkg-config does
not support cross-compilation is just FUD.

A mildly valid complaint is that pkg-config is less friendly towards
compiling in the home directory.  Even that however is just a matter of
setting PKG_CONFIG_PATH to $HOME/lib/pkgconfig, and my .bash_profile
already has to set PATH, MANPATH, INFOPATH, CLASSPATH, COMPILER_PATH,
LIBRARY_PATH, LD_LIBRARY_PATH and PERL5LIB to support compilation in the
home directory.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]