--- libreoffice-6.2.3.2-orig/Repository.mk	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/Repository.mk	2019-04-23 18:11:29 +0900
@@ -245,8 +245,8 @@
 
 $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,base, \
 	abp \
-	dbp \
-	dbu \
+	$(call gb_Helper_optional,DBCONNECTIVITY,dbp) \
+	$(call gb_Helper_optional,DBCONNECTIVITY,dbu) \
 ))
 
 $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,calc, \
@@ -335,7 +335,7 @@
 		basprov \
 	) \
 	basegfx \
-	bib \
+	$(call gb_Helper_optional,DBCONNECTIVITY,bib) \
 	$(if $(ENABLE_CAIRO_CANVAS),cairocanvas) \
 	canvasfactory \
 	canvastools \
@@ -372,7 +372,7 @@
 	fps_office \
 	for \
 	forui \
-	frm \
+	$(call gb_Helper_optional,DBCONNECTIVITY,frm) \
 	fsstorage \
 	fwe \
 	fwi \
@@ -398,21 +398,21 @@
 	$(if $(MERGELIBS),merged) \
 	migrationoo2 \
 	migrationoo3 \
-	mork \
-	mozbootstrap \
+	$(call gb_Helper_optional,DBCONNECTIVITY,mork) \
+	$(call gb_Helper_optional,DBCONNECTIVITY,mozbootstrap) \
 	msfilter \
 	$(call gb_Helper_optional,SCRIPTING,msforms) \
 	mtfrenderer \
 	$(if $(ENABLE_JAVA),mysql_jdbc) \
 	$(call gb_Helper_optional,MARIADBC,$(call gb_Helper_optional,DBCONNECTIVITY,mysqlc)) \
 	numbertext \
-	odbc \
+	$(call gb_Helper_optional,DBCONNECTIVITY,odbc) \
 	odfflatxml \
 	offacc \
 	oox \
 	$(call gb_Helper_optional,OPENCL,opencl) \
 	passwordcontainer \
-	pcr \
+	$(call gb_Helper_optional,DBCONNECTIVITY,pcr) \
 	pdffilter \
 	$(call gb_Helper_optional,SCRIPTING,protocolhandler) \
 	sax \
@@ -623,7 +623,7 @@
 	package2 \
 	$(if $(USING_X11),recentfile) \
 	$(call gb_Helper_optional,SCRIPTING,scriptframe) \
-	sdbc2 \
+	$(call gb_Helper_optional,DBCONNECTIVITY,sdbc2) \
 	sofficeapp \
 	srtrs1 \
 	$(if $(filter $(OS),WNT),sysdtrans) \
@@ -1144,9 +1144,7 @@
 		modules/dbbrowser \
 		modules/dbquery \
 		modules/dbrelation \
-	) \
-	modules/dbreport \
-	$(call gb_Helper_optional,DBCONNECTIVITY,\
+		modules/dbreport \
 		modules/dbtable \
 		modules/dbtdata \
 	) \
diff -urN libreoffice-6.2.3.2-orig/configure.ac libreoffice-6.2.3.2/configure.ac
--- libreoffice-6.2.3.2-orig/configure.ac	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/configure.ac	2019-04-23 10:13:23 +0900
@@ -8472,7 +8472,7 @@
 AC_SUBST(PYTHON_VERSION_MINOR)
 
 ENABLE_MARIADBC=TRUE
-if test "$_os" = "Android" -o "$_os" = "iOS" -o "$enable_mpl_subset" = "yes"; then
+if test "$_os" = "Android" -o "$_os" = "iOS" -o "$enable_mpl_subset" = "yes" -o "$enable_database_connectivity" = "no"; then
     ENABLE_MARIADBC=
 fi
 MARIADBC_MAJOR=1
@@ -9040,7 +9040,9 @@
 dnl Check for system odbc
 dnl ===================================================================
 AC_MSG_CHECKING([which odbc headers to use])
-if test "$with_system_odbc" = "yes" -o '(' "$with_system_headers" = "yes" -a "$with_system_odbc" = "auto" ')' -o '(' "$_os" = "WINNT" -a  "$with_system_odbc" != "no" ')'; then
+if test "$enable_database_connectivity" != yes; then
+    AC_MSG_RESULT([none])
+elif test "$with_system_odbc" = "yes" -o '(' "$with_system_headers" = "yes" -a "$with_system_odbc" = "auto" ')' -o '(' "$_os" = "WINNT" -a  "$with_system_odbc" != "no" ')'; then
     AC_MSG_RESULT([external])
     SYSTEM_ODBC_HEADERS=TRUE
 
@@ -9057,8 +9059,6 @@
         AC_CHECK_HEADER(sqlext.h, [],
             [AC_MSG_ERROR(odbc not found. install odbc)],[])
     fi
-elif test "$enable_database_connectivity" != yes; then
-    AC_MSG_RESULT([none])
 else
     AC_MSG_RESULT([internal])
     SYSTEM_ODBC_HEADERS=
diff -urN libreoffice-6.2.3.2-orig/sw/Library_sw.mk libreoffice-6.2.3.2/sw/Library_sw.mk
--- libreoffice-6.2.3.2-orig/sw/Library_sw.mk	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/sw/Library_sw.mk	2019-04-23 16:37:18 +0900
@@ -577,6 +577,7 @@
     sw/source/uibase/app/swmodule \
     sw/source/uibase/app/swwait \
     sw/source/uibase/dbui/dbmgr \
+    sw/source/uibase/dbui/dbtree \
     sw/source/uibase/dbui/dbui \
     sw/source/uibase/dbui/maildispatcher \
     sw/source/uibase/dbui/mailmergehelper \
@@ -780,7 +781,6 @@
 
 ifneq (,$(filter DBCONNECTIVITY,$(BUILD_TYPE)))
 $(eval $(call gb_Library_add_exception_objects,sw,\
-    sw/source/uibase/dbui/dbtree \
     sw/source/uibase/dbui/mailmergetoolbarcontrols \
 ))
 endif
diff -urN libreoffice-6.2.3.2-orig/sw/source/uibase/dbui/dbtree.cxx libreoffice-6.2.3.2/sw/source/uibase/dbui/dbtree.cxx
--- libreoffice-6.2.3.2-orig/sw/source/uibase/dbui/dbtree.cxx	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/sw/source/uibase/dbui/dbtree.cxx	2019-04-23 16:36:58 +0900
@@ -117,12 +117,14 @@
 
 bool SwDBTreeList_Impl::HasContext()
 {
+#if HAVE_FEATURE_DBCONNECTIVITY
     if(!m_xDatabaseContext.is())
     {
         Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
         m_xDatabaseContext = DatabaseContext::create(xContext);
         m_xDatabaseContext->addContainerListener( this );
     }
+#endif
     return m_xDatabaseContext.is();
 }
 
@@ -166,6 +168,9 @@
 
 void SwDBTreeList::InitTreeList()
 {
+#if HAVE_FEATURE_DBCONNECTIVITY
+    return;
+#endif
     if(!pImpl->HasContext() && pImpl->GetWrtShell())
         return;
     SetSelectionMode(SelectionMode::Single);
