MinGW pkg-config not working (part 2)
Hello, After the release of the new pkg-conf, with the use of symlinks instead of a script for using the personality feature, I got some strange errors at compile time. Let's think to have a directory called "mylibrary" into your home directory, so you have a path for example "/home/carlo/mylibrary". In this directory create a file called "test.pc" with these lines: Name: test Description: test MinGW pkg-config on CYGWIN Version: 1.2.3 Libs: Cflags: -I/home/carlo/mylibrary Finally, add this directory to PKG_CONFIG_PATH environment variable. Now, if you type this command on the console: $ x86_64-w64-mingw32-pkg-config --cflags test -I/usr/x86_64-w64-mingw32/sys-root/home/carlo/mylibrary which is wrong, because it changed all references to "home/carlo" by appending "/usr/x86_64-w64-mingw32/sys-root". Instead, if I type: $ pkg-config --cflags test -I/home/carlo/mylibrary then the path it returned unchanged as expected. Sadly, this behavior forces you to rebuild everything and to move all stuff that you could normally have in your home directory into "/usr/x86_64-w64-mingw32/sys-root/home/carlo", othewise it won't work anymore. Am I doing something wrong or it is the expected result and there is another way to make things working again? Thank you very much. Sincerely. -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: Mingw pkg-config not working
Hello, I would like to report that I updated to the latest release, I tried to do some tests and it really seems that it has resolved the issue on my side. Thank you very much for your support. Sincerely, Carlo Bramini. Il giorno lun 6 apr 2020 alle ore 18:44 Yaakov Selkowitz ha scritto: > > On Sun, 2020-04-05 at 15:51 +0200, Carlo B. via Cygwin wrote: > > I wanted to report that I received a reply on the issue that I had opened > > here: > > > > https://todo.sr.ht/~kaniini/pkgconf/10#comment-7894 > > Thanks for following up. > > > The report has been closed and I got this reply: > > > > "You should use a symlink instead of a wrapper script when using the > > personality feature." > > > > I hope that somebody has understood what he means (posix is not > > exactly my primary platform) and it could be useful for fixing the > > issue. > > Yes, that gave me the information I needed. There is actually code > within pkgconf to automatically load $PREFIX.personality when called as > $PREFIX-pkg-config. This requires a packaging change on our end, which > I'm incorporating into the latest release. > > > Il giorno gio 26 mar 2020 alle ore 14:07 Carlo B. > > ha scritto: > > > Hello, > > > I implemented the solution to this problem as a patch to > > > pkgconf.cygport as requested. > > > I attached small patch to this email, which resolved the troubles with > > > CMake and Meson. > > > I hope that you will find it useful and some developers will gently > > > apply the correction to fix the issue. > > > > > > Thank you very much for your time and your support. > > > Sincerely, > > > > > > Carlo Bramini. > > > > > > Il giorno sab 22 feb 2020 alle ore 18:47 Jon Turney > > > ha scritto: > > > > On 20/02/2020 11:06, Carlo B. wrote: > > > > [...] > > > > > 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. > > > > [...] > > > > > > > > Thanks for reporting this issue. > > > > > > > > I guess the alternative to fixing pkgconf would be to modify those > > > > wrapper scripts to detect when the parameters are just '--version' (or > > > > equivalent) and not use --personality in that case? > > > > > > > > These wrapper scripts are specific to cygwin (generated by the cygport, > > > > see [1]) > > > > > > > > It's possible other distros have more sophisticated wrapper scripts, > > > > which avoid this problem? > > > > > > > > If you do write or discover some improved wrapper scripts, a patch to > > > > [1] to update them would be appreciated. > > > > > > > > [1] > > > > https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/pkgconf.git;a=blob;f=pkgconf.cygport#l84 > > -- > Yaakov > > > -- > Problem reports: https://cygwin.com/problems.html > FAQ: https://cygwin.com/faq/ > Documentation:https://cygwin.com/docs.html > Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: Mingw pkg-config not working
On Sun, 2020-04-05 at 15:51 +0200, Carlo B. via Cygwin wrote: > I wanted to report that I received a reply on the issue that I had opened > here: > > https://todo.sr.ht/~kaniini/pkgconf/10#comment-7894 Thanks for following up. > The report has been closed and I got this reply: > > "You should use a symlink instead of a wrapper script when using the > personality feature." > > I hope that somebody has understood what he means (posix is not > exactly my primary platform) and it could be useful for fixing the > issue. Yes, that gave me the information I needed. There is actually code within pkgconf to automatically load $PREFIX.personality when called as $PREFIX-pkg-config. This requires a packaging change on our end, which I'm incorporating into the latest release. > Il giorno gio 26 mar 2020 alle ore 14:07 Carlo B. > ha scritto: > > Hello, > > I implemented the solution to this problem as a patch to > > pkgconf.cygport as requested. > > I attached small patch to this email, which resolved the troubles with > > CMake and Meson. > > I hope that you will find it useful and some developers will gently > > apply the correction to fix the issue. > > > > Thank you very much for your time and your support. > > Sincerely, > > > > Carlo Bramini. > > > > Il giorno sab 22 feb 2020 alle ore 18:47 Jon Turney > > ha scritto: > > > On 20/02/2020 11:06, Carlo B. wrote: > > > [...] > > > > 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. > > > [...] > > > > > > Thanks for reporting this issue. > > > > > > I guess the alternative to fixing pkgconf would be to modify those > > > wrapper scripts to detect when the parameters are just '--version' (or > > > equivalent) and not use --personality in that case? > > > > > > These wrapper scripts are specific to cygwin (generated by the cygport, > > > see [1]) > > > > > > It's possible other distros have more sophisticated wrapper scripts, > > > which avoid this problem? > > > > > > If you do write or discover some improved wrapper scripts, a patch to > > > [1] to update them would be appreciated. > > > > > > [1] > > > https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/pkgconf.git;a=blob;f=pkgconf.cygport#l84 -- Yaakov -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: Mingw pkg-config not working
Hello, I wanted to report that I received a reply on the issue that I had opened here: https://todo.sr.ht/~kaniini/pkgconf/10#comment-7894 The report has been closed and I got this reply: "You should use a symlink instead of a wrapper script when using the personality feature." I hope that somebody has understood what he means (posix is not exactly my primary platform) and it could be useful for fixing the issue. Thank you very much for your time. Sincerely, Carlo Bramini. Il giorno gio 26 mar 2020 alle ore 14:07 Carlo B. ha scritto: > > Hello, > I implemented the solution to this problem as a patch to > pkgconf.cygport as requested. > I attached small patch to this email, which resolved the troubles with > CMake and Meson. > I hope that you will find it useful and some developers will gently > apply the correction to fix the issue. > > Thank you very much for your time and your support. > Sincerely, > > Carlo Bramini. > > Il giorno sab 22 feb 2020 alle ore 18:47 Jon Turney > ha scritto: > > > > On 20/02/2020 11:06, Carlo B. wrote: > > [...] > > > 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. > > [...] > > > > Thanks for reporting this issue. > > > > I guess the alternative to fixing pkgconf would be to modify those > > wrapper scripts to detect when the parameters are just '--version' (or > > equivalent) and not use --personality in that case? > > > > These wrapper scripts are specific to cygwin (generated by the cygport, > > see [1]) > > > > It's possible other distros have more sophisticated wrapper scripts, > > which avoid this problem? > > > > If you do write or discover some improved wrapper scripts, a patch to > > [1] to update them would be appreciated. > > > > [1] > > https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/pkgconf.git;a=blob;f=pkgconf.cygport#l84 -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: Mingw pkg-config not working
Hello, I implemented the solution to this problem as a patch to pkgconf.cygport as requested. I attached small patch to this email, which resolved the troubles with CMake and Meson. I hope that you will find it useful and some developers will gently apply the correction to fix the issue. Thank you very much for your time and your support. Sincerely, Carlo Bramini. Il giorno sab 22 feb 2020 alle ore 18:47 Jon Turney ha scritto: > > On 20/02/2020 11:06, Carlo B. wrote: > [...] > > 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. > [...] > > Thanks for reporting this issue. > > I guess the alternative to fixing pkgconf would be to modify those > wrapper scripts to detect when the parameters are just '--version' (or > equivalent) and not use --personality in that case? > > These wrapper scripts are specific to cygwin (generated by the cygport, > see [1]) > > It's possible other distros have more sophisticated wrapper scripts, > which avoid this problem? > > If you do write or discover some improved wrapper scripts, a patch to > [1] to update them would be appreciated. > > [1] > https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/pkgconf.git;a=blob;f=pkgconf.cygport#l84 pkgconf.cygport.patch Description: Binary data -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation:https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
Re: Mingw pkg-config not working
Hello, I wanted to say that I modified the script in this way and it seems that it has resolved all issues: #!/bin/sh if [ "$#" -eq 1 ] && [ "$1" == "--version" ]; then exec pkgconf --version else exec pkgconf --personality=i686-w64-mingw32 $@ fi Fixing x64_64 is easy, I have just replaced i686-w64-mingw32 with x86_64-w64-mingw32 in the personality. I hope you will find this fix useful and, if you think it is good, the maintainer of the package could rewrite those scripts in the same way. Sincerely. Il giorno sab 22 feb 2020 alle ore 18:47 Jon Turney ha scritto: > > On 20/02/2020 11:06, Carlo B. wrote: > [...] > > 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. > [...] > > Thanks for reporting this issue. > > I guess the alternative to fixing pkgconf would be to modify those > wrapper scripts to detect when the parameters are just '--version' (or > equivalent) and not use --personality in that case? > > These wrapper scripts are specific to cygwin (generated by the cygport, > see [1]) > > It's possible other distros have more sophisticated wrapper scripts, > which avoid this problem? > > If you do write or discover some improved wrapper scripts, a patch to > [1] to update them would be appreciated. > > [1] > https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/pkgconf.git;a=blob;f=pkgconf.cygport#l84 -- 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
Re: Mingw pkg-config not working
On 20/02/2020 11:06, Carlo B. wrote: [...] 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. [...] Thanks for reporting this issue. I guess the alternative to fixing pkgconf would be to modify those wrapper scripts to detect when the parameters are just '--version' (or equivalent) and not use --personality in that case? These wrapper scripts are specific to cygwin (generated by the cygport, see [1]) It's possible other distros have more sophisticated wrapper scripts, which avoid this problem? If you do write or discover some improved wrapper scripts, a patch to [1] to update them would be appreciated. [1] https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/pkgconf.git;a=blob;f=pkgconf.cygport#l84 -- 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
Mingw pkg-config not working
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