As described at bug #383179, Gentoo now renames zlib's internal OF macro to _Z_OF which is still used in zutil.h which ships with SWI Prolog. A simple workaround is to modify zutil.h so it redefines OF to _Z_OF (if OF wasn't defined in zlib.h). I'll attach a patch to the latest swi-prolog ebuild that does this. Reproducible: Always
Created attachment 288737 [details, diff] Patch to swi-prolog-5.11.28.ebuild This patch updates packages/zlib/util.h in src_prepare to define OF as _Z_OF if the former isn't already defined by zlib.h, allowing the package to be built with both older and newer versions of Gentoo's zlib.h.
Comment on attachment 288737 [details, diff] Patch to swi-prolog-5.11.28.ebuild >--- /usr/portage/dev-lang/swi-prolog/swi-prolog-5.11.28.ebuild 2011-10-03 09:51:26.000000000 +0200 >+++ swi-prolog-5.11.28.ebuild 2011-10-04 07:20:04.000000000 +0200 >@@ -44,6 +44,14 @@ > EPATCH_FORCE=yes > EPATCH_SUFFIX=patch > epatch "${WORKDIR}"/${PV} >+ >+ # fix for bug #385569 >+ sed -e '/^#include "zlib.h"/ { >+a#ifndef OF >+a#define OF _Z_OF >+a#endif >+}' -i "${S}"/packages/zlib/zutil.h || die >+ > } > > src_configure() {
Thanks for taking the time to have a look at this! It looks like we've both separately looked at SWI failing with its bundled copy of zutil.h. I've pulled in an upstream fix [1] and applied it to pl-5.10.5-r1 and pl-5.11.28. [1] http://www.swi-prolog.org/git/packages/zlib.git/commit/662d4015