pkg-config zlib check in 3c13bc

Tomi Ollila tomi.ollila at iki.fi
Fri May 9 13:01:44 PDT 2014


On Thu, May 08 2014, David Bremner <david at tethera.net> wrote:

> Tomi Ollila <tomi.ollila at iki.fi> writes:
>
>>
>> But, I'd like suggest alternate option to create a test c program
>> and test whether it compiles (analogous to what there is already
>> done with many other checks) -- this same would apply to fdatasync()
>> case too.
>>
>
> I agree in principle, but I'm not sure it's detectable at compile time,
> since the option we need is passed as a string (boo!).  
>
> I guess the ZLIB_VERNUM hack would be preferable to adding platform
> specific checks to configure. But note you'd need somehow to find
> zlib.h.

Actually my suggestion would be that if that pkg-config line for 
zlib does not work (btw why does it not work) try an option
where zlib_cflags is expected to be empty and and zlib_ldflags -lz
-- and try compile and run test program with those options
then the test program is something like

int main(void)
{
    return(ZLIB_VERNUM >= 0x1252);
}

(perhaps we could manage the same value in slightly different 
formats in 2 tests and remember to update those in sync ..
or we could try:

zv1=1 zv2=2 zv3=5 zv4=

    if pkg-config --atleast-version=$zv1.$zv2.$zv3.$zv4 zlib; then

and

    return(ZLIB_VERNUM >= 0x$zv1$zv2$zv3$zv4);

>
> d


Tomi


More information about the notmuch mailing list