[Libreoffice-commits] core.git: config_host/config_features.h.in config_host.mk.in configure.ac forms/Library_frm.mk include/connectivity Repository.mk RepositoryModule_host.mk sc/source sfx2/source solenv/gbuild svx/source

Tor Lillqvist tml at collabora.com
Thu Apr 17 14:05:27 PDT 2014


 Repository.mk                     |   26 ++++++++++++++------------
 RepositoryModule_host.mk          |    4 ++--
 config_host.mk.in                 |    1 -
 config_host/config_features.h.in  |    6 ++++++
 configure.ac                      |   28 +++++++---------------------
 forms/Library_frm.mk              |    2 +-
 include/connectivity/sqlparse.hxx |    4 +++-
 sc/source/ui/docshell/docsh8.cxx  |   26 ++++++++++++++------------
 sfx2/source/doc/objxtor.cxx       |    2 +-
 solenv/gbuild/gbuild.mk           |    1 -
 svx/source/dialog/txencbox.cxx    |    5 +++--
 11 files changed, 51 insertions(+), 54 deletions(-)

New commits:
commit 629cc605a45e75d6896b524eada2354c1d4d33a8
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Apr 17 23:51:04 2014 +0300

    Intermediate commit of hacking on --disable-database-connectivity
    
    Add HAVE_FEATURE_DBCONNECTIVITY to <config_features.h> instead of
    using (or not, more likely) -DDISABLE_DBCONNECTIVITY.
    
    The plan is still that database connectivity would be disabled always
    for the non-desktop platforms, and otherwise disabling it would be a
    configure option.
    
    But, still lots to do; the TiledLibreOffice iOS test app gets tons of
    undefineds when linking if I actually try to disable the database
    connectivity.
    
    Change-Id: If1e4b55faa1514cd55dec5fc5487a30d689739ac

diff --git a/Repository.mk b/Repository.mk
index dd1928f..3b6f3d9 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -149,7 +149,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,base, \
 
 $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,calc, \
 	analysis \
-	calc \
+	$(call gb_Helper_optional,DBCONNECTIVITY,calc) \
 	date \
 	pricing \
 	sc \
@@ -227,11 +227,12 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 	configmgr \
 	ctl \
 	cui \
-	dba \
-	dbase \
-	dbmm \
-	$(if $(DISABLE_DBCONNECTIVITY),,dbtools) \
-	dbaxml \
+	$(call gb_Helper_optional,DBCONNECTIVITY, \
+		dba \
+		dbase \
+		dbmm \
+		dbtools \
+		dbaxml) \
 	deploymentmisc \
 	$(if $(filter-out MACOSX WNT,$(OS)),desktopbe1) \
 	$(if $(filter unx,$(GUIBASE)),desktop_detector) \
@@ -253,8 +254,9 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 	evtatt \
 	exp \
 	expwrap \
-	flat \
-	file \
+	$(call gb_Helper_optional,DBCONNECTIVITY, \
+		flat \
+		file) \
 	filterconfig \
 	$(if $(filter $(ENABLE_FIREBIRD_SDBC),TRUE),firebird_sdbc) \
 	fps_office \
@@ -300,7 +302,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 	msfilter \
 	$(if $(DISABLE_SCRIPTING),,msforms) \
 	mtfrenderer \
-	mysql \
+	$(call gb_Helper_optional,DBCONNECTIVITY,mysql) \
 	odbc \
 	odfflatxml \
 	offacc \
@@ -313,7 +315,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 	res \
 	sax \
 	sb \
-	sdbt \
+	$(call gb_Helper_optional,DBCONNECTIVITY,sdbt) \
 	scn \
 	sd \
 	sdd \
