Subject: bug#75667: Emacs 30.0.93 build failure if -lz but not <zlib.h>

From: Eli Zaretskii <[email-masked]>
Date: Sun, 19 Jan 2025 11:24:29 +0200

> Date: Sun, 19 Jan 2025 00:29:28 -0800
> From: Paul Eggert <[email-masked]>
> 
> In the emacs-30.0.93 pretest, the build fails on cfarm119.cfarm.net 
> which is running AIX 7.3. To reproduce the problem on that platform:
> 
>    /configure CC=/opt/IBM/openxlC/17.1.1/bin/ibm-clang 
> --with-jpeg=ifavailable --with-png=ifavailable --with-gif=ifavailable 
> --with-tiff=ifavailable --with-gnutls=ifavailable
>    gmake
> 
> The build eventually fails with:
> 
>    CC       decompress.o
> decompress.c:23:10: fatal error: 'zlib.h' file not found
> #include <zlib.h>
>           ^~~~~~~~
> 
> As the #include is protected by "#ifdef HAVE_ZLIB", it appears that 
> 'configure' assumes that if gcc -lz works then "#include <zlib.h>" will 
> work too. That assumption is incorrect on this platform.

Where is zlib.h on that platform?

> I suppose HAVE_ZLIB could be changed to be true only if zlib.h can be 
> included; or perhaps the #include should be protected by #ifdef 
> HAVE_ZLIB_H (though this sounds more complicated). Up to whoever did the 
> zlib stuff.

It's too late to make serious changes in the configury on the release
branch, but maybe we should simply disable HAVE_ZLIB_H on AIX?  Then
we could find a proper solution on master.