Merge remaining Zentyal changes to openchange master and gets everything sync'ed

Please don't hardcode flags, but use the ones found by configure for e.g. tdb and dl.