How to handle pkg-config emitting Unix-style paths on Windows?

LRN lrn1986 at gmail.com
Mon Nov 9 12:39:11 PST 2015


On 09.11.2015 23:19, Ryan Scott wrote:
> I'm a Windows user attempting to build a Haskell package [1] that 
> depends on cairo by using pkg-config to detect it. This fails, though,
> because pkg-config gives a Windows tool (ghc-pkg) some Unix-style
> paths, which it fails to recognize (see [2] for the full error log).
> 

i686-w64-mingw32-pkg-config and x86_64-w64-mingw32-pkg-config should, by
default, output DOS paths by substituting the prefix=SOMETHING from .pc
files with a prefix that is detected at runtime (deduced from the
location of the pkg-config program). This will work as long as .pc files
are correctly formed and use ${prefix} and other variables derived from
${prefix} in cflags and ldflags.
In fact, i have to work hard to make sure that pkg-config does NOT
substitute the prefix when i run it in MSYS environment, because *nix
paths are preferred there.
If it does not substitute prefix for you, maybe it fails to autodetect
runtime prefix or .pc files are badly formed.

i686-pc-msys-pkg-config will, AFAIK, always output *nix paths, because
it's not W32-aware. Not that i've used it much, so i could be mistaken.



-- 
O< ascii ribbon - stop html email! - www.asciiribbon.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/pkg-config/attachments/20151109/74e21d41/attachment.sig>


More information about the pkg-config mailing list