When installing php with the berkdb useflag on Gentoo/FreeBSD, it fails. The problem is, that on Gentoo/Linux /usr/include/db.h is a symlink to the /usr/include/dbVERSION/db.h (VERSION being the installed version). On Gentoo/FreeBSD, the /usr/include/db.h header is installed by freebsd-lib, and doesn't match. This causes the emerge to die with this: checking for db4 major version... configure: error: Header contains different version Reproducible: Always Steps to Reproduce: 1. Use Gentoo/FreeBSD 2. emerge db 3. USE="berkdb" emerge php Actual Results: The configure of php stops with: checking for db4 major version... configure: error: Header contains different version Expected Results: /usr/include/db.h should be symlinked to the installed versions header.
This bug is in PHP ebuilds/eclass, db.h in Gentoo/FreeBSD is for db 1.85 (which is provided by freebsd-lib) and that should remain, otherwise a lot of stuff will fail with a domino effect. Also, all the packages relying on /usr/include/db.h might be susceptible by worse bugs. PHP should be fed the correct library name and include directory through db-use.eclass.
Re-Assigning to php-bugs at CHTEKK's request.
As a hint, here's some code snippets from evolution-data-server which has the same issue inherit db-use flag-o-matic src_unpack() # Fix db version for FreeBSD users where -ldb is always db-1 sed -i -e "s:-ldb:-l$(db_libname):" configure.in src_compile() # /usr/include/db.h is always db-1 on FreeBSD # so include the right dir in CPPFLAGS append-cppflags "-I$(db_includedir)"
Created attachment 119592 [details, diff] Just include db.h Requires a modified eclass to set CPPFLAGS, sync up to get it.
Works fine when patch is applied. Should be included in ebuild :-)
This was fixed in upstream CVS in a different way, so should be all fixed in php-5.2.4_pre200708051230-r2 http://cvs.php.net/viewvc.cgi/php-src/ext/dba/config.m4?r1=1.70.2.2.2.7&r2=1.70.2.2.2.8&diff_format=u Please test.