Building db_dump from sources

By | August 11, 2020

The db_dump utility dump Berkeley DB databases into a flat-text representation. Berkeley DB distribution includes source code of db_dump utility and also other useful utilities such as: db_archive, db_checkpoint, b_deadlock, b_dump185, db_load, db_printlog, db_recover, db_stat, db_upgrade and db_verify. All these utilities may be used for database debugging and maintenance. Here is example of Makefile for building db_dump from source code for Linux and Mac operating systems. This Makefile may be used as template to create Makefile for building other Berkeley DB utilities mentioned above:

CC = gcc
SRC_1 = db_dump.c ../common/util_sig.c ../common/util_cache.c
DBDUMP = db_dump
COPTS = -g -O2 -Wall -pthread -pedantic
ifeq ($(OSTYPE),mac_osx)
COPTS += -mmacosx-version-min=10.10 -arch x86_64
CINCS = -I../build_unix/ -I../
CLIBS = ../build_unix/libdb_cxx.a
$(DBDUMP): $(SRC_1)
   $(CC) $(CINCS) $(COPTS) -o $(DBDUMP) $(SRC_1) $(CLIBS)
   rm -f db_dump

For building on Mac OSX the environmental variable OSTYPE should be defined:

# export OSTYPE=mac_osx

Leave a Reply

Your email address will not be published. Required fields are marked *