[Libreoffice-commits] core.git: config_host/config_features.h.in config_host.mk.in configure.ac desktop/source solenv/gbuild

Tor Lillqvist tml at iki.fi
Wed Mar 27 04:02:50 PDT 2013


 config_host.mk.in                                                     |    1 
 config_host/config_features.h.in                                      |    9 ++++++
 configure.ac                                                          |    7 +----
 desktop/source/app/app.cxx                                            |    2 -
 desktop/source/deployment/manager/dp_activepackages.cxx               |   13 +++++-----
 desktop/source/deployment/manager/dp_activepackages.hxx               |    6 +++-
 desktop/source/deployment/registry/configuration/dp_configuration.cxx |   13 +++++-----
 solenv/gbuild/gbuild.mk                                               |    1 
 8 files changed, 30 insertions(+), 22 deletions(-)

New commits:
commit ab7ac5884c5a824999b58d2a800cae64cb8e359a
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Mar 27 12:56:59 2013 +0200

    Use <config_features.h> instead of -DDISABLE_EXTENSIONS
    
    Change-Id: I4fe5cd27b77d44b9b33af0ae3c3754e3b85c2ca3

diff --git a/config_host.mk.in b/config_host.mk.in
index 8457cb3..83aad60 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -96,7 +96,6 @@ export DISABLE_CVE_TESTS=@DISABLE_CVE_TESTS@
 export DISABLE_DBCONNECTIVITY=@DISABLE_DBCONNECTIVITY@
 export DISABLE_DYNLOADING=@DISABLE_DYNLOADING@
 export DISABLE_EXPORT=@DISABLE_EXPORT@
-export DISABLE_EXTENSIONS=@DISABLE_EXTENSIONS@
 export DISABLE_LINKOO=@DISABLE_LINKOO@
 export DISABLE_NEON=@DISABLE_NEON@
 export DISABLE_PYTHON=@DISABLE_PYTHON@
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index 48ac1dc..1cc2476 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -21,6 +21,15 @@
 
 #define HAVE_FEATURE_DESKTOP 0
 
+/* EXTENSIONS - Whether we have any extension mechanism at all
+ *
+ * Primarily intended for non-desktop platforms where supporting
+ * extensions can be complicated, or even prohibited by the OS (as on
+ * iOS).
+ */
+
+#define HAVE_FEATURE_EXTENSIONS 0
+
 /* HELP - Whether we have the "normal" desktop-style help mechanism
  *
  * Can be turned on/off also for desktop environments with
diff --git a/configure.ac b/configure.ac
index 6647b05..970ae68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2157,13 +2157,10 @@ if test -z "$enable_extensions"; then
     fi
 fi
 
-DISABLE_EXTENSIONS=''
 if test "$enable_extensions" = yes; then
     BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
-else
-    DISABLE_EXTENSIONS='TRUE'
+    AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
 fi
-AC_SUBST(DISABLE_EXTENSIONS)
 
 if test -z "$enable_scripting"; then
     # Disable scripting for iOS unless specifically overridden
@@ -2659,7 +2656,7 @@ AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
 AC_MSG_CHECKING([whether to treat the installation as read-only])
 
 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = YES \) -o \
-        "$DISABLE_EXTENSIONS" = TRUE; then
+        "$enable_extensions" != yes; then
     enable_readonly_installset=yes
 fi
 if test "$enable_readonly_installset" = yes; then
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 1f57c2e..e9301bf 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1541,7 +1541,7 @@ int Desktop::Main()
         */
         Application::GetDefaultDevice();
 
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
         // Check if bundled or shared extensions were added /removed
         // and process those extensions (has to be done before checking
         // the extension dependencies!
diff --git a/desktop/source/deployment/manager/dp_activepackages.cxx b/desktop/source/deployment/manager/dp_activepackages.cxx
index 1a4081f..1eaeb09 100644
--- a/desktop/source/deployment/manager/dp_activepackages.cxx
+++ b/desktop/source/deployment/manager/dp_activepackages.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <config_features.h>
 
 #include "sal/config.h"
 
