$OpenBSD: patch-modules_db_berkeley_Makefile,v 1.2 2015/11/20 10:09:52 sthen Exp $
--- modules/db_berkeley/Makefile.orig	Fri Oct  2 15:35:17 2015
+++ modules/db_berkeley/Makefile	Mon Oct 19 14:00:40 2015
@@ -10,10 +10,10 @@ NAME=db_berkeley.so
 # extra debug messages
 # -DBDB_EXTRA_DEBUG is optional
 DEFS +=-DSER_MOD_INTERFACE -I$(LOCALBASE)/include -I$(LOCALBASE)/BerkeleyDB.4.6/include \
-	-I$(SYSBASE)/include
+	-I$(SYSBASE)/include -I$(LOCALBASE)/include/db4
 
 
-LIBS=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -L$(LOCALBASE)/BerkeleyDB.4.6/lib -ldb
+LIBS=-L$(LOCALBASE)/lib -L$(SYSBASE)/lib -L$(LOCALBASE)/BerkeleyDB.4.6/lib -L$(LOCALBASE)/lib/db4 -ldb
 
 SERLIBPATH=../../lib
 SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1 $(SERLIBPATH)/kmi/kmi
@@ -24,7 +24,7 @@ ifeq ($(INSTALL_FLAVOUR),kamailio)
 # extra install for kamailio
 
 install-berkeley-scripts: $(bin_prefix)/$(bin_dir)
-		BERKELEYDBON=yes make -C ../../utils/kamctl/ install-modules
+		BERKELEYDBON=yes $(MAKE) -C ../../utils/kamctl/ install-modules
 
 install-scripts: install-berkeley-scripts
 
