Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 176010 - php with berkdb USE flag fails on *BSD
Summary: php with berkdb USE flag fails on *BSD
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High major (vote)
Assignee: PHP Bugs
Depends on:
Reported: 2007-04-25 19:03 UTC by Bjarke Istrup Pedersen (RETIRED)
Modified: 2007-08-10 16:34 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

Just include db.h (php-5.2.2-includedb.patch,500 bytes, patch)
2007-05-18 13:33 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2007-04-25 19:03:04 UTC
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.
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2007-04-25 19:35:45 UTC
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.
Comment 2 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2007-04-25 20:07:57 UTC
Re-Assigning to php-bugs at CHTEKK's request.
Comment 3 Roy Marples (RETIRED) gentoo-dev 2007-04-26 06:41:43 UTC
As a hint, here's some code snippets from evolution-data-server which has the same issue

inherit db-use flag-o-matic

    # Fix db version for FreeBSD users where -ldb is always db-1
    sed -i -e "s:-ldb:-l$(db_libname):"

    # /usr/include/db.h is always db-1 on FreeBSD
    # so include the right dir in CPPFLAGS
    append-cppflags "-I$(db_includedir)"
Comment 4 Roy Marples (RETIRED) gentoo-dev 2007-05-18 13:33:25 UTC
Created attachment 119592 [details, diff]
Just include db.h

Requires a modified eclass to set CPPFLAGS, sync up to get it.
Comment 5 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2007-05-18 22:46:19 UTC
Works fine when patch is applied.
Should be included in ebuild :-)
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-08-10 16:34:11 UTC
This was fixed in upstream CVS in a different way, so should be all fixed in php-5.2.4_pre200708051230-r2

Please test.