I had the same problem as you and finally was able to figure it out. So the configuration is not recognizing the cxx files. The 2 things I did that made a difference was to modify the m4:
add the path to ./src/m4/bitcoin_find_bdb48.m4:
Now I know you already tried it but leave the path there and now try to install the berkeley db 4.8 from scratch using these commands:
cd build_unix &&
../dist/configure --prefix=/usr \
Now, as the root user:
make docdir=/usr/share/doc/db-4.8.30 install &&
chown -v -R root:root \
The commands were taken from: http://www.linuxfromscratch.org/blfs/view/svn/server/db.html
This setup is mean for db 6.0 but it works fine for 4.8 aswell
Hope I helped! and if I did: 1CNdsvPFwm899J6c8JxrM55jPrtPVB1M2X
EDIT: It let me compile but when i run bitcoind I get an error while loading shared libraries still something to do with db4.8
EDIT2: Was able to fix the issue with bitcoind not finding some bdb 4.8 dependancy by doing this:
EDIT3: Now I am facing a problem where once I start bitcoind I get this error:
bitcoind: key.cpp:135: <unnamed>::CECKey::CECKey(): Assertion `pkey != __null' failed.
Any help is appreciated.