mingw-cross-env-list
[Top][All Lists]
Advanced

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

Re: [Mingw-cross-env-list] Another troublesome variable: PKG_CONFIG_PATH


From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] Another troublesome variable: PKG_CONFIG_PATH
Date: Mon, 28 Feb 2011 14:16:03 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Martin Lambers schrieb:
> I suggest to also clean the variable PKG_CONFIG_PATH from the environment.

This is somewhat surprising, as this shouldn't be necessary in any way.
In what concrete scenario did this make trouble for you?

Up to release 2.18, our i686-pc-mingw32-pkg-config wrapper script
resets the $PKG_CONFIG_PATH variable. In the current development
version (since 2010-12-13), it even sets $PKG_CONFIG_PATH to an
own value.


Details
=======

The new i686-pc-mingw32-pkg-config works as follows:

1) Ignore the existing "$PKG_CONFIG_PATH", and initialize this from a
   new variable "$PKG_CONFIG_PATH_i686_pc_mingw32"

   PKG_CONFIG_PATH="$PKG_CONFIG_PATH_i686_pc_mingw32" \
   ...

2) Ignore the existing "$PKG_CONFIG_LIBDIR" by overwriting it accordingly:

   ... \
   PKG_CONFIG_LIBDIR='/...mingw-cross-env.../usr/i686-pc-mingw32/lib/pkgconfig' 
\
   ...

3) Execute the existing pkg-config with the given arguments,
   but enforce the "--static" option:
 
   ... \
   exec pkg-config --static "$@"

You can find this mechanism in the last few lines of "src/gcc.mk".


Usage
=====

This mechanism allows you to have on or more own "port-like" systems
next to mingw-cross-env. You can then use "$PKG_CONFIG_PATH" as usual
to point to the native version:

   export PKG_CONFIG_PATH="/...my-ports.../lib/pkgconfig"

and "$PKG_CONFIG_PATH_i686_pc_mingw32" to point to the cross version:

   export PKG_CONFIG_PATH_i686_pc_mingw32="/...my-cross-ports.../lib/pkgconfig"


Reason
======

I added that because I stumbled over a real use case for that. Here's
the changeset in which I introduced that feature:

http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/b3a40fa89bd8

It is documented in "Step 4" of the upcoming tutorial:

http://hg.savannah.gnu.org/hgweb/mingw-cross-env/raw-file/b3a40fa89bd8/doc/index.html#tutorial


Summary
=======

All in all, the "$PKG_CONFIG_PATH" variable shouldn't affect any cross
build, so blocking it won't affect any cross build.

However, it would affect the few native builds inside mingw-cross-env.
 And I think that those builds should indeed respect "$PKG_CONFIG_PATH",
as the user might want to provide essential dependencies that way.

However, feel free to disagree with me. I don't (yet) know your use
case, so maybe I'm wrong.



Greets,
Volker

-- 
Volker Grabsch
---<<(())>>---



reply via email to

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