From 723db89299bb793b381e7fbf3ebeae08eabdf6ad Mon Sep 17 00:00:00 2001 From: Filip Janus Date: Thu, 24 Aug 2023 10:16:59 +0200 Subject: [PATCH] add possibility to link the tool statically --- Makefile | 2 ++ README.md | 1 + 2 files changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 27ae4a6..2838a25 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ all:db.cc convert_db.h convert.cc g++ -Wall -Wextra convert.cc db.cc -llmdb -ldb -lgdbm -lgdbm_compat -o db_converter +static:db.cc convert_db.h convert.cc + g++ -Wall -Wextra convert.cc db.cc -llmdb -Wl,-Bstatic $(LDFLAGS) -ldb-5.3 -Wl,-Bdynamic -lgdbm -lgdbm_compat -o db_converter clean: rm -rf convert diff --git a/README.md b/README.md index b7f2cc9..5cc120b 100755 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ requires: libdb-devel, gdbm-devel, lmdb-devel, g++, make ## Build * Clone the repo * Build the binary `make` +* For static linking of libdb use `make static` ## Usage db\_converter --src SOURCE --dest DEST [ DBTYPE ] * SOURCE - path to BerkeleyDB database