--- heimdal-1.5.3/configure.ac.orig	2016-01-12 12:08:18.406147300 +0300
+++ heimdal-1.5.3/configure.ac	2016-01-12 12:10:33.177960000 +0300
@@ -176,6 +176,7 @@
 AM_CONDITIONAL(SQLITE3,  test "X$with_sqlite3" = Xyes)
 
 AC_DEFINE(HAVE_SQLITE3, 1, [Define if you want support for sqlite in Heimdal.])
+AC_SUBST(LIB_sqlite3)
 
 AC_ARG_ENABLE(sqlite-cache, 
 	AS_HELP_STRING([--disable-sqlite-cache],[if you want support for cache in sqlite]))
--- heimdal-1.5.3/tools/Makefile.am.orig	2016-01-12 13:36:56.762307100 +0300
+++ heimdal-1.5.3/tools/Makefile.am	2016-01-12 13:37:26.440953200 +0300
@@ -28,6 +28,7 @@
 		-e "s!@LIB_dlopen\@!$(LIB_dlopen)!g" \
 		-e "s!@LIB_door_create\@!$(LIB_door_create)!g" \
 		-e "s!@LIB_pkinit\@!$(LIB_pkinit)!g" \
+		-e "s!@LIB_sqlite3\@!$(LIB_sqlite3)!g" \
 		-e "s!@LIBS\@!$(LIBS)!g"
 
 krb5-config: krb5-config.in
--- heimdal-1.5.3/tools/krb5-config.in.orig	2016-01-12 14:24:54.526945800 +0300
+++ heimdal-1.5.3/tools/krb5-config.in	2016-01-12 14:25:46.205945800 +0300
@@ -230,7 +230,7 @@
 	lib_flags="$lib_flags -lkrb5"
     fi
     deplibs="$deplibs @LIB_pkinit@ -lcom_err"
-    deplibs="$deplibs @LIB_hcrypto_appl@ -lasn1 -lwind -lheimbase -lroken"
+    deplibs="$deplibs @LIB_hcrypto_appl@ -lasn1 -lwind -lheimbase -lroken @LIB_sqlite3@"
     deplibs="$deplibs @LIB_crypt@ @PTHREAD_LIBADD@ @LIB_dlopen@"
     deplibs="$deplibs @LIB_door_create@ @LIBS@"
     if test X"$do_lib_deps" = X"yes"; then
--- heimdal-heimdal-7.7.0/tools/heimdal-krb5.pc.in.orig	2021-11-17 20:34:49.114000200 +0100
+++ heimdal-heimdal-7.7.0/tools/heimdal-krb5.pc.in	2021-11-17 20:35:11.836935200 +0100
@@ -8,5 +8,5 @@
 Description: Heimdal implementation of the Kerberos network authentication.
 Version: @VERSION@
 Libs: -L${libdir} -lkrb5
-Libs.private: @LIB_pkinit@ -lcom_err @LIB_hcrypto_appl@ -lasn1 -lwind -lheimbase -lroken @LIB_crypt@ @PTHREAD_LIBADD@ @LIB_dlopen@ @LIB_door_create@ @LIBS@
+Libs.private: @LIB_pkinit@ -lcom_err @LIB_hcrypto_appl@ -lasn1 -lwind -lheimbase -lroken @LIB_crypt@ @PTHREAD_LIBADD@ @LIB_dlopen@ @LIB_door_create@ @LIB_sqlite3@ @LIBS@
 Cflags: -I${includedir}
