pkg-config

Paul Ramsey pramsey at cleverelephant.ca
Mon Nov 20 15:43:40 PST 2023



> On Nov 20, 2023, at 3:41 PM, Regina Obe <lr at pcorp.us> wrote:
> 
>> I am re-working the GEOS detection in the configure script a bit, and I have the
>> following logic:
>> 
>> if (geos-config provided)
>>  use geos-config
>> else
>>  if (pkg-config found)
>>    use pkg-config
>>  elseif (geos-config on path)
>>    use geos-config
>>  else
>>    error cannot find geos
>> 
>> Is that the right order? I noticed that libxml2, just prior to geos in the configure
>> script, prefers xml2-config to pkg-config if it exists.
>> 
>> P
> 
> You know I don't think I've ever attempted to pass geos-config on path.  Not that it doesn't work, just didn't realized that was even supported, or are you adding that?

That’s always been there. If you don’t specific geos-config, it will pick up the first one it finds on the path. And in fact in the current state will prefer that over pkg-config.

> The only possibly incomplete thing I see in you code is:
> 
> What if you have pkg-config, but you can't find geos with it? Does it eventually end with can't find geos, or tries to look for it in on path?

Then the next fall-back is looking for geos-config in the path. And if that fails it errors out.

> In my case, I put all the pkg_config stuff in  PKG_CONFIG_PATH as shown here
> 
> https://git.osgeo.org/gitea/postgis/postgis/src/branch/master/ci/winnie/winnie_common.sh#L119
> 
> cause well I'm constantly switching versions of libraries. But it is possible I make a typo.
> 
> Thanks,
> Regina
> 



More information about the postgis-devel mailing list