@@ -412,7 +414,7 @@ $(eval $(call gb_Helper_register_libraries,OOOLIBS, \
 	) \
 	communi \
 	ooxml \
-	sdbc \
+	$(call gb_Helper_optional,DBCONNECTIVITY,sdbc) \
 	avmediaQuickTime \
 	filtertracer \
 	rpt \
@@ -502,7 +504,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
 	cached1 \
 	collator_data \
 	comphelper \
-	dbpool2 \
+	$(call gb_Helper_optional,DBCONNECTIVITY,dbpool2) \
 	deployment \
 	deploymentgui \
 	dict_ja \
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 9b18d63..0d5185e 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -37,7 +37,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	cpputools \
 	$(call gb_Helper_optional,CRASHREP,crashrep) \
 	cui \
-	dbaccess \
+	$(call gb_Helper_optional,DBCONNECTIVITY,dbaccess) \
 	desktop \
 	$(call gb_Helper_optional,DICTIONARIES,dictionaries) \
 	dtrans \
@@ -50,7 +50,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	external \
 	extras \
 	filter \
-	$(call gb_Helper_optional,DBCONNECTIVITY,forms) \
+	forms \
 	formula \
 	fpicker \
 	framework \
diff --git a/config_host.mk.in b/config_host.mk.in
index 6eb2c1a..f798ce3 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -92,7 +92,6 @@ export DICT_SYSTEM_DIR=@DICT_SYSTEM_DIR@
 export DISABLE_ACTIVEX=@DISABLE_ACTIVEX@
 export DISABLE_ATL=@DISABLE_ATL@
 export DISABLE_CVE_TESTS=@DISABLE_CVE_TESTS@
-export DISABLE_DBCONNECTIVITY=@DISABLE_DBCONNECTIVITY@
 export DISABLE_DYNLOADING=@DISABLE_DYNLOADING@
 export DISABLE_EXPORT=@DISABLE_EXPORT@
 export DISABLE_OPENSSL=@DISABLE_OPENSSL@
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index 612ceca..55232c6 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -49,6 +49,12 @@
 
 #define HAVE_FEATURE_AVMEDIA 0
 
+/* DBCONNECTIVITY - Whether to have functionality to connect to
+ * databases.
+ */
+
+#define HAVE_FEATURE_DBCONNECTIVITY 0
+
 /* EXTENSIONS - Whether we have any extension mechanism at all
  *
  * Primarily intended for non-desktop platforms where supporting
diff --git a/configure.ac b/configure.ac
index 4e83ed6..3a294ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2359,35 +2359,21 @@ else
     SCPDEFS="$SCPDEFS -DDISABLE_AVMEDIA"
 fi
 
-dnl Decide whether to build database connectivity stuff (including
-dnl Base) or not. We probably don't want to on non-desktop OSes.
+# Decide whether to build database connectivity stuff (including
+# Base) or not. We probably don't want to on non-desktop OSes.
 
 if test -z "$enable_database_connectivity"; then
-    # Do enable database connectivity for Android for now as otherwise
-    # we presumably will get linking errors... We are not as far in
-    # the work for iOS, so we might as well disable it for iOS already.
-
-    # And actually, do enable it for iOS, too. Let's get back to
-    # figuring out what to do with this later, if ever.
-
-    # (Note that with "enable", I mean "enable building the related
-    # code". Very likely little of it will make any sense at run-time
-    # on Android or iOS and won't even be shipped with/linked into any
-    # app.)
-
-    #if test $_os != iOS; then
+    # --disable-database-connectivity is unfinished work in progress
+    # and the iOS test app doesn't link if we actually try to use it.
+    # if test $_os != iOS -a $_os != Android; then
         enable_database_connectivity=yes
-    #fi
+    # fi
 fi
 
-DISABLE_DBCONNECTIVITY=''
 if test "$enable_database_connectivity" = yes; then
     BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
-else
-    DISABLE_DBCONNECTIVITY='TRUE'
-    SCPDEFS="$SCPDEFS -DDISABLE_DBCONNECTIVITY"
+    AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
 fi
-AC_SUBST(DISABLE_DBCONNECTIVITY)
 
 if test -z "$enable_extensions"; then
     # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
diff --git a/forms/Library_frm.mk b/forms/Library_frm.mk
index a5b80b6..d130431 100644
--- a/forms/Library_frm.mk
+++ b/forms/Library_frm.mk
@@ -26,7 +26,7 @@ $(eval $(call gb_Library_use_libraries,frm,\
     comphelper \
     cppu \
     cppuhelper \
-    dbtools \
+    $(call gb_Helper_optional,DBCONNECTIVITY,dbtools) \
     editeng \
     i18nlangtag \
     sal \
diff --git a/include/connectivity/sqlparse.hxx b/include/connectivity/sqlparse.hxx
index 15e2941..f6a7b0f 100644
--- a/include/connectivity/sqlparse.hxx
+++ b/include/connectivity/sqlparse.hxx
@@ -19,10 +19,12 @@
 #ifndef INCLUDED_CONNECTIVITY_SQLPARSE_HXX
 #define INCLUDED_CONNECTIVITY_SQLPARSE_HXX
 
+#include <config_features.h>
+
 #include <com/sun/star/uno/Reference.h>
 #include <osl/mutex.hxx>
 #include <connectivity/sqlnode.hxx>
-#ifndef DISABLE_DBCONNECTIVITY
+#if HAVE_FEATURE_DBCONNECTIVITY
 #ifndef YYBISON
 #ifndef FLEX_SCANNER
 #include "sqlbison.hxx"
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 28bbeca..0aefb22 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <config_features.h>
+
 #include <stdio.h>
 #include <tools/urlobj.hxx>
 #include <svl/converter.hxx>
@@ -26,7 +28,7 @@
 #include <ucbhelper/content.hxx>
 #include <svx/txenctab.hxx>
 
-#ifndef DISABLE_DBCONNECTIVITY
+#if HAVE_FEATURE_DBCONNECTIVITY
 #include <svx/dbcharsethelper.hxx>
 #endif
 
@@ -79,6 +81,8 @@
 using namespace com::sun::star;
 using ::std::vector;
 
+#if HAVE_FEATURE_DBCONNECTIVITY
+
 #define SC_SERVICE_ROWSET           "com.sun.star.sdb.RowSet"
 
 //! move to a header file?
@@ -95,8 +99,6 @@ using ::std::vector;
 #define SC_DBPROP_EXTENSION         "Extension"
 #define SC_DBPROP_CHARSET           "CharSet"
 
-#ifndef DISABLE_DBCONNECTIVITY
-
 namespace
 {
     sal_uLong lcl_getDBaseConnection(uno::Reference<sdbc::XDriverManager2>& _rDrvMgr, uno::Reference<sdbc::XConnection>& _rConnection, OUString& _rTabName, const OUString& rFullFileName, rtl_TextEncoding eCharSet)
@@ -148,7 +150,7 @@ namespace
     }
 }
 
-#endif // !DISABLE_DBCONNECTIVITY
+#endif // HAVE_FEATURE_DBCONNECTIVITY
 
 
 // MoveFile/KillFile/IsDocument: similar to SfxContentHelper
@@ -237,7 +239,7 @@ bool ScDocShell::IsDocument( const INetURLObject& rURL )
     return bRet;
 }
 
-#ifndef DISABLE_DBCONNECTIVITY
+#if HAVE_FEATURE_DBCONNECTIVITY
 
 static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales)
 {
@@ -285,12 +287,12 @@ static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales
     }
 }
 
-#endif // !DISABLE_DBCONNECTIVITY
+#endif // HAVE_FEATURE_DBCONNECTIVITY
 
 sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncoding eCharSet,
                                ScColWidthParam aColWidthParam[MAXCOLCOUNT], ScFlatBoolRowSegments& rRowHeightsRecalc )
 {
-#ifdef DISABLE_DBCONNECTIVITY
+#if !HAVE_FEATURE_DBCONNECTIVITY
     (void) rFullFileName;
     (void) eCharSet;
     (void) aColWidthParam;
@@ -462,10 +464,10 @@ sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncodi
     }
 
     return nErr;
-#endif // !DISABLE_DBCONNECTIVITY
+#endif // HAVE_FEATURE_DBCONNECTIVITY
 }
 
-#ifndef DISABLE_DBCONNECTIVITY
+#if HAVE_FEATURE_DBCONNECTIVITY
 
 namespace {
 
@@ -773,11 +775,11 @@ inline void lcl_getLongVarCharString(
 
 }
 
-#endif // !DISABLE_DBCONNECTIVITY
+#endif // HAVE_FEATURE_DBCONNECTIVITY
 
 sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding eCharSet, bool& bHasMemo )
 {
-#ifdef DISABLE_DBCONNECTIVITY
+#if !HAVE_FEATURE_DBCONNECTIVITY
     (void) rFullFileName;
     (void) eCharSet;
     (void) bHasMemo;
@@ -1151,7 +1153,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
     }
 
     return nErr;
-#endif // !DISABLE_DBCONNECTIVITY
+#endif // HAVE_FEATURE_DBCONNECTIVITY
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 6f481d8..c97cb4a 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -1025,7 +1025,7 @@ OUString SfxObjectShell::GetServiceNameFromFactory( const OUString& rFact )
         aServiceName = "com.sun.star.script.BasicIDE";
     }
 #endif
-#ifndef DISABLE_DBCONNECTIVITY
+#if HAVE_FEATURE_DBCONNECTIVITY
     else if ( aFact == "sdatabase" )
     {
         aServiceName = "com.sun.star.sdb.OfficeDatabaseDocument";
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index a864eb8..23d5591 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -248,7 +248,6 @@ endif
 
 gb_GLOBALDEFS += \
 	$(call gb_Helper_define_if_set,\
-		DISABLE_DBCONNECTIVITY \
 		DISABLE_DYNLOADING \
 		DISABLE_EXPORT \
 		DISABLE_SCRIPTING \
diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx
index 969186c..ae5ba01 100644
--- a/svx/source/dialog/txencbox.cxx
+++ b/svx/source/dialog/txencbox.cxx
@@ -17,11 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <config_features.h>
 
 #include "svx/txencbox.hxx"
 #include "svx/txenctab.hxx"
 #include <svx/dialogs.hrc>
-#ifndef DISABLE_DBCONNECTIVITY
+#if HAVE_FEATURE_DBCONNECTIVITY
 #include "svx/dbcharsethelper.hxx"
 #endif
 #include <vcl/builder.hxx>
@@ -134,7 +135,7 @@ void SvxTextEncodingBox::FillFromDbTextEncodingMap(
         bool bExcludeImportSubsets, sal_uInt32 nExcludeInfoFlags,
         sal_uInt32 nButIncludeInfoFlags )
 {
-#ifdef DISABLE_DBCONNECTIVITY
+#if !HAVE_FEATURE_DBCONNECTIVITY
     (void)bExcludeImportSubsets;
     (void)nExcludeInfoFlags;
     (void)nButIncludeInfoFlags;


More information about the Libreoffice-commits mailing list