Hi all, <br><br>I&#39;m running into a bug but I&#39;m not sure if it&#39;s properly considered a bug in pkg-config, or in a widely used aclocal.m4 test, or (I believe) both. I wanted to run this past the developers and see what you think.<br>
<br>1) The bug in pkg-config is that it expects a command line of the form:<br> $ pkgconfig --atleast-pkgconfig-version=0.9.0<br>but silently accepts (and misparses) a command line of the form:<br> $ pkgconfig --atleast-pkgconfig-version 0.9.0<br>
<br>Consider the following. All but the last invocation produce the expected result. The last invocation produces an unexpected result, and is arguably a bug.<br><br>$ ./pkg-config --version<br>0.23<br>$ ./pkg-config --atleast-pkgconfig-version=0.24.0<br>
$ echo $?<br>1<br>$ ./pkg-config --atleast-pkgconfig-version 0.24.0<br>$ echo $?<br>1<br>$ ./pkg-config --define-variable=0=0 --atleast-pkgconfig-version=0.24.0<br>$ echo $?<br>1<br>$ ./pkg-config --define-variable=0=0 --atleast-pkgconfig-version 0.24.0<br>
$ echo $?<br>0<br><br>Digging further indicates that the first three invocations call compare_versions(&quot;0.23&quot;, &quot;0.24.0&quot;) returning -1, whereas the last invocation calls compare_versions(&quot;0.23&quot;, &quot;0=0&quot;) returning 1.<br>
<br>2) The bug in aclocal.m4 tests is simply that it invokes --atleast-pkgconfig-version with the wrong syntax. This is widespread, almost everywhere pkg-config is used by configure, in the PKG_PROG_PKG_CONFIG macro.<br><br>
I ran into this problem doing something like this:<br><br>PKG_CONFIG=&quot;/usr/bin/pkg-config --define-variable=prefix=/foo/bar&quot; ./configure<br><br>... which does not function as expected and I believe is a perfectly reasonable thing to expect to do with pkg-config and configure!<br>
<br>What do you think?<br><br>Thanks,<br>Martin<br><br>