build bdb-6, bdb-5 and bdb-4