Added BUILD_PATCHDB define constant and support for creating patch and checksum databases