Kaydet (Commit) 629cc605 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst 558aa446
...@@ -149,7 +149,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,base, \ ...@@ -149,7 +149,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,base, \
$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,calc, \ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,calc, \
analysis \ analysis \
calc \ $(call gb_Helper_optional,DBCONNECTIVITY,calc) \
date \ date \
pricing \ pricing \
sc \ sc \
...@@ -227,11 +227,12 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ ...@@ -227,11 +227,12 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
configmgr \ configmgr \
ctl \ ctl \
cui \ cui \
dba \ $(call gb_Helper_optional,DBCONNECTIVITY, \
dbase \ dba \
dbmm \ dbase \
$(if $(DISABLE_DBCONNECTIVITY),,dbtools) \ dbmm \
dbaxml \ dbtools \
dbaxml) \
deploymentmisc \ deploymentmisc \
$(if $(filter-out MACOSX WNT,$(OS)),desktopbe1) \ $(if $(filter-out MACOSX WNT,$(OS)),desktopbe1) \
$(if $(filter unx,$(GUIBASE)),desktop_detector) \ $(if $(filter unx,$(GUIBASE)),desktop_detector) \
...@@ -253,8 +254,9 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ ...@@ -253,8 +254,9 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
evtatt \ evtatt \
exp \ exp \
expwrap \ expwrap \
flat \ $(call gb_Helper_optional,DBCONNECTIVITY, \
file \ flat \
file) \
filterconfig \ filterconfig \
$(if $(filter $(ENABLE_FIREBIRD_SDBC),TRUE),firebird_sdbc) \ $(if $(filter $(ENABLE_FIREBIRD_SDBC),TRUE),firebird_sdbc) \
fps_office \ fps_office \
...@@ -300,7 +302,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ ...@@ -300,7 +302,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
msfilter \ msfilter \
$(if $(DISABLE_SCRIPTING),,msforms) \ $(if $(DISABLE_SCRIPTING),,msforms) \
mtfrenderer \ mtfrenderer \
mysql \ $(call gb_Helper_optional,DBCONNECTIVITY,mysql) \
odbc \ odbc \
odfflatxml \ odfflatxml \
offacc \ offacc \
...@@ -313,7 +315,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ ...@@ -313,7 +315,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
res \ res \
sax \ sax \
sb \ sb \
sdbt \ $(call gb_Helper_optional,DBCONNECTIVITY,sdbt) \
scn \ scn \
sd \ sd \
sdd \ sdd \
...@@ -412,7 +414,7 @@ $(eval $(call gb_Helper_register_libraries,OOOLIBS, \ ...@@ -412,7 +414,7 @@ $(eval $(call gb_Helper_register_libraries,OOOLIBS, \
) \ ) \
communi \ communi \
ooxml \ ooxml \
sdbc \ $(call gb_Helper_optional,DBCONNECTIVITY,sdbc) \
avmediaQuickTime \ avmediaQuickTime \
filtertracer \ filtertracer \
rpt \ rpt \
...@@ -502,7 +504,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \ ...@@ -502,7 +504,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
cached1 \ cached1 \
collator_data \ collator_data \
comphelper \ comphelper \
dbpool2 \ $(call gb_Helper_optional,DBCONNECTIVITY,dbpool2) \
deployment \ deployment \
deploymentgui \ deploymentgui \
dict_ja \ dict_ja \
......
...@@ -37,7 +37,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\ ...@@ -37,7 +37,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
cpputools \ cpputools \
$(call gb_Helper_optional,CRASHREP,crashrep) \ $(call gb_Helper_optional,CRASHREP,crashrep) \
cui \ cui \
dbaccess \ $(call gb_Helper_optional,DBCONNECTIVITY,dbaccess) \
desktop \ desktop \
$(call gb_Helper_optional,DICTIONARIES,dictionaries) \ $(call gb_Helper_optional,DICTIONARIES,dictionaries) \
dtrans \ dtrans \
...@@ -50,7 +50,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\ ...@@ -50,7 +50,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
external \ external \
extras \ extras \
filter \ filter \
$(call gb_Helper_optional,DBCONNECTIVITY,forms) \ forms \
formula \ formula \
fpicker \ fpicker \
framework \ framework \
......
...@@ -92,7 +92,6 @@ export DICT_SYSTEM_DIR=@DICT_SYSTEM_DIR@ ...@@ -92,7 +92,6 @@ export DICT_SYSTEM_DIR=@DICT_SYSTEM_DIR@
export DISABLE_ACTIVEX=@DISABLE_ACTIVEX@ export DISABLE_ACTIVEX=@DISABLE_ACTIVEX@
export DISABLE_ATL=@DISABLE_ATL@ export DISABLE_ATL=@DISABLE_ATL@
export DISABLE_CVE_TESTS=@DISABLE_CVE_TESTS@ export DISABLE_CVE_TESTS=@DISABLE_CVE_TESTS@
export DISABLE_DBCONNECTIVITY=@DISABLE_DBCONNECTIVITY@
export DISABLE_DYNLOADING=@DISABLE_DYNLOADING@ export DISABLE_DYNLOADING=@DISABLE_DYNLOADING@
export DISABLE_EXPORT=@DISABLE_EXPORT@ export DISABLE_EXPORT=@DISABLE_EXPORT@
export DISABLE_OPENSSL=@DISABLE_OPENSSL@ export DISABLE_OPENSSL=@DISABLE_OPENSSL@
......
...@@ -49,6 +49,12 @@ ...@@ -49,6 +49,12 @@
#define HAVE_FEATURE_AVMEDIA 0 #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 /* EXTENSIONS - Whether we have any extension mechanism at all
* *
* Primarily intended for non-desktop platforms where supporting * Primarily intended for non-desktop platforms where supporting
......
...@@ -2359,35 +2359,21 @@ else ...@@ -2359,35 +2359,21 @@ else
SCPDEFS="$SCPDEFS -DDISABLE_AVMEDIA" SCPDEFS="$SCPDEFS -DDISABLE_AVMEDIA"
fi fi
dnl Decide whether to build database connectivity stuff (including # Decide whether to build database connectivity stuff (including
dnl Base) or not. We probably don't want to on non-desktop OSes. # Base) or not. We probably don't want to on non-desktop OSes.
if test -z "$enable_database_connectivity"; then if test -z "$enable_database_connectivity"; then
# Do enable database connectivity for Android for now as otherwise # --disable-database-connectivity is unfinished work in progress
# we presumably will get linking errors... We are not as far in # and the iOS test app doesn't link if we actually try to use it.
# the work for iOS, so we might as well disable it for iOS already. # if test $_os != iOS -a $_os != Android; then
# 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
enable_database_connectivity=yes enable_database_connectivity=yes
#fi # fi
fi fi
DISABLE_DBCONNECTIVITY=''
if test "$enable_database_connectivity" = yes; then if test "$enable_database_connectivity" = yes; then
BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY" BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
else AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
DISABLE_DBCONNECTIVITY='TRUE'
SCPDEFS="$SCPDEFS -DDISABLE_DBCONNECTIVITY"
fi fi
AC_SUBST(DISABLE_DBCONNECTIVITY)
if test -z "$enable_extensions"; then if test -z "$enable_extensions"; then
# For iOS and Android disable extensions unless specifically overridden with --enable-extensions. # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
......
...@@ -26,7 +26,7 @@ $(eval $(call gb_Library_use_libraries,frm,\ ...@@ -26,7 +26,7 @@ $(eval $(call gb_Library_use_libraries,frm,\
comphelper \ comphelper \
cppu \ cppu \
cppuhelper \ cppuhelper \
dbtools \ $(call gb_Helper_optional,DBCONNECTIVITY,dbtools) \
editeng \ editeng \
i18nlangtag \ i18nlangtag \
sal \ sal \
......
...@@ -19,10 +19,12 @@ ...@@ -19,10 +19,12 @@
#ifndef INCLUDED_CONNECTIVITY_SQLPARSE_HXX #ifndef INCLUDED_CONNECTIVITY_SQLPARSE_HXX
#define INCLUDED_CONNECTIVITY_SQLPARSE_HXX #define INCLUDED_CONNECTIVITY_SQLPARSE_HXX
#include <config_features.h>
#include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Reference.h>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <connectivity/sqlnode.hxx> #include <connectivity/sqlnode.hxx>
#ifndef DISABLE_DBCONNECTIVITY #if HAVE_FEATURE_DBCONNECTIVITY
#ifndef YYBISON #ifndef YYBISON
#ifndef FLEX_SCANNER #ifndef FLEX_SCANNER
#include "sqlbison.hxx" #include "sqlbison.hxx"
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <config_features.h>
#include <stdio.h> #include <stdio.h>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <svl/converter.hxx> #include <svl/converter.hxx>
...@@ -26,7 +28,7 @@ ...@@ -26,7 +28,7 @@
#include <ucbhelper/content.hxx> #include <ucbhelper/content.hxx>
#include <svx/txenctab.hxx> #include <svx/txenctab.hxx>
#ifndef DISABLE_DBCONNECTIVITY #if HAVE_FEATURE_DBCONNECTIVITY
#include <svx/dbcharsethelper.hxx> #include <svx/dbcharsethelper.hxx>
#endif #endif
...@@ -79,6 +81,8 @@ ...@@ -79,6 +81,8 @@
using namespace com::sun::star; using namespace com::sun::star;
using ::std::vector; using ::std::vector;
#if HAVE_FEATURE_DBCONNECTIVITY
#define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet" #define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet"
//! move to a header file? //! move to a header file?
...@@ -95,8 +99,6 @@ using ::std::vector; ...@@ -95,8 +99,6 @@ using ::std::vector;
#define SC_DBPROP_EXTENSION "Extension" #define SC_DBPROP_EXTENSION "Extension"
#define SC_DBPROP_CHARSET "CharSet" #define SC_DBPROP_CHARSET "CharSet"
#ifndef DISABLE_DBCONNECTIVITY
namespace namespace
{ {
sal_uLong lcl_getDBaseConnection(uno::Reference<sdbc::XDriverManager2>& _rDrvMgr, uno::Reference<sdbc::XConnection>& _rConnection, OUString& _rTabName, const OUString& rFullFileName, rtl_TextEncoding eCharSet) 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 ...@@ -148,7 +150,7 @@ namespace
} }
} }
#endif // !DISABLE_DBCONNECTIVITY #endif // HAVE_FEATURE_DBCONNECTIVITY
// MoveFile/KillFile/IsDocument: similar to SfxContentHelper // MoveFile/KillFile/IsDocument: similar to SfxContentHelper
...@@ -237,7 +239,7 @@ bool ScDocShell::IsDocument( const INetURLObject& rURL ) ...@@ -237,7 +239,7 @@ bool ScDocShell::IsDocument( const INetURLObject& rURL )
return bRet; return bRet;
} }
#ifndef DISABLE_DBCONNECTIVITY #if HAVE_FEATURE_DBCONNECTIVITY
static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales) static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales)
{ {
...@@ -285,12 +287,12 @@ 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, sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncoding eCharSet,
ScColWidthParam aColWidthParam[MAXCOLCOUNT], ScFlatBoolRowSegments& rRowHeightsRecalc ) ScColWidthParam aColWidthParam[MAXCOLCOUNT], ScFlatBoolRowSegments& rRowHeightsRecalc )
{ {
#ifdef DISABLE_DBCONNECTIVITY #if !HAVE_FEATURE_DBCONNECTIVITY
(void) rFullFileName; (void) rFullFileName;
(void) eCharSet; (void) eCharSet;
(void) aColWidthParam; (void) aColWidthParam;
...@@ -462,10 +464,10 @@ sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncodi ...@@ -462,10 +464,10 @@ sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncodi
} }
return nErr; return nErr;
#endif // !DISABLE_DBCONNECTIVITY #endif // HAVE_FEATURE_DBCONNECTIVITY
} }
#ifndef DISABLE_DBCONNECTIVITY #if HAVE_FEATURE_DBCONNECTIVITY
namespace { namespace {
...@@ -773,11 +775,11 @@ inline void lcl_getLongVarCharString( ...@@ -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 ) sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding eCharSet, bool& bHasMemo )
{ {
#ifdef DISABLE_DBCONNECTIVITY #if !HAVE_FEATURE_DBCONNECTIVITY
(void) rFullFileName; (void) rFullFileName;
(void) eCharSet; (void) eCharSet;
(void) bHasMemo; (void) bHasMemo;
...@@ -1151,7 +1153,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi ...@@ -1151,7 +1153,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
} }
return nErr; return nErr;
#endif // !DISABLE_DBCONNECTIVITY #endif // HAVE_FEATURE_DBCONNECTIVITY
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -1025,7 +1025,7 @@ OUString SfxObjectShell::GetServiceNameFromFactory( const OUString& rFact ) ...@@ -1025,7 +1025,7 @@ OUString SfxObjectShell::GetServiceNameFromFactory( const OUString& rFact )
aServiceName = "com.sun.star.script.BasicIDE"; aServiceName = "com.sun.star.script.BasicIDE";
} }
#endif #endif
#ifndef DISABLE_DBCONNECTIVITY #if HAVE_FEATURE_DBCONNECTIVITY
else if ( aFact == "sdatabase" ) else if ( aFact == "sdatabase" )
{ {
aServiceName = "com.sun.star.sdb.OfficeDatabaseDocument"; aServiceName = "com.sun.star.sdb.OfficeDatabaseDocument";
......
...@@ -248,7 +248,6 @@ endif ...@@ -248,7 +248,6 @@ endif
gb_GLOBALDEFS += \ gb_GLOBALDEFS += \
$(call gb_Helper_define_if_set,\ $(call gb_Helper_define_if_set,\
DISABLE_DBCONNECTIVITY \
DISABLE_DYNLOADING \ DISABLE_DYNLOADING \
DISABLE_EXPORT \ DISABLE_EXPORT \
DISABLE_SCRIPTING \ DISABLE_SCRIPTING \
......
...@@ -17,11 +17,12 @@ ...@@ -17,11 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <config_features.h>
#include "svx/txencbox.hxx" #include "svx/txencbox.hxx"
#include "svx/txenctab.hxx" #include "svx/txenctab.hxx"
#include <svx/dialogs.hrc> #include <svx/dialogs.hrc>
#ifndef DISABLE_DBCONNECTIVITY #if HAVE_FEATURE_DBCONNECTIVITY
#include "svx/dbcharsethelper.hxx" #include "svx/dbcharsethelper.hxx"
#endif #endif
#include <vcl/builder.hxx> #include <vcl/builder.hxx>
...@@ -134,7 +135,7 @@ void SvxTextEncodingBox::FillFromDbTextEncodingMap( ...@@ -134,7 +135,7 @@ void SvxTextEncodingBox::FillFromDbTextEncodingMap(
bool bExcludeImportSubsets, sal_uInt32 nExcludeInfoFlags, bool bExcludeImportSubsets, sal_uInt32 nExcludeInfoFlags,
sal_uInt32 nButIncludeInfoFlags ) sal_uInt32 nButIncludeInfoFlags )
{ {
#ifdef DISABLE_DBCONNECTIVITY #if !HAVE_FEATURE_DBCONNECTIVITY
(void)bExcludeImportSubsets; (void)bExcludeImportSubsets;
(void)nExcludeInfoFlags; (void)nExcludeInfoFlags;
(void)nButIncludeInfoFlags; (void)nButIncludeInfoFlags;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment