--- lib/Makefile.am.orig	2026-06-18 08:15:42 UTC
+++ lib/Makefile.am
@@ -57,6 +57,7 @@ libseafile_common_la_LIBADD = @GLIB2_LIBS@  @GOBJECT_L
 libseafile_common_la_LDFLAGS = -no-undefined
 libseafile_common_la_LIBADD = @GLIB2_LIBS@  @GOBJECT_LIBS@ @LIB_GDI32@ \
 				     @LIB_UUID@ @LIB_WS32@ @LIB_PSAPI@ -lsqlite3 \
+				@LIB_KVM@ \
 					 @LIBEVENT_LIBS@ @SEARPC_LIBS@ @LIB_SHELL32@ \
 	@ZLIB_LIBS@
 
@@ -66,7 +67,7 @@ vala.stamp: ${seafile_object_define}
 	rm -f ${seafile_object_gen}
 	@rm -f vala.tmp
 	@touch vala.tmp
-	@VALAC@ -C --pkg posix $^
+	@VALAC@ -C --pkg posix ${seafile_object_define}
 	@mv -f vala.tmp $@
 
 ${seafile_object_gen}: vala.stamp
@@ -78,5 +79,9 @@ else
 if MACOS
 	sed -i '' -e "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
 else
+if BSD
+	sed -i '' "s|(DESTDIR)|${PREFIX}|g" $(pcfiles)
+else
 	${SED} -i "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
+endif
 endif