@@ -43,7 +44,7 @@
 //   key: 0xFF UTF8(identifier)
 //   value: UTF8(tempname) 0xFF UTF8(filename) 0xFF UTF8(mediatype)
 
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
 
 namespace {
 
@@ -117,7 +118,7 @@ namespace dp_manager {
 ActivePackages::ActivePackages() {}
 
 ActivePackages::ActivePackages(::rtl::OUString const & url, bool readOnly)
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
     : m_map(url, readOnly)
 #endif
 {
@@ -137,7 +138,7 @@ bool ActivePackages::get(
     Data * data, ::rtl::OUString const & id, ::rtl::OUString const & fileName)
     const
 {
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
     ::rtl::OString v;
     if (m_map.get(&v, newKey(id))) {
         if (data != NULL) {
@@ -162,7 +163,7 @@ bool ActivePackages::get(
 
 ActivePackages::Entries ActivePackages::getEntries() const {
     Entries es;
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
     ::dp_misc::t_string2string_map m(m_map.getEntries());
     for (::dp_misc::t_string2string_map::const_iterator i(m.begin());
          i != m.end(); ++i)
@@ -188,7 +189,7 @@ ActivePackages::Entries ActivePackages::getEntries() const {
 }
 
 void ActivePackages::put(::rtl::OUString const & id, Data const & data) {
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
     ::rtl::OStringBuffer b;
     b.append(
         ::rtl::OUStringToOString(data.temporaryName, RTL_TEXTENCODING_UTF8));
@@ -210,7 +211,7 @@ void ActivePackages::put(::rtl::OUString const & id, Data const & data) {
 void ActivePackages::erase(
     ::rtl::OUString const & id, ::rtl::OUString const & fileName)
 {
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
     m_map.erase(newKey(id), true) || m_map.erase(oldKey(fileName), true);
 #else
     (void) id;
diff --git a/desktop/source/deployment/manager/dp_activepackages.hxx b/desktop/source/deployment/manager/dp_activepackages.hxx
index fa2d909..940b6aa 100644
--- a/desktop/source/deployment/manager/dp_activepackages.hxx
+++ b/desktop/source/deployment/manager/dp_activepackages.hxx
@@ -20,12 +20,14 @@
 #ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_MANAGER_DP_ACTIVEPACKAGES_HXX
 #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_MANAGER_DP_ACTIVEPACKAGES_HXX
 
+#include <config_features.h>
+
 #include "sal/config.h"
 
 #include <utility>
 #include <vector>
 
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
 #include "dp_persmap.h"
 #endif
 
@@ -84,7 +86,7 @@ public:
 private:
     ActivePackages(ActivePackages &); // not defined
     void operator =(ActivePackages &); // not defined
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
     ::dp_misc::PersistentMap m_map;
 #endif
 };
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 7c5b5d0..b17f057 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -17,13 +17,14 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 //TODO: Large parts of this file were copied from dp_component.cxx; those parts
 // should be consolidated.
 
+#include <config_features.h>
+
 #include "dp_configuration.hrc"
 #include "dp_backend.h"
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
 #include "dp_persmap.h"
 #endif
 #include "dp_ucb.h"
@@ -111,7 +112,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
         OUString const & identifier,
         Reference<XCommandEnvironment> const & xCmdEnv );
 
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
     // for backwards compatibility - nil if no (compatible) back-compat db present
     ::std::auto_ptr<PersistentMap> m_registeredPackages;
 #endif
@@ -217,7 +218,7 @@ BackendImpl::BackendImpl(
 
         configmgrini_verify_init( xCmdEnv );
 
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
         SAL_WNODEPRECATED_DECLARATIONS_PUSH
         ::std::auto_ptr<PersistentMap> pMap;
         SAL_WNODEPRECATED_DECLARATIONS_POP
@@ -554,7 +555,7 @@ BackendImpl::PackageImpl::isRegistered_(
     if (that->hasActiveEntry(getURL()))
         bReg = true;
 
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
     if (!bReg && that->m_registeredPackages.get())
     {
         // fallback for user extension registered in berkeley DB
@@ -743,7 +744,7 @@ void BackendImpl::PackageImpl::processPackage_(
     }
     else // revoke
     {
-#ifndef DISABLE_EXTENSIONS
+#if HAVE_FEATURE_EXTENSIONS
         if (!that->removeFromConfigmgrIni(m_isSchema, url, xCmdEnv) &&
             that->m_registeredPackages.get()) {
             // Obsolete package database handling - should be removed for LibreOffice 4.0
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 5a4161e..3cc234e 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -271,7 +271,6 @@ gb_GLOBALDEFS += \
 		DISABLE_DBCONNECTIVITY \
 		DISABLE_DYNLOADING \
 		DISABLE_EXPORT \
-		DISABLE_EXTENSIONS \
 		DISABLE_SCRIPTING \
 		ENABLE_MACOSX_SANDBOX \
 		ENABLE_READONLY_INSTALLSET \


More information about the Libreoffice-commits mailing list