cross-compile and pkgconfig

malet jean-luc jean.luc.malet at coframi-grenoble.com
Fri Sep 16 05:27:32 PDT 2005


hello,
I wa looking about pkgconfig for a long time and forget it because of 
some of it's "features" recently I found that the features that I 
disliked have now disappeared but there is only one question that remain 
in my mind : crosscompiling
usually you do a
./configure --prefix=/usr
make
export DESTDIR=/path/to/embedded/FS
make install

this insure that all libtool and pkgconfig contain the right value (so 
that you can boot on the target and compile new package fine) but the 
issue is that querying the pkg-config about flags returns.... Host 
directory.... which means that everything will fail awfully....

i found PKG_CONFIG_TOP_BUILD_DIR and I wonder if this will fix the issue 
if I do an

export PKG_CONFIG_TOP_BUILD_DIR=$DESTDIR

humm no....

using --define-variable=prefix (or --define-variable=anything) is no 
help since there is no way to controle how makefile has been done

so I think that a good behaviour is to getenv(DESTDIR)
and to change prefix to DESTDIR/prefix when outputing result....

doing this solve the crosscompilation issue.... allowing to crosscompile 
and install a package into a subtree while keeping all compatibility 
with anything else....

if this is done pkg-config might become something more interesting....

regards,
JLM






More information about the pkg-config mailing list