public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Mingw pkg-config not working
@ 2020-02-20 11:06 Carlo B.
  2020-02-22 17:47 ` Jon Turney
  0 siblings, 1 reply; 7+ messages in thread
From: Carlo B. @ 2020-02-20 11:06 UTC (permalink / raw)
  To: cygwin

Hello,
I discovered that the mingw cross compilers for i686 and x86-64 have a
problem with support of pkg-config. From what I have seen, the mingw
included into CYGWIN is not using the usual pkg-config, but it uses
pkgconf instead, which is a good thing at first sight, since it does
not depend to GLib. Unfortunately, this introduces a problem: the
traditional i686-w64-mingw32-pkg-config and
x86_64-w64-mingw32-pkg-config are emulated with a shell script, for
example the one for i686 is:

#!/bin/sh
exec pkgconf --personality=i686-w64-mingw32 $@

But while this solution mostly works when you exec it from the command
line, it makes impossible to detect the presence of the tool from
meson and cmake build systems.
If you try to do this on the bash prompt, you get:

$ i686-w64-mingw32-pkg-config --version
pkgconf: --version specified with other options or module names,
assuming --modversion.
Please specify at least one package name on the command line.

and this is exactly what happens with those build systems (and perhaps
others, I don't know): it tries to call pkg-config with "--version"
and it executes the above script that calls pkgconf. But sadly, the
presence of the "--personality" option makes the process to fail,
because the "--version" is currently allowed only when no other
options are added.
And, for this reason, meson and cmake fail the detection of the tool.

I have also filed an issue here for pkgconf:
https://todo.sr.ht/~kaniini/pkgconf/10
because the solution is actually to ignore the presence of the
"--personality" option when the "--version" is written, but
unfortunately I have not received any feedback.

So, I'm also writing here, with the hope that you could find a solution.
This behavior is easy to verify, just write that command at the prompt
of the shell, or try to build something that uses the detection of the
tool: in my case, I found it when I tried to build the audacious media
player from sources.

Thank you very much for your time and your support.
Sincerely.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-08 19:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 11:06 Mingw pkg-config not working Carlo B.
2020-02-22 17:47 ` Jon Turney
2020-02-27 16:20   ` Carlo B.
2020-03-26 13:07   ` Carlo B.
2020-04-05 13:51     ` Carlo B.
2020-04-06 16:43       ` Yaakov Selkowitz
2020-04-08 19:46         ` Carlo B.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).