if db 5.3 or higher is installed configure will complain: checking for DB4 major version... configure: error: Header contains different version just adding the block makes it work, but i feel like at least (well, probably only) 5.3 should be added to ext/dba/config.m4 as we run eautoreconf anyway... 6 is unsuitable at any rate as there is another check for DB_VERSION_MAJOR which cleanly leaves 6 out but that script is ancient anyway... 6 included a licensing change so i'm not sure if it would be suitable at all. i have no idea how other distros do it yet; at least fedora throws the whole check away but they are still using db4. Reproducible: Always
The autodetection in PHP's configure script actually works -- as long as you're not using db-5.3! What it does is check for db-5.1, db-5.0, db-4.8, etc. in order of preference. Only as a last resort does it fall back to /usr/include/db.h, which can point to the db-6.0 header: elif test -f "$i/include/db5.1/db.h"; then THIS_PREFIX=$i THIS_INCLUDE=$i/include/db5.1/db.h break elif test -f "$i/include/db5.0/db.h"; then THIS_PREFIX=$i THIS_INCLUDE=$i/include/db5.0/db.h break elif test -f "$i/include/db4.8/db.h"; then THIS_PREFIX=$i THIS_INCLUDE=$i/include/db4.8/db.h break If you have db:5.1 installed, it will get autodetected even when db:6.0 is installed and everything will work fine. It's only the combination of 5.3 and 6.0 that cause problems. Since PHP works fine with db:5.3, I think I'll just fix their configure script upstream. In the meantime it might make sense to remove db:5.3 from $DEPEND but it depends on how long it will be before the fix trickles down.
Sent a pull request: https://github.com/php/php-src/pull/1617 We could probably fix that right in src_prepare() for now -- we wouldn't even need a revbump. I'll play with it later, let's wait to see what upstream says.
No word on the pull request yet, but I don't want to leave this broken. Fixed in, https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74ec204a022e4126ca35008c0c27d13645d8ca27 The same problem existed with older 4.x versions.