[Libreoffice-commits] .: 13 commits - bridges/source config_host.mk.in configure.in cppuhelper/source cppu/inc cppu/source ios/qa sal/cppunittester sal/inc sal/Library_sal.mk sal/osl sal/rtl sal/textenc solenv/gbuild solenv/inc stoc/source ucbhelper/inc ucbhelper/source ucb/source
Tor Lillqvist
tml at kemper.freedesktop.org
Tue Mar 20 15:02:37 PDT 2012
bridges/source/cpp_uno/shared/component.cxx | 10 +
config_host.mk.in | 1
configure.in | 24 ++++
cppu/inc/uno/environment.h | 12 +-
cppu/inc/uno/mapping.h | 9 +
cppu/source/AffineBridge/AffineBridge.cxx | 7 +
cppu/source/LogBridge/LogBridge.cxx | 7 +
cppu/source/uno/data.cxx | 11 +-
cppu/source/uno/lbenv.cxx | 17 ++-
cppu/source/uno/lbmap.cxx | 65 +++++++++++
cppuhelper/source/shlib.cxx | 36 +++++-
ios/qa/sc/Makefile | 37 ++++++
ios/qa/sc/filters-test.m | 125 +++++++++++++++++------
sal/Library_sal.mk | 7 +
sal/cppunittester/cppunittester.cxx | 4
sal/inc/cppunittester/protectorfactory.hxx | 2
sal/osl/unx/module.cxx | 22 +---
sal/osl/unx/process_impl.cxx | 14 --
sal/rtl/source/bootstrap.cxx | 22 +++-
sal/rtl/source/unload.cxx | 50 +++++++++
sal/textenc/textenc.cxx | 2
solenv/gbuild/gbuild.mk | 4
solenv/gbuild/platform/IOS_ARM_GCC.mk | 4
solenv/inc/settings.mk | 4
stoc/source/bootstrap/services.cxx | 4
stoc/source/loader/dllcomponentloader.cxx | 7 +
ucb/source/cacher/cachedcontentresultset.cxx | 6 -
ucb/source/cacher/cachedcontentresultsetstub.cxx | 6 -
ucb/source/cacher/cacheddynamicresultset.cxx | 6 -
ucb/source/cacher/cacheddynamicresultsetstub.cxx | 6 -
ucb/source/core/provprox.cxx | 6 -
ucb/source/core/ucb.cxx | 6 -
ucb/source/core/ucbprops.cxx | 6 -
ucb/source/core/ucbstore.cxx | 6 -
ucb/source/sorter/sortdynres.cxx | 6 -
ucb/source/ucp/cmis/cmis_provider.cxx | 6 -
ucb/source/ucp/ftp/ftpcontent.cxx | 9 -
ucb/source/ucp/ftp/ftpcontentprovider.cxx | 4
ucb/source/ucp/hierarchy/hierarchyprovider.cxx | 6 -
ucb/source/ucp/package/pkgprovider.cxx | 6 -
ucb/source/ucp/tdoc/tdoc_provider.cxx | 6 -
ucb/source/ucp/webdav/webdavprovider.cxx | 6 -
ucbhelper/inc/ucbhelper/macros.hxx | 39 +++++--
ucbhelper/source/client/contentbroker.cxx | 34 ++++--
ucbhelper/source/client/proxydecider.cxx | 3
45 files changed, 507 insertions(+), 173 deletions(-)
New commits:
commit 25d114eec4d451acdda1ddff4c8ed9d47ba6275f
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Mar 20 23:18:55 2012 +0200
Initial experiments with static linking of (some) components / services
Start with the first service needed when running sc's filters_test:
the UniversalContentBroker. It might not be typical as ucb uses the
deprecated XSingleServiceFactory.
This commit is not at all a complete solution, far from it, just an
initial hack. Naturally once I come up with some generic enough way to
do the static linking the necessary macros etc will be added to some
general header.
The macro XSERVICEINFO_IMPL_1 (local to ucbhelper and ucb) is amended
so that it in the disable-dynamic-linking case also emits a function
whose assembler name equal contains the service name. This function
returns the XSingleServiceFactory for the service. Where the service
is instantiated we link directly to that function.
But probably this will be reworked a couple of times... Maybe it would
be better to simply have the service name specific entry point be a
pointer to the component's component_getFactory() function? Those all
have the same prototype.
diff --git a/ios/qa/sc/Makefile b/ios/qa/sc/Makefile
index e8f1901..dacdf0c 100644
--- a/ios/qa/sc/Makefile
+++ b/ios/qa/sc/Makefile
@@ -30,7 +30,7 @@ SRCS = filters-test.m
CFLAGS = $(SOLARINC)
-LIBS = -Wl,$(OUTDIR)/bin/cppunit/cppunittester.a -Wl,$(WORKDIR)/LinkTarget/CppunitTest/libtest_sc_filters_test.a -Wl,$(OUTDIR)/lib/bootstrap.uno.a -Wl,$(OUTDIR)/lib/unoexceptionprotector.a $(SOLARLIB) -lavmedialo -lbasegfxlo -lcanvastoolslo -lcomphelpgcc3 -lcppcanvaslo -lcppunit -ldrawinglayerlo -leditenglo -lforlo -lforuilo -lfwelo -lfwilo -lfwklo -lgcc3_uno -li18nisolang1gcc3 -li18npaperlo -li18nutilgcc3 -licuuc -ljpeg -ljvmfwk -llnglo -lreg -lsal_textenc -lsalcpprt -lsaxlo -lsclo -lsfxlo -lstore -lsvllo -lsvtlo -lsvxlo -lsvxcorelo -lsotlo -ltest -ltklo -ltllo -lucbhelper4gcc3 -luno_cppuhelpergcc3 -luno_cppu -luno_sal -luno_salhelpergcc3 -lunotest -lutllo -lvcllo -lxml2 -lxmlreader -lxolo -lz $(addprefix -framework , $(gb_Library__FRAMEWORKS)) -liconv -lobjc
+LIBS = -Wl,$(OUTDIR)/bin/cppunit/cppunittester.a -Wl,$(WORKDIR)/LinkTarget/CppunitTest/libtest_sc_filters_test.a -Wl,$(OUTDIR)/lib/bootstrap.uno.a -Wl,$(OUTDIR)/lib/unoexceptionprotector.a $(SOLARLIB) -lavmedialo -lbasegfxlo -lcanvastoolslo -lcomphelpgcc3 -lcppcanvaslo -lcppunit -ldrawinglayerlo -leditenglo -lforlo -lforuilo -lfwelo -lfwilo -lfwklo -lgcc3_uno -li18nisolang1gcc3 -li18npaperlo -li18nutilgcc3 -licuuc -ljpeg -ljvmfwk -llnglo -lreg -lsal_textenc -lsalcpprt -lsaxlo -lsclo -lsfxlo -lstore -lsvllo -lsvtlo -lsvxlo -lsvxcorelo -lsotlo -ltest -ltklo -ltllo -lucb1 -lucbhelper4gcc3 -luno_cppuhelpergcc3 -luno_cppu -luno_sal -luno_salhelpergcc3 -lunotest -lutllo -lvcllo -lxml2 -lxmlreader -lxolo -lz $(addprefix -framework , $(gb_Library__FRAMEWORKS)) -liconv -lobjc
all: $(APPDIR)/$(APP) stuff
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index 4c66b38..8c8654a 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -2200,10 +2200,8 @@ XTYPEPROVIDER_IMPL_3( CachedContentResultSetFactory,
//--------------------------------------------------------------------------
XSERVICEINFO_IMPL_1( CachedContentResultSetFactory,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.CachedContentResultSetFactory" )),
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- CACHED_CONTENT_RESULTSET_FACTORY_NAME )) );
+ "com.sun.star.comp.ucb.CachedContentResultSetFactory",
+ CACHED_CONTENT_RESULTSET_FACTORY_NAME );
//--------------------------------------------------------------------------
// Service factory implementation.
diff --git a/ucb/source/cacher/cachedcontentresultsetstub.cxx b/ucb/source/cacher/cachedcontentresultsetstub.cxx
index b32a8b6..0ccca05 100644
--- a/ucb/source/cacher/cachedcontentresultsetstub.cxx
+++ b/ucb/source/cacher/cachedcontentresultsetstub.cxx
@@ -531,10 +531,8 @@ XTYPEPROVIDER_IMPL_3( CachedContentResultSetStubFactory,
//--------------------------------------------------------------------------
XSERVICEINFO_IMPL_1( CachedContentResultSetStubFactory,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.CachedContentResultSetStubFactory" )),
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- CACHED_CRS_STUB_FACTORY_NAME )) );
+ "com.sun.star.comp.ucb.CachedContentResultSetStubFactory",
+ CACHED_CRS_STUB_FACTORY_NAME );
//--------------------------------------------------------------------------
// Service factory implementation.
diff --git a/ucb/source/cacher/cacheddynamicresultset.cxx b/ucb/source/cacher/cacheddynamicresultset.cxx
index 506c96f..7bc23a7 100644
--- a/ucb/source/cacher/cacheddynamicresultset.cxx
+++ b/ucb/source/cacher/cacheddynamicresultset.cxx
@@ -176,10 +176,8 @@ XTYPEPROVIDER_IMPL_3( CachedDynamicResultSetFactory,
//--------------------------------------------------------------------------
XSERVICEINFO_IMPL_1( CachedDynamicResultSetFactory,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.CachedDynamicResultSetFactory" )),
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- CACHED_DRS_FACTORY_NAME )) );
+ "com.sun.star.comp.ucb.CachedDynamicResultSetFactory",
+ CACHED_DRS_FACTORY_NAME );
//--------------------------------------------------------------------------
// Service factory implementation.
diff --git a/ucb/source/cacher/cacheddynamicresultsetstub.cxx b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
index 4bc1840..4dc9469 100644
--- a/ucb/source/cacher/cacheddynamicresultsetstub.cxx
+++ b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
@@ -166,10 +166,8 @@ XTYPEPROVIDER_IMPL_3( CachedDynamicResultSetStubFactory,
//--------------------------------------------------------------------------
XSERVICEINFO_IMPL_1( CachedDynamicResultSetStubFactory,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.CachedDynamicResultSetStubFactory" )),
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- CACHED_DRS_STUB_FACTORY_NAME )) );
+ "com.sun.star.comp.ucb.CachedDynamicResultSetStubFactory",
+ CACHED_DRS_STUB_FACTORY_NAME );
//--------------------------------------------------------------------------
// Service factory implementation.
diff --git a/ucb/source/core/provprox.cxx b/ucb/source/core/provprox.cxx
index c73fe31..1ba4384 100644
--- a/ucb/source/core/provprox.cxx
+++ b/ucb/source/core/provprox.cxx
@@ -87,10 +87,8 @@ XTYPEPROVIDER_IMPL_3( UcbContentProviderProxyFactory,
//=========================================================================
XSERVICEINFO_IMPL_1( UcbContentProviderProxyFactory,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.UcbContentProviderProxyFactory" )),
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- PROVIDER_FACTORY_SERVICE_NAME )) );
+ "com.sun.star.comp.ucb.UcbContentProviderProxyFactory",
+ PROVIDER_FACTORY_SERVICE_NAME );
//=========================================================================
//
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index cbe7b2b..e65322c 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -347,10 +347,8 @@ void SAL_CALL UniversalContentBroker::removeEventListener(
//=========================================================================
XSERVICEINFO_IMPL_1( UniversalContentBroker,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.UniversalContentBroker" )),
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- UCB_SERVICE_NAME )) );
+ "com.sun.star.comp.ucb.UniversalContentBroker",
+ UCB_SERVICE_NAME );
//=========================================================================
//
diff --git a/ucb/source/core/ucbprops.cxx b/ucb/source/core/ucbprops.cxx
index c778bf9..0f41259 100644
--- a/ucb/source/core/ucbprops.cxx
+++ b/ucb/source/core/ucbprops.cxx
@@ -357,10 +357,8 @@ XTYPEPROVIDER_IMPL_3( UcbPropertiesManager,
//=========================================================================
XSERVICEINFO_IMPL_1( UcbPropertiesManager,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.UcbPropertiesManager" )),
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- PROPERTIES_MANAGER_SERVICE_NAME )) );
+ "com.sun.star.comp.ucb.UcbPropertiesManager",
+ PROPERTIES_MANAGER_SERVICE_NAME );
//=========================================================================
//
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 38b4980..5b7e260 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -244,10 +244,8 @@ XTYPEPROVIDER_IMPL_4( UcbStore,
//=========================================================================
XSERVICEINFO_IMPL_1( UcbStore,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.UcbStore" )),
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- STORE_SERVICE_NAME )) );
+ "com.sun.star.comp.ucb.UcbStore",
+ STORE_SERVICE_NAME );
//=========================================================================
//
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index 1b6c57d..3620688 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -511,10 +511,8 @@ XTYPEPROVIDER_IMPL_3( SortedDynamicResultSetFactory,
//--------------------------------------------------------------------------
XSERVICEINFO_IMPL_1( SortedDynamicResultSetFactory,
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.SortedDynamicResultSetFactory" )),
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- DYNAMIC_RESULTSET_FACTORY_NAME )) );
+ "com.sun.star.comp.ucb.SortedDynamicResultSetFactory",
+ DYNAMIC_RESULTSET_FACTORY_NAME );
//--------------------------------------------------------------------------
// Service factory implementation.
diff --git a/ucb/source/ucp/cmis/cmis_provider.cxx b/ucb/source/ucp/cmis/cmis_provider.cxx
index f733cf0..0e68e04 100644
--- a/ucb/source/ucp/cmis/cmis_provider.cxx
+++ b/ucb/source/ucp/cmis/cmis_provider.cxx
@@ -94,10 +94,8 @@ XTYPEPROVIDER_IMPL_3( ContentProvider,
com::sun::star::ucb::XContentProvider );
XSERVICEINFO_IMPL_1( ContentProvider,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.CmisContentProvider" )),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.ucb.CmisContentProvider" )) );
+ "com.sun.star.comp.CmisContentProvider",
+ "com.sun.star.ucb.CmisContentProvider" );
ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider );
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx
index 02da7ac..67f118f 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -174,11 +174,12 @@ XTYPEPROVIDER_IMPL_6( FTPContent,
#undef XSERVICEINFO_CREATE_INSTANCE_IMPL
#define XSERVICEINFO_CREATE_INSTANCE_IMPL( Class )
+#undef STATICALLY_LINKED_SERVICE
+#define STATICALLY_LINKED_SERVICE( Class, ImplName, Service, Num )
+
XSERVICEINFO_IMPL_1( FTPContent,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.FTPContent")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.ucb.FTPContent")));
+ "com.sun.star.comp.FTPContent",
+ "com.sun.star.ucb.FTPContent" );
diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
index 4275279..5b50a41 100644
--- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx
+++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
@@ -103,8 +103,8 @@ XTYPEPROVIDER_IMPL_3(FTPContentProvider,
XSERVICEINFO_IMPL_1(
FTPContentProvider,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.FTPContentProvider")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(FTP_CONTENT_PROVIDER_SERVICE_NAME)));
+ "com.sun.star.comp.FTPContentProvider",
+ FTP_CONTENT_PROVIDER_SERVICE_NAME);
//=========================================================================
//
diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
index c5bf7c5..f3a339e 100644
--- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
@@ -100,10 +100,8 @@ XTYPEPROVIDER_IMPL_4( HierarchyContentProvider,
//=========================================================================
XSERVICEINFO_IMPL_1( HierarchyContentProvider,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.HierarchyContentProvider" )),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- HIERARCHY_CONTENT_PROVIDER_SERVICE_NAME )) );
+ "com.sun.star.comp.ucb.HierarchyContentProvider",
+ HIERARCHY_CONTENT_PROVIDER_SERVICE_NAME );
//=========================================================================
//
diff --git a/ucb/source/ucp/package/pkgprovider.cxx b/ucb/source/ucp/package/pkgprovider.cxx
index fbaa9fd..d9b6efd 100644
--- a/ucb/source/ucp/package/pkgprovider.cxx
+++ b/ucb/source/ucp/package/pkgprovider.cxx
@@ -181,10 +181,8 @@ XTYPEPROVIDER_IMPL_3( ContentProvider,
//=========================================================================
XSERVICEINFO_IMPL_1( ContentProvider,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.PackageContentProvider" )),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- PACKAGE_CONTENT_PROVIDER_SERVICE_NAME )) );
+ "com.sun.star.comp.ucb.PackageContentProvider",
+ PACKAGE_CONTENT_PROVIDER_SERVICE_NAME );
//=========================================================================
//
diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx
index be5a4f1..fafea33 100644
--- a/ucb/source/ucp/tdoc/tdoc_provider.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx
@@ -105,10 +105,8 @@ XTYPEPROVIDER_IMPL_4( ContentProvider,
XSERVICEINFO_IMPL_1(
ContentProvider,
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.ucb.TransientDocumentsContentProvider" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- TDOC_CONTENT_PROVIDER_SERVICE_NAME ) ) );
+ "com.sun.star.comp.ucb.TransientDocumentsContentProvider",
+ TDOC_CONTENT_PROVIDER_SERVICE_NAME );
//=========================================================================
//
diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx
index ba24d63..8dbca76 100644
--- a/ucb/source/ucp/webdav/webdavprovider.cxx
+++ b/ucb/source/ucp/webdav/webdavprovider.cxx
@@ -93,10 +93,8 @@ XTYPEPROVIDER_IMPL_3( ContentProvider,
//=========================================================================
XSERVICEINFO_IMPL_1( ContentProvider,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.WebDAVContentProvider" )),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- WEBDAV_CONTENT_PROVIDER_SERVICE_NAME )) );
+ "com.sun.star.comp.WebDAVContentProvider",
+ WEBDAV_CONTENT_PROVIDER_SERVICE_NAME );
//=========================================================================
//
diff --git a/ucbhelper/inc/ucbhelper/macros.hxx b/ucbhelper/inc/ucbhelper/macros.hxx
index 302be21..445de8a 100644
--- a/ucbhelper/inc/ucbhelper/macros.hxx
+++ b/ucbhelper/inc/ucbhelper/macros.hxx
@@ -732,19 +732,40 @@ XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
com::sun::star::uno::Sequence< rtl::OUString > \
Class::getSupportedServiceNames_Static()
-// 1 service name
-#define XSERVICEINFO_IMPL_1( Class, ImplName, Service1 ) \
-XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
-XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
+#ifdef DISABLE_DYNLOADING
+
+#define STATICALLY_LINKED_SERVICE( Class, ImplName, Service, Num ) \
+extern com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > service##Num( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rSMgr ) \
+ __asm("SSF:" Service); \
\
-com::sun::star::uno::Sequence< rtl::OUString > \
-Class::getSupportedServiceNames_Static() \
+com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > service##Num( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rSMgr ) \
{ \
- com::sun::star::uno::Sequence< rtl::OUString > aSNS( 1 ); \
- aSNS.getArray()[ 0 ] = Service1; \
- return aSNS; \
+ com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > xFactory( Class::createServiceFactory( rSMgr ) ); \
+ xFactory->acquire(); \
+ return xFactory; \
}
+#else
+
+#define STATICALLY_LINKED_SERVICE( Class, ImplName, Service, Num ) // empty
+
+#endif
+
+// 1 service name
+#define XSERVICEINFO_IMPL_1( Class, ImplName, Service1 ) \
+XSERVICEINFO_COMMOM_IMPL( Class, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ImplName )) ) \
+XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
+ \
+com::sun::star::uno::Sequence< rtl::OUString > \
+Class::getSupportedServiceNames_Static() \
+{ \
+ com::sun::star::uno::Sequence< rtl::OUString > aSNS( 1 ); \
+ aSNS.getArray()[ 0 ] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( Service1 )); \
+ return aSNS; \
+} \
+ \
+STATICALLY_LINKED_SERVICE( Class, ImplName, Service1, 1 )
+
#endif /* !_UCBHELPER_MACROS_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucbhelper/source/client/contentbroker.cxx b/ucbhelper/source/client/contentbroker.cxx
index eb18dc7..0d86547 100644
--- a/ucbhelper/source/client/contentbroker.cxx
+++ b/ucbhelper/source/client/contentbroker.cxx
@@ -34,6 +34,7 @@
*************************************************************************/
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/ucb/XContentIdentifierFactory.hpp>
@@ -42,6 +43,30 @@
#include <com/sun/star/ucb/XCommandProcessor.hpp>
#include <ucbhelper/contentbroker.hxx>
+#ifdef DISABLE_DYNLOADING
+
+#define MSF_CREATEINSTANCE(Msf, Service) \
+({ \
+ extern com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > service( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rSMgr ) __asm("SSF:" Service); \
+ com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > xFactory( service( Msf ) ); \
+ xFactory->createInstance(); \
+})
+
+#define MSF_CREATEINSTANCE_WITHARGUMENTS(Msf, Service, Args) \
+({ \
+ extern com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > service( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rSMgr ) __asm("SSF:" Service); \
+ com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > xFactory( service( Msf ) ); \
+ xFactory->createInstanceWithArguments( Args ); \
+})
+
+#else
+
+#define MSF_CREATEINSTANCE(Msf, Service) Msf->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( Service )) )
+
+#define MSF_CREATEINSTANCE_WITHARGUMENTS(Msf, Service, Args) Msf->createInstanceWithArguments( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( Service )), Args )
+
+#endif
+
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
using namespace com::sun::star::uno;
@@ -248,9 +273,7 @@ bool ContentBroker_Impl::initialize()
{
try
{
- xIfc = m_xSMgr->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.ucb.UniversalContentBroker" )) );
+ xIfc = MSF_CREATEINSTANCE( m_xSMgr, "com.sun.star.ucb.UniversalContentBroker" );
}
catch ( Exception const & )
{
@@ -282,10 +305,7 @@ bool ContentBroker_Impl::initialize()
{
try
{
- xIfc = m_xSMgr->createInstanceWithArguments(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.ucb.UniversalContentBroker" )),
- m_aArguments );
+ xIfc = MSF_CREATEINSTANCE_WITHARGUMENTS( m_xSMgr, "com.sun.star.ucb.UniversalContentBroker", m_aArguments );
}
catch ( Exception const & )
{
commit 9423429a70ecadb09108a0c90db90db68e49c6f6
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Mar 20 10:17:30 2012 +0200
Bin declaration of nonexistent static method
diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx
index 61fdc12..ceff8f3 100644
--- a/ucbhelper/source/client/proxydecider.cxx
+++ b/ucbhelper/source/client/proxydecider.cxx
@@ -150,9 +150,6 @@ public:
const uno::Reference< lang::XMultiServiceFactory >& rxSMgr );
virtual ~InternetProxyDecider_Impl();
- static rtl::Reference< InternetProxyDecider_Impl > createInstance(
- const uno::Reference< lang::XMultiServiceFactory >& rxSMgr );
-
void dispose();
const InternetProxyServer & getProxy( const rtl::OUString & rProtocol,
commit 420e1f27c89ba065b96ee4ca4941408d1854db8e
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Mar 19 19:00:26 2012 +0200
Use -fno-inline in gb_DEBUG_CFLAGS
diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk
index dcab4c2..932f24a 100644
--- a/solenv/gbuild/platform/IOS_ARM_GCC.mk
+++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk
@@ -86,6 +86,8 @@ gb_LinkTarget_LDFLAGS := \
$(subst -L../lib , ,$(SOLARLIB)) \
#man ld says: obsolete -Wl,-multiply_defined,suppress \
+gb_DEBUG_CFLAGS += -fno-inline
+
# ObjCxxObject class
define gb_ObjCxxObject__command
commit 09c72c9e70d849bed13dc0d6187328031b1c9f78
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Mar 19 19:00:01 2012 +0200
gb_COMPILERDEFAULTOPTFLAGS is set in com_GCC_defs.mk
diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk
index d72043b..dcab4c2 100644
--- a/solenv/gbuild/platform/IOS_ARM_GCC.mk
+++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk
@@ -31,8 +31,6 @@ COM := GCC
gb_CPUDEFS := -DARM32
-gb_COMPILERDEFAULTOPTFLAGS := -O2
-
ifeq ($(CC),)
$(error You must set CC in the environment. See README.cross for example.)
endif
commit 29eed849a361d096052d69c4aa0f2a4f20e4f6a8
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Mar 19 18:56:50 2012 +0200
Further hacks: include rdb and component files in .app, pass more -env params
diff --git a/ios/qa/sc/Makefile b/ios/qa/sc/Makefile
index 28b1fde..e8f1901 100644
--- a/ios/qa/sc/Makefile
+++ b/ios/qa/sc/Makefile
@@ -36,7 +36,8 @@ all: $(APPDIR)/$(APP) stuff
$(APPDIR)/$(APP): $(SRCS)
mkdir -p $(APPDIR)
- $(CXX) -o $@ $(CFLAGS) $(gb_OBJCXXFLAGS) $(SRCS) $(LIBS)
+ $(CXX) -Wl,-map,$(APP).map.mangled -o $@ $(CFLAGS) $(gb_OBJCXXFLAGS) $(SRCS) $(LIBS)
+ c++filt <$(APP).map.mangled >$(APP).map && rm $(APP).map.mangled
stuff:
# inifile:
@@ -48,6 +49,16 @@ stuff:
echo 'BRAND_BASE_DIR=$${ORIGIN}'; \
) >$(APPDIR)/fundamentalrc
#
+# .rdb files
+ cp $(OUTDIR)/bin/udkapi.rdb $(OUTDIR)/bin/types.rdb $(OUTDIR)/xml/ure/services.rdb $(APPDIR)
+#
+# a bunch of .component files
+ for F in framework/util/fwk i18npool/util/i18npool sfx2/util/sfx ucb/source/core/ucb1 ucb/source/ucp/file/ucpfile1 unoxml/source/service/unoxml configmgr/source/configmgr basic/util/sb chart2/source/controller/chartcontroller chart2/source/tools/charttools chart2/source/model/chartmodel comphelper/util/comphelp eventattacher/source/evtatt fileaccess/source/fileacc filter/source/config/cache/filterconfig1 oox/util/oox package/source/xstor/xstor package/util/package2 sax/source/expatwrap/expwrap sax/source/fastparser/fastsax sc/util/sc sc/util/scfilt scaddins/source/analysis/analysis scaddins/source/datefunc/date sot/util/sot svl/util/svl toolkit/util/tk ucb/source/ucp/tdoc/ucptdoc1 unotools/util/utl unoxml/source/rdf/unordf; do \
+ mkdir -p $(APPDIR)/ComponentTarget/`dirname $$F`; \
+ cp $(WORKDIR)/ComponentTarget/$$F.component $(APPDIR)/ComponentTarget/$$F.component; \
+ done
+
+#
# .res files
#
# $BRAND_BASE_DIR/program/resource hardcoded in
@@ -55,7 +66,7 @@ stuff:
# that.
mkdir -p $(APPDIR)/program/resource
for F in $(OUTDIR)/bin/*.res; do \
- cp $$F $(APPDIR)/res; \
+ cp $$F $(APPDIR)/program/resource; \
done
clean:
diff --git a/ios/qa/sc/filters-test.m b/ios/qa/sc/filters-test.m
index 8805ed3..c6650ea 100644
--- a/ios/qa/sc/filters-test.m
+++ b/ios/qa/sc/filters-test.m
@@ -61,37 +61,100 @@ main(int argc, char ** argv)
- (BOOL)application: (UIApplication *) application
didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
{
- (void) application;
- (void) launchOptions;
-
- UIWindow *uiw = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
- uiw.backgroundColor = [UIColor redColor];
- self.window = uiw;
- [uiw release];
-
- // See unotest/source/cpp/bootstrapfixturebase.cxx
- const char *app_root = [[[NSBundle mainBundle] bundlePath] UTF8String];
- setenv("SRC_ROOT", app_root, 1);
- setenv("OUTDIR_FOR_BUILD", app_root, 1);
-
- setenv("SAL_LOG", "yes", 1);
-
- CppUnitTestPlugIn *iface = cppunitTestPlugIn();
- iface->initialize(&CppUnit::TestFactoryRegistry::getRegistry(), CppUnit::PlugInParameters());
-
- const char *argv[] = {
- "lo-qa-sc-filters-test",
- "dummy-testlib",
- "--headless",
- "--protector",
- "dummy-libunoexceptionprotector",
- "dummy-unoexceptionprotector"
- };
-
- lo_main(sizeof(argv)/sizeof(*argv), argv);
-
- [self.window makeKeyAndVisible];
- return YES;
+ int i;
+
+ (void) application;
+ (void) launchOptions;
+
+ UIWindow *uiw = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ uiw.backgroundColor = [UIColor redColor];
+ self.window = uiw;
+ [uiw release];
+
+ // See unotest/source/cpp/bootstrapfixturebase.cxx
+ const char *app_root = [[[NSBundle mainBundle] bundlePath] UTF8String];
+ setenv("SRC_ROOT", app_root, 1);
+ setenv("OUTDIR_FOR_BUILD", app_root, 1);
+
+ setenv("SAL_LOG", "yes", 1);
+
+ CppUnitTestPlugIn *iface = cppunitTestPlugIn();
+ iface->initialize(&CppUnit::TestFactoryRegistry::getRegistry(), CppUnit::PlugInParameters());
+
+ const char *argv[] = {
+ "lo-qa-sc-filters-test",
+ "dummy-testlib",
+ "--headless",
+ "--protector",
+ "dummy-libunoexceptionprotector",
+ "dummy-unoexceptionprotector",
+ "placeholder-uno-types",
+ "placeholder-uno-services"
+ };
+
+ NSString *app_root_escaped = [[[NSBundle mainBundle] bundlePath] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
+
+ NSString *uno_types = @"-env:UNO_TYPES=";
+
+ uno_types = [uno_types stringByAppendingString: @"file://"];
+ uno_types = [uno_types stringByAppendingString: [app_root_escaped stringByAppendingPathComponent: @"udkapi.rdb"]];
+
+ uno_types = [uno_types stringByAppendingString: @" "];
+
+ uno_types = [uno_types stringByAppendingString: @"file://"];
+ uno_types = [uno_types stringByAppendingString: [app_root_escaped stringByAppendingPathComponent: @"types.rdb"]];
+
+ argv[6] = [uno_types UTF8String];
+
+ NSString *uno_services = @"-env:UNO_SERVICES=";
+
+ const char *services[] = {
+ "services.rdb",
+ "ComponentTarget/basic/util/sb.component",
+ "ComponentTarget/chart2/source/controller/chartcontroller.component",
+ "ComponentTarget/chart2/source/tools/charttools.component",
+ "ComponentTarget/chart2/source/model/chartmodel.component",
+ "ComponentTarget/comphelper/util/comphelp.component",
+ "ComponentTarget/eventattacher/source/evtatt.component",
+ "ComponentTarget/fileaccess/source/fileacc.component",
+ "ComponentTarget/filter/source/config/cache/filterconfig1.component",
+ "ComponentTarget/oox/util/oox.component",
+ "ComponentTarget/package/source/xstor/xstor.component",
+ "ComponentTarget/package/util/package2.component",
+ "ComponentTarget/sax/source/expatwrap/expwrap.component",
+ "ComponentTarget/sax/source/fastparser/fastsax.component",
+ "ComponentTarget/sc/util/sc.component",
+ "ComponentTarget/sc/util/scfilt.component",
+ "ComponentTarget/scaddins/source/analysis/analysis.component",
+ "ComponentTarget/scaddins/source/datefunc/date.component",
+ "ComponentTarget/sot/util/sot.component",
+ "ComponentTarget/svl/util/svl.component",
+ "ComponentTarget/toolkit/util/tk.component",
+ "ComponentTarget/ucb/source/ucp/tdoc/ucptdoc1.component",
+ "ComponentTarget/unotools/util/utl.component",
+ "ComponentTarget/unoxml/source/rdf/unordf.component",
+ "ComponentTarget/framework/util/fwk.component",
+ "ComponentTarget/i18npool/util/i18npool.component",
+ "ComponentTarget/sfx2/util/sfx.component",
+ "ComponentTarget/unoxml/source/service/unoxml.component",
+ "ComponentTarget/configmgr/source/configmgr.component",
+ "ComponentTarget/ucb/source/core/ucb1.component",
+ "ComponentTarget/ucb/source/ucp/file/ucpfile1.component"
+ };
+
+ for (i = 0; i < sizeof(services)/sizeof(services[0]); i++) {
+ uno_services = [uno_services stringByAppendingString: @"file://"];
+ uno_services = [uno_services stringByAppendingString: [app_root_escaped stringByAppendingPathComponent: [NSString stringWithUTF8String: services[i]]]];
+ if (i < sizeof(services)/sizeof(services[0]) - 1)
+ uno_services = [uno_services stringByAppendingString: @" "];
+ }
+
+ argv[7] = [uno_services UTF8String];
+
+ lo_main(sizeof(argv)/sizeof(*argv), argv);
+
+ [self.window makeKeyAndVisible];
+ return YES;
}
@end
commit 128749140ffc6165f0bbbf34da3b5461c541b32f
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Mar 19 18:43:59 2012 +0200
More hacking on static linking (iOS) support
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index baced8b..0fc5239 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -1061,13 +1061,22 @@ inline void EnvironmentsData::getRegisteredEnvironments(
static bool loadEnv(OUString const & cLibStem,
uno_Environment * pEnv)
{
-#ifdef IOS
+#ifdef DISABLE_DYNLOADING
oslModule hMod;
uno_initEnvironmentFunc fpInit = NULL;
- if (cLibStem.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("gcc3_uno")) )
- fpInit = gcc3_uno_initEnvironment;
- osl_getModuleHandle( NULL, &hMod );
+ if (cLibStem.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME "_uno")) )
+ fpInit = CPPU_ENV_uno_initEnvironment;
+ else
+ {
+#if OSL_DEBUG_LEVEL > 1
+ OSL_TRACE( "%s: Unhandled env: %s", __PRETTY_FUNCTION__, OUStringToOString( cLibStem, RTL_TEXTENCODING_ASCII_US).getStr() );
+#endif
+ return false;
+ }
+ // In the DISABLE_DYNLOADING case the functions that hMod is
+ // passed to below don't do anything with it anyway.
+ hMod = 0;
#else
// late init with some code from matching uno language binding
// will be unloaded by environment
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index 070e2dd..219a4bf 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -330,7 +330,29 @@ static inline void setNegativeBridge( const OUString & rBridgeName )
MutexGuard aGuard( rData.aNegativeLibsMutex );
rData.aNegativeLibs.insert( rBridgeName );
}
-//==================================================================================================
+
+#ifdef DISABLE_DYNLOADING
+
+static uno_ext_getMappingFunc selectMapFunc( const OUString & rBridgeName )
+ SAL_THROW(())
+{
+ if (rBridgeName.equalsAscii( CPPU_CURRENT_LANGUAGE_BINDING_NAME "_uno" ))
+ return CPPU_ENV_uno_ext_getMapping;
+#ifndef IOS
+ // I don't think the affine or log bridges will be needed on iOS,
+ // and DISABLE_DYNLOADING will hardly be used elsewhere, but if
+ // somebody wants to experiment, need to find out then whether
+ // these are needed.
+ if (rBridgeName.equalsAscii( "affine_uno_uno" ))
+ return affine_uno_uno_ext_getMapping;
+ if (rBridgeName.equalsAscii( "log_uno_uno" ))
+ return log_uno_uno_ext_getMapping;
+#endif
+ return 0;
+}
+
+#else
+
static inline oslModule loadModule( const OUString & rBridgeName )
SAL_THROW(())
{
@@ -353,6 +375,9 @@ static inline oslModule loadModule( const OUString & rBridgeName )
}
return 0;
}
+
+#endif
+
//==================================================================================================
static Mapping loadExternalMapping(
const Environment & rFrom, const Environment & rTo, const OUString & rAddPurpose )
@@ -361,6 +386,43 @@ static Mapping loadExternalMapping(
OSL_ASSERT( rFrom.is() && rTo.is() );
if (rFrom.is() && rTo.is())
{
+#ifdef DISABLE_DYNLOADING
+ OUString aName;
+ uno_ext_getMappingFunc fpGetMapFunc = 0;
+
+ if (EnvDcp::getTypeName(rFrom.getTypeName()).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(UNO_LB_UNO) ))
+ {
+ aName = getBridgeName( rTo, rFrom, rAddPurpose );
+ fpGetMapFunc = selectMapFunc( aName );
+ }
+ if (! fpGetMapFunc)
+ {
+ aName = getBridgeName( rFrom, rTo, rAddPurpose );
+ fpGetMapFunc = selectMapFunc( aName );
+ }
+ if (! fpGetMapFunc)
+ {
+ aName = getBridgeName( rTo, rFrom, rAddPurpose );
+ fpGetMapFunc = selectMapFunc( aName );
+ }
+
+ if (! fpGetMapFunc)
+ {
+#if OSL_DEBUG_LEVEL > 1
+ OSL_TRACE( "Could not find mapfunc for %s", OUStringToOString( aName, RTL_TEXTENCODING_ASCII_US ).getStr());
+#endif
+ return Mapping();
+ }
+
+ if (fpGetMapFunc)
+ {
+ Mapping aExt;
+ (*fpGetMapFunc)( (uno_Mapping **)&aExt, rFrom.get(), rTo.get() );
+ OSL_ASSERT( aExt.is() );
+ if (aExt.is())
+ return aExt;
+ }
+#else
// find proper lib
oslModule hModule = 0;
OUString aName;
@@ -393,6 +455,7 @@ static Mapping loadExternalMapping(
::osl_unloadModule( hModule );
setNegativeBridge( aName );
}
+#endif
}
return Mapping();
}
diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index 068a50a..3c1445e 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -127,7 +127,8 @@ namespace
class theAccessDPath : public rtl::Static<buildAccessDPath, theAccessDPath> {};
}
-//------------------------------------------------------------------------------
+#ifndef DISABLE_DYNLOADING
+
static const ::std::vector< OUString > * getAccessDPath() SAL_THROW(())
{
return theAccessDPath::get().getAccessDPath();
@@ -321,6 +322,8 @@ static void getLibEnv(oslModule lib,
}
}
+#endif
+
extern "C" {static void s_getFactory(va_list * pParam)
{
component_getFactoryFunc pSym = va_arg(*pParam, component_getFactoryFunc);
@@ -361,7 +364,21 @@ Reference< XInterface > invokeComponentFactory(
uno::Environment env;
OUString aEnvTypeName;
+#ifdef DISABLE_DYNLOADING
+ (void) lib;
+ (void) rPrefix;
+ // It seems that the only UNO components that have
+ // component_getImplementationEnvironment functions are the JDBC
+ // and ADO (whatever that is) database connectivity thingies
+ // neither of which make sense on iOS (which is the only platform
+ // for which DISABLE_DYNLOADING is intended, really). So we can
+ // simoly bypass the getLibEnv() stuff and don't need to wonder
+ // how to find out what function to call at this point if
+ // statically linked.
+ aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+#else
getLibEnv(lib, &env, &aEnvTypeName, currentEnv, rImplName, rPrefix);
+#endif
OString aImplName(
OUStringToOString( rImplName, RTL_TEXTENCODING_ASCII_US ) );
@@ -439,7 +456,7 @@ Reference< XInterface > invokeComponentFactory(
} // namespace
-#ifdef IOS
+#ifdef DISABLE_DYNLOADING
extern "C"
{
// In stoc/source/bootstrap/services.cxx.
@@ -461,7 +478,7 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory(
OUString const & rPrefix )
SAL_THROW( (loader::CannotActivateFactoryException) )
{
-#ifndef IOS
+#ifndef DISABLE_DYNLOADING
OUString sLibName(rLibName);
#ifdef ANDROID
@@ -506,13 +523,20 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory(
oslGenericFunction pSym = NULL;
-#ifdef IOS
+#ifdef DISABLE_DYNLOADING
if ( rLibName.equals( OUSTR("bootstrap.uno" SAL_DLLEXTENSION)) )
pSym = (oslGenericFunction) bootstrap_component_getFactory;
+ else
+ {
+#if OSL_DEBUG_LEVEL > 1
+ OSL_TRACE( "%s: attempting to load unknown library %s", __PRETTY_FUNCTION__, OUStringToOString( rLibName, RTL_TEXTENCODING_ASCII_US ).getStr() );
#endif
+ }
+#else
if ( pSym == NULL )
pSym = osl_getFunctionSymbol( lib, aGetFactoryName.pData );
+#endif
if (pSym != 0)
{
@@ -573,6 +597,8 @@ Reference< XInterface > SAL_CALL invokeStaticComponentFactory(
return xRet;
}
+#ifndef DISABLE_DYNLOADING
+
//==============================================================================
extern "C" { static void s_writeInfo(va_list * pParam)
{
@@ -697,6 +723,8 @@ void SAL_CALL writeSharedLibComponentInfo(
}
}
+#endif // DISABLE_DYNLOADING
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index 79d64a5..f54123b 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -46,7 +46,6 @@ $(eval $(call gb_Library_add_defs,sal,\
-DFORCE_SYSALLOC \
) \
$(if $(filter $(OS),IOS), \
- -DNO_DL_FUNCTIONS \
-DNO_CHILD_PROCESSES \
) \
$(LFS_CFLAGS) \
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index a34ea61..40ad28c 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -128,7 +128,7 @@ public:
}
bool run() const
{
-#ifdef IOS
+#ifdef DISABLE_DYNLOADING
// For iOS cppunit plugins aren't really "plugins" (shared
// libraries), but just static archives. In the real main
// program of a cppunit app, which calls the lo_main() that
@@ -206,7 +206,7 @@ SAL_IMPLEMENT_MAIN() {
if (rtl_getAppCommandArgCount() - index < 3) {
usageFailure();
}
-#ifndef IOS
+#ifndef DISABLE_DYNLOADING
rtl::OUString lib(getArgument(index + 1));
rtl::OUString sym(getArgument(index + 2));
modules.push_back(new osl::Module(lib, SAL_LOADMODULE_GLOBAL));
diff --git a/sal/inc/cppunittester/protectorfactory.hxx b/sal/inc/cppunittester/protectorfactory.hxx
index a6e1d2e..093eb5f 100644
--- a/sal/inc/cppunittester/protectorfactory.hxx
+++ b/sal/inc/cppunittester/protectorfactory.hxx
@@ -50,7 +50,7 @@ namespace cppunittester
extern "C" typedef LibreOfficeProtector * SAL_CALL ProtectorFactory();
}
-#ifdef IOS
+#ifdef DISABLE_DYNLOADING
extern "C" CppUnit::Protector *unoexceptionprotector();
#endif
diff --git a/sal/osl/unx/module.cxx b/sal/osl/unx/module.cxx
index 419bfc5..e430cd3 100644
--- a/sal/osl/unx/module.cxx
+++ b/sal/osl/unx/module.cxx
@@ -50,8 +50,8 @@ extern "C" int UnicodeToText(char *, size_t, const sal_Unicode *, sal_Int32);
static sal_Bool getModulePathFromAddress(void * address, rtl_String ** path) {
sal_Bool result = sal_False;
-/* Bah, we do want to use dladdr here also on iOS, I think? */
-#if !defined(NO_DL_FUNCTIONS) || defined(IOS)
+ // We do want to have this functionality also in the
+ // DISABLE_DYNLOADING case, I think?
#if defined(AIX)
int size = 4 * 1024;
char *buf, *filename=NULL;
@@ -115,7 +115,6 @@ static sal_Bool getModulePathFromAddress(void * address, rtl_String ** path) {
result = sal_False;
}
#endif
-#endif
return result;
}
@@ -158,7 +157,7 @@ oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nR
"sal.osl", "only either LAZY or NOW");
if (pModuleName)
{
-#ifndef NO_DL_FUNCTIONS
+#ifndef DISABLE_DYNLOADING
#ifdef ANDROID
(void) nRtldMode;
void *pLib = lo_dlopen(pModuleName);
@@ -175,10 +174,10 @@ oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nR
#endif
return ((oslModule)(pLib));
-#else /* NO_DL_FUNCTIONS */
+#else /* DISABLE_DYNLOADING */
(void) nRtldMode;
printf("No DL Functions\n");
-#endif /* NO_DL_FUNCTIONS */
+#endif /* DISABLE_DYNLOADING */
}
return NULL;
}
@@ -220,7 +219,7 @@ oslModule osl_loadModuleRelativeAscii(
sal_Bool SAL_CALL
osl_getModuleHandle(rtl_uString *, oslModule *pResult)
{
-#if !defined(NO_DL_FUNCTIONS) || defined(IOS)
+#if !defined(DISABLE_DYNLOADING) || defined(IOS)
*pResult = (oslModule) RTLD_DEFAULT;
#else
*pResult = NULL;
@@ -235,7 +234,7 @@ void SAL_CALL osl_unloadModule(oslModule hModule)
{
if (hModule)
{
-#ifndef NO_DL_FUNCTIONS
+#ifndef DISABLE_DYNLOADING
#ifdef ANDROID
int nRet = lo_dlclose(hModule);
#else
@@ -243,7 +242,7 @@ void SAL_CALL osl_unloadModule(oslModule hModule)
#endif
SAL_INFO_IF(
nRet != 0, "sal.osl", "dlclose(" << hModule << "): " << dlerror());
-#endif /* ifndef NO_DL_FUNCTIONS */
+#endif /* ifndef DISABLE_DYNLOADING */
}
}
@@ -265,8 +264,8 @@ osl_getAsciiFunctionSymbol(oslModule Module, const sal_Char *pSymbol)
{
void *fcnAddr = NULL;
-/* We do want to use dlsym on iOS */
-#if !defined(NO_DL_FUNCTIONS) || defined(IOS)
+ // We do want to use dlsym() also in the DISABLE_DYNLOADING case
+ // just to look up symbols in the static executable, I think.
if (pSymbol)
{
fcnAddr = dlsym(Module, pSymbol);
@@ -274,7 +273,6 @@ osl_getAsciiFunctionSymbol(oslModule Module, const sal_Char *pSymbol)
fcnAddr == 0, "sal.osl",
"dlsym(" << Module << ", " << pSymbol << "): " << dlerror());
}
-#endif
return (oslGenericFunction) fcnAddr;
}
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx
index 94128a2..3c1831d 100644
--- a/sal/osl/unx/process_impl.cxx
+++ b/sal/osl/unx/process_impl.cxx
@@ -119,7 +119,7 @@ oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl (
return (result);
}
-#elif !defined(NO_DL_FUNCTIONS)
+#else
#include <dlfcn.h>
oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl (
@@ -169,17 +169,7 @@ oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl (
return (result);
}
-#else /* NO_DL_FUNCTIONS */
-
-oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl (
- rtl_uString ** ppFileURL
-) SAL_THROW_EXTERN_C()
-{
- /* Fallback to ordinary osl_getExecutableFile(). */
- return osl_getExecutableFile (ppFileURL);
-}
-
-#endif /* NO_DL_FUNCTIONS */
+#endif
/***************************************
CommandArgs_Impl.
diff --git a/sal/rtl/source/unload.cxx b/sal/rtl/source/unload.cxx
index 76d035e..9d30bb3 100644
--- a/sal/rtl/source/unload.cxx
+++ b/sal/rtl/source/unload.cxx
@@ -42,6 +42,8 @@ using osl::MutexGuard;
//----------------------------------------------------------------------------
+#ifndef DISABLE_DYNLOADING
+
static void rtl_notifyUnloadingListeners();
static sal_Bool isEqualTimeValue ( const TimeValue* time1, const TimeValue* time2)
@@ -118,14 +120,23 @@ static osl::Mutex& getUnloadingMutex()
return theUnloadingMutex::get();
}
+#endif
+
extern "C" void rtl_moduleCount_acquire(rtl_ModuleCount * that )
{
+#ifdef DISABLE_DYNLOADING
+ (void) that;
+#else
rtl_StandardModuleCount* pMod= (rtl_StandardModuleCount*)that;
osl_incrementInterlockedCount( &pMod->counter);
+#endif
}
extern "C" void rtl_moduleCount_release( rtl_ModuleCount * that )
{
+#ifdef DISABLE_DYNLOADING
+ (void) that;
+#else
rtl_StandardModuleCount* pMod= (rtl_StandardModuleCount*)that;
OSL_ENSURE( pMod->counter >0 , "library counter incorrect" );
osl_decrementInterlockedCount( &pMod->counter);
@@ -140,8 +151,10 @@ extern "C" void rtl_moduleCount_release( rtl_ModuleCount * that )
pMod->unusedSince.Nanosec= 0;
}
}
+#endif
}
+#ifndef DISABLE_DYNLOADING
struct hashModule
{
@@ -176,8 +189,15 @@ static ModuleMap& getModuleMap()
return *g_pMap;
}
+#endif
+
extern "C" sal_Bool rtl_moduleCount_canUnload( rtl_StandardModuleCount * that, TimeValue * libUnused)
{
+#ifdef DISABLE_DYNLOADING
+ (void) that;
+ (void) libUnused;
+ return sal_False;
+#else
if (that->counter == 0)
{
MutexGuard guard( getUnloadingMutex());
@@ -187,11 +207,16 @@ extern "C" sal_Bool rtl_moduleCount_canUnload( rtl_StandardModuleCount * that, T
}
}
return (that->counter == 0);
+#endif
}
extern "C" sal_Bool SAL_CALL rtl_registerModuleForUnloading( oslModule module)
{
+#ifdef DISABLE_DYNLOADING
+ (void) module;
+ return sal_False;
+#else
MutexGuard guard( getUnloadingMutex());
ModuleMap& moduleMap= getModuleMap();
sal_Bool ret= sal_True;
@@ -219,10 +244,14 @@ extern "C" sal_Bool SAL_CALL rtl_registerModuleForUnloading( oslModule module)
ret= sal_False;
}
return ret;
+#endif
}
extern "C" void SAL_CALL rtl_unregisterModuleForUnloading( oslModule module)
{
+#ifdef DISABLE_DYNLOADING
+ (void) module;
+#else
MutexGuard guard( getUnloadingMutex());
ModuleMap& moduleMap= getModuleMap();
@@ -236,10 +265,14 @@ extern "C" void SAL_CALL rtl_unregisterModuleForUnloading( oslModule module)
if( it->second.first == 0)
moduleMap.erase( it);
}
+#endif
}
extern "C" void SAL_CALL rtl_unloadUnusedModules( TimeValue* libUnused)
{
+#ifdef DISABLE_DYNLOADING
+ (void) libUnused;
+#else
MutexGuard guard( getUnloadingMutex());
typedef std::list< oslModule, rtl::Allocator<oslModule> > list_type;
@@ -286,8 +319,10 @@ extern "C" void SAL_CALL rtl_unloadUnusedModules( TimeValue* libUnused)
{
moduleMap.erase( *un_it);
}
+#endif
}
+#ifndef DISABLE_DYNLOADING
// ==============================================================================
// Unloading Listener Administration
@@ -374,32 +409,45 @@ static inline void recycleCookie( sal_Int32 i)
}
+#endif
+
// calling the function twice with the same arguments will return tow different cookies.
// The listener will then notified twice.
extern "C"
sal_Int32 SAL_CALL rtl_addUnloadingListener( rtl_unloadingListenerFunc callback, void* _this)
{
+#ifdef DISABLE_DYNLOADING
+ (void) callback;
+ (void) _this;
+ return 0;
+#else
MutexGuard guard( getUnloadingMutex());
sal_Int32 cookie= getCookie();
ListenerMap& listenerMap= getListenerMap();
listenerMap[ cookie]= std::make_pair( callback, _this);
return cookie;
+#endif
}
extern "C"
void SAL_CALL rtl_removeUnloadingListener( sal_Int32 cookie )
{
+#ifdef DISABLE_DYNLOADING
+ (void) cookie;
+#else
MutexGuard guard( getUnloadingMutex());
ListenerMap& listenerMap= getListenerMap();
size_t removedElements= listenerMap.erase( cookie);
if( removedElements )
recycleCookie( cookie);
+#endif
}
+#ifndef DISABLE_DYNLOADING
static void rtl_notifyUnloadingListeners()
{
@@ -411,4 +459,6 @@ static void rtl_notifyUnloadingListeners()
}
}
+#endif
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/textenc/textenc.cxx b/sal/textenc/textenc.cxx
index 42f1711..8aeb67a 100644
--- a/sal/textenc/textenc.cxx
+++ b/sal/textenc/textenc.cxx
@@ -364,7 +364,7 @@ static ImplTextEncodingData const aImplJavaUtf8TextEncodingData
namespace {
-#if defined IOS || defined ANDROID
+#if defined DISABLE_DYNLOADING || defined ANDROID
extern "C" ImplTextEncodingData const * sal_getFullTextEncodingData(
rtl_TextEncoding); // from tables.cxx in sal_textenc library
diff --git a/stoc/source/bootstrap/services.cxx b/stoc/source/bootstrap/services.cxx
index e92acad..5ddc729 100644
--- a/stoc/source/bootstrap/services.cxx
+++ b/stoc/source/bootstrap/services.cxx
@@ -118,14 +118,14 @@ static struct ImplementationEntry g_entries[] =
extern "C"
{
-#ifndef IOS
+#ifndef DISABLE_DYNLOADING
SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
{
return g_moduleCount.canUnload( &g_moduleCount , pTime );
}
#endif
-#ifdef IOS
+#ifdef DISABLE_DYNLOADING
#define component_getFactory bootstrap_component_getFactory
#endif
diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx
index cd690a2..b232726 100644
--- a/stoc/source/loader/dllcomponentloader.cxx
+++ b/stoc/source/loader/dllcomponentloader.cxx
@@ -229,9 +229,16 @@ sal_Bool SAL_CALL DllComponentLoader::writeRegistryInfo(
throw(CannotRegisterImplementationException, RuntimeException)
{
+#ifdef DISABLE_DYNLOADING
+ (void) xKey;
+ (void) rLibName;
+ OSL_FAIL( "DllComponentLoader::writeRegistryInfo() should not be called I think?" );
+ return sal_False;
+#else
writeSharedLibComponentInfo(
expand_url( rLibName ), OUString(), m_xSMgr, xKey );
return sal_True;
+#endif
}
}
commit c0ab229dc74e116760866f27b5df12e76430aef5
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Mar 19 18:28:42 2012 +0200
Uniquify uno_initEnvironment and uno_ext_getMapping in the static linking case
diff --git a/bridges/source/cpp_uno/shared/component.cxx b/bridges/source/cpp_uno/shared/component.cxx
index 6f6bf25..3904a1d 100644
--- a/bridges/source/cpp_uno/shared/component.cxx
+++ b/bridges/source/cpp_uno/shared/component.cxx
@@ -196,7 +196,7 @@ static void SAL_CALL environmentDisposing(
&bridges::cpp_uno::shared::g_moduleCount.modCnt );
}
-#ifndef IOS
+#ifndef DISABLE_DYNLOADING
SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_canUnload(TimeValue * pTime) SAL_THROW_EXTERN_C() {
return bridges::cpp_uno::shared::g_moduleCount.canUnload(
@@ -205,8 +205,8 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_canUnload(TimeValue * pTime) SA
#endif
-#ifdef IOS
-#define uno_initEnvironment gcc3_uno_initEnvironment
+#ifdef DISABLE_DYNLOADING
+#define uno_initEnvironment CPPU_ENV_uno_initEnvironment
#endif
void SAL_CALL uno_initEnvironment(uno_Environment * pCppEnv)
@@ -227,6 +227,10 @@ void SAL_CALL uno_initEnvironment(uno_Environment * pCppEnv)
pCppEnv->environmentDisposing = environmentDisposing;
}
+#ifdef DISABLE_DYNLOADING
+#define uno_ext_getMapping CPPU_ENV_uno_ext_getMapping
+#endif
+
void SAL_CALL uno_ext_getMapping(
uno_Mapping ** ppMapping, uno_Environment * pFrom, uno_Environment * pTo)
SAL_THROW_EXTERN_C()
diff --git a/cppu/inc/uno/environment.h b/cppu/inc/uno/environment.h
index 5c3a7c1..018b035 100644
--- a/cppu/inc/uno/environment.h
+++ b/cppu/inc/uno/environment.h
@@ -266,6 +266,12 @@ typedef struct _uno_ExtEnvironment
typedef void (SAL_CALL * uno_initEnvironmentFunc)( uno_Environment * pEnv );
#define UNO_INIT_ENVIRONMENT "uno_initEnvironment"
+#ifdef DISABLE_DYNLOADING
+/* We link statically and have just one kind of environment */
+void SAL_CALL CPPU_ENV_uno_initEnvironment( uno_Environment * Env )
+ SAL_THROW_EXTERN_C();
+#endif
+
/** Gets a specific environment. If the specified environment does not exist, then a default one
is created and registered. The environment revokes itself on last release() call.
@@ -375,12 +381,6 @@ CPPU_DLLPUBLIC void SAL_CALL uno_Environment_enter(uno_Environment * pEnv)
CPPU_DLLPUBLIC int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pReason)
SAL_THROW_EXTERN_C();
-#ifdef IOS
-/* We link statically on iOS and have just one kind of environment */
-void SAL_CALL gcc3_uno_initEnvironment(uno_Environment *pCppEnv)
- SAL_THROW_EXTERN_C();
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/cppu/inc/uno/mapping.h b/cppu/inc/uno/mapping.h
index 65fb206..df1379c 100644
--- a/cppu/inc/uno/mapping.h
+++ b/cppu/inc/uno/mapping.h
@@ -195,6 +195,15 @@ typedef void (SAL_CALL * uno_ext_getMappingFunc)(
struct _uno_Environment * pFrom,
struct _uno_Environment * pTo );
+#ifdef DISABLE_DYNLOADING
+/* Static linking, this is the uno_ext_getMapping function in the C++/UNO bridge */
+void SAL_CALL CPPU_ENV_uno_ext_getMapping(
+ struct _uno_Mapping ** ppMapping,
+ struct _uno_Environment * pFrom,
+ struct _uno_Environment * pTo )
+ SAL_THROW_EXTERN_C();
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/cppu/source/AffineBridge/AffineBridge.cxx b/cppu/source/AffineBridge/AffineBridge.cxx
index e5be92b..b09fcac 100644
--- a/cppu/source/AffineBridge/AffineBridge.cxx
+++ b/cppu/source/AffineBridge/AffineBridge.cxx
@@ -348,6 +348,13 @@ int AffineBridge::v_isValid(rtl::OUString * pReason)
return result;
}
+#ifdef DISABLE_DYNLOADING
+
+#define uno_initEnvironment affine_uno_uno_initEnvironment
+#define uno_ext_getMapping affine_uno_uno_ext_getMapping
+
+#endif
+
extern "C" void SAL_DLLPUBLIC_EXPORT SAL_CALL uno_initEnvironment(uno_Environment * pEnv)
SAL_THROW_EXTERN_C()
{
diff --git a/cppu/source/LogBridge/LogBridge.cxx b/cppu/source/LogBridge/LogBridge.cxx
index 0451f94..877d8e5 100644
--- a/cppu/source/LogBridge/LogBridge.cxx
+++ b/cppu/source/LogBridge/LogBridge.cxx
@@ -262,6 +262,13 @@ void LogProbe(
}
}
+#ifdef DISABLE_DYNLOADING
+
+#define uno_initEnvironment log_uno_uno_initEnvironment
+#define uno_ext_getMapping log_uno_uno_ext_getMapping
+
+#endif
+
extern "C" void SAL_DLLPUBLIC_EXPORT SAL_CALL uno_initEnvironment(uno_Environment * pEnv)
SAL_THROW_EXTERN_C()
{
commit c3f36b0e4738f44375359789d450a28e7664d529
Author: Tor Lillqvist <tml at iki.fi>
Date: Fri Mar 16 13:39:01 2012 +0200
Add separate switch for disabling of dynamic loading (iOS) for orthogonality
diff --git a/config_host.mk.in b/config_host.mk.in
index 828fd82..a018a1b 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -80,6 +80,7 @@ export DIRECTXSDK_LIB=@DIRECTXSDK_LIB@
export DISABLE_ACTIVEX=@DISABLE_ACTIVEX@
export DISABLE_ATL=@DISABLE_ATL@
export DISABLE_DBCONNECTIVITY=@DISABLE_DBCONNECTIVITY@
+export DISABLE_DYNLOADING=@DISABLE_DYNLOADING@
export DISABLE_EXTENSIONS=@DISABLE_EXTENSIONS@
export DISABLE_SCRIPTING=@DISABLE_SCRIPTING@
export DISABLE_LINKOO=@DISABLE_LINKOO@
diff --git a/configure.in b/configure.in
index 70d7b7f..0c5093e 100644
--- a/configure.in
+++ b/configure.in
@@ -408,6 +408,13 @@ AC_ARG_ENABLE(scripting,
[Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
)
+# This is mainly for iOS, but could potentially be used in some
+# special case otherwise, too, so factored out as a separate setting
+AC_ARG_ENABLE(dynamic-loading,
+ AS_HELP_STRING([--disable-dynamic-loading],
+ [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
+)
+
AC_ARG_ENABLE(ext-diagram,
AS_HELP_STRING([--enable-ext-diagram],
[Enable the SmART Gallery (Diagram) extension.])
@@ -2093,6 +2100,23 @@ else
fi
AC_SUBST(DISABLE_SCRIPTING)
+if test $_os = iOS; then
+ # Disable dynamic_loading always for iOS
+ enable_dynamic_loading=no
+elif test -z "$enable_dynamic_loading"; then
+ # Otherwise enable it unless speficically disabled
+ enable_dynamic_loading=yes
+fi
+
+DISABLE_DYNLOADING=''
+if test "$enable_dynamic_loading" = yes; then
+ BUILD_TYPE="$BUILD_TYPE DYNLOADING"
+else
+ DISABLE_DYNLOADING='TRUE'
+ SCPDEFS="$SCPDEFS -DDISABLE_DYNLOADING"
+fi
+AC_SUBST(DISABLE_DYNLOADING)
+
dnl ===================================================================
dnl Extra check for Windows. Cygwin builds need gcc to build dmake
dnl although MSVC is used to build other build-time tools and
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 2aafa6b..119f6e5 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -244,6 +244,10 @@ ifeq ($(strip $(DISABLE_SCRIPTING)),TRUE)
gb_GLOBALDEFS += -DDISABLE_SCRIPTING
endif
+ifeq ($(strip $(DISABLE_DYNLOADING)),TRUE)
+gb_GLOBALDEFS += -DDISABLE_DYNLOADING
+endif
+
ifeq ($(HAVE_THREADSAFE_STATICS),TRUE)
gb_GLOBALDEFS += -DHAVE_THREADSAFE_STATICS
endif
diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk
index ac635f8..31b0174 100644
--- a/solenv/inc/settings.mk
+++ b/solenv/inc/settings.mk
@@ -1125,6 +1125,10 @@ CDEFS+=-DGSTREAMER
CDEFS += -DHAVE_THREADSAFE_STATICS
.END
+.IF "$(DISABLE_DYNLOADING)" == "TRUE"
+CDEFS += -DDISABLE_DYNLOADING
+.ENDIF
+
# compose flags and defines for GUI
.IF "$(TARGETTYPE)"=="GUI"
CFLAGSSLO+=$(CFLAGSSLOGUIMT)
commit 4066e061b4cc917abf086a04e14fe285c09ab1e2
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Mar 13 22:52:56 2012 +0200
Need the weird vnd.sun.star.pathname: prefix
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx
index 5e52924..dc8d02d 100644
--- a/sal/rtl/source/bootstrap.cxx
+++ b/sal/rtl/source/bootstrap.cxx
@@ -401,7 +401,7 @@ Bootstrap_Impl * BootstrapMap::getBaseIni() {
// directory. Apps are self-contained anyway, there is no
// possibility to have several "applications" in the same
// installation location with different inifiles.
- const char *inifile = [[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent: @"rc"] UTF8String];
+ const char *inifile = [[@"vnd.sun.star.pathname:" stringByAppendingString: [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent: @"rc"]] UTF8String];
uri = rtl::OUString(inifile, strlen(inifile), RTL_TEXTENCODING_UTF8);
resolvePathnameUrl(&uri);
#else
commit a8f19ca300794c7d270871f947838ea524bff8ed
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Mar 13 22:48:47 2012 +0200
Use MAX_ALIGNMENT_4 also for iOS
diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx
index 1336a9b..cdedb1e 100644
--- a/cppu/source/uno/data.cxx
+++ b/cppu/source/uno/data.cxx
@@ -356,10 +356,13 @@ CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_isAssignableFromData(
#pragma pack(push, 8)
#endif
-#if defined(INTEL) \
- && (defined(__GNUC__) && (defined(LINUX) || defined(FREEBSD) \
- || defined(NETBSD) || defined(OPENBSD)) || defined(MACOSX) || defined(DRAGONFLY) \
- || defined(__SUNPRO_CC) && defined(SOLARIS))
+// Why hardcode like this instead of using the (generated)
+// <sal/typesizes.h> ?
+
+#if (defined(INTEL) \
+ && (defined(__GNUC__) && (defined(LINUX) || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD)) \
+ || defined(MACOSX) || defined(DRAGONFLY) || (defined(__SUNPRO_CC) && defined(SOLARIS)))) \
+ || defined(IOS)
#define MAX_ALIGNMENT_4
#endif
commit 77017cb9036902012e7228755896a200b5baf372
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Mar 13 22:47:40 2012 +0200
Try setting up some rc files
diff --git a/ios/qa/sc/Makefile b/ios/qa/sc/Makefile
index 1cbbb01..28b1fde 100644
--- a/ios/qa/sc/Makefile
+++ b/ios/qa/sc/Makefile
@@ -32,11 +32,31 @@ CFLAGS = $(SOLARINC)
LIBS = -Wl,$(OUTDIR)/bin/cppunit/cppunittester.a -Wl,$(WORKDIR)/LinkTarget/CppunitTest/libtest_sc_filters_test.a -Wl,$(OUTDIR)/lib/bootstrap.uno.a -Wl,$(OUTDIR)/lib/unoexceptionprotector.a $(SOLARLIB) -lavmedialo -lbasegfxlo -lcanvastoolslo -lcomphelpgcc3 -lcppcanvaslo -lcppunit -ldrawinglayerlo -leditenglo -lforlo -lforuilo -lfwelo -lfwilo -lfwklo -lgcc3_uno -li18nisolang1gcc3 -li18npaperlo -li18nutilgcc3 -licuuc -ljpeg -ljvmfwk -llnglo -lreg -lsal_textenc -lsalcpprt -lsaxlo -lsclo -lsfxlo -lstore -lsvllo -lsvtlo -lsvxlo -lsvxcorelo -lsotlo -ltest -ltklo -ltllo -lucbhelper4gcc3 -luno_cppuhelpergcc3 -luno_cppu -luno_sal -luno_salhelpergcc3 -lunotest -lutllo -lvcllo -lxml2 -lxmlreader -lxolo -lz $(addprefix -framework , $(gb_Library__FRAMEWORKS)) -liconv -lobjc
-all: $(APPDIR)/$(APP)
+all: $(APPDIR)/$(APP) stuff
$(APPDIR)/$(APP): $(SRCS)
mkdir -p $(APPDIR)
$(CXX) -o $@ $(CFLAGS) $(gb_OBJCXXFLAGS) $(SRCS) $(LIBS)
+stuff:
+# inifile:
+ echo 'URE_BOOTSTRAP=$${ORIGIN}/fundamentalrc' >$(APPDIR)/rc
+#
+# URE_BOOTSTRAP file, fundamentalrc:
+ ( \
+ echo '[Bootstrap]'; \
+ echo 'BRAND_BASE_DIR=$${ORIGIN}'; \
+ ) >$(APPDIR)/fundamentalrc
+#
+# .res files
+#
+# $BRAND_BASE_DIR/program/resource hardcoded in
+# ResMgrContainer::init() in tools/source/rc/resmgr.cxx, so let's use
+# that.
+ mkdir -p $(APPDIR)/program/resource
+ for F in $(OUTDIR)/bin/*.res; do \
+ cp $$F $(APPDIR)/res; \
+ done
+
clean:
rm -rf $(APPDIR)
commit 3c5fa6f532e222dbda9accc2a0bca787cd8351b9
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Mar 13 18:54:55 2012 +0200
Simply hardcode the inifile as "rc" in the app bundle directory on iOS
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index f573bfa..79d64a5 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -132,6 +132,12 @@ $(eval $(call gb_Library_add_cobjects,sal,\
sal/osl/all/filepath \
))
+ifeq ($(OS),IOS)
+$(eval $(call gb_Library_add_cxxflags,sal,\
+ $(gb_OBJCXXFLAGS) \
+))
+endif
+
ifeq ($(OS),ANDROID)
$(eval $(call gb_Library_add_exception_objects,sal,\
sal/textenc/context \
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx
index 8183497..5e52924 100644
--- a/sal/rtl/source/bootstrap.cxx
+++ b/sal/rtl/source/bootstrap.cxx
@@ -54,6 +54,12 @@
#include <memory>
#include <utility>
+#ifdef IOS
+#include <premac.h>
+#import <Foundation/Foundation.h>
+#include <postmac.h>
+#endif
+
#define MY_STRING_(x) # x
#define MY_STRING(x) MY_STRING_(x)
@@ -390,6 +396,15 @@ Bootstrap_Impl * BootstrapMap::getBaseIni() {
if (baseIni_ == 0) {
rtl::OUString uri;
if (baseIniUri_.isEmpty()) {
+#ifdef IOS
+ // On iOS hardcode the inifile as "rc" in the .app
+ // directory. Apps are self-contained anyway, there is no
+ // possibility to have several "applications" in the same
+ // installation location with different inifiles.
+ const char *inifile = [[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent: @"rc"] UTF8String];
+ uri = rtl::OUString(inifile, strlen(inifile), RTL_TEXTENCODING_UTF8);
+ resolvePathnameUrl(&uri);
+#else
if (CommandLineParameters::get().get(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INIFILENAME")),
&uri))
@@ -416,6 +431,7 @@ Bootstrap_Impl * BootstrapMap::getBaseIni() {
uri += rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(SAL_CONFIGFILE("")));
}
+#endif
} else {
uri = baseIniUri_;
}
commit 0fbceef557bd17b99ec7bb5bb758098e9c0e0e1e
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Mar 13 17:40:53 2012 +0200
Clean up OSL_TRACE output a little bit
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx
index 1fe2199..8183497 100644
--- a/sal/rtl/source/bootstrap.cxx
+++ b/sal/rtl/source/bootstrap.cxx
@@ -271,7 +271,7 @@ Bootstrap_Impl::Bootstrap_Impl( OUString const & rIniName )
{
#if OSL_DEBUG_LEVEL > 1
OString sFile = OUStringToOString(_iniName, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE(__FILE__" -- Bootstrap_Impl() - %s\n", sFile.getStr());
+ OSL_TRACE("Bootstrap_Impl(): sFile=%s", sFile.getStr());
#endif /* OSL_DEBUG_LEVEL > 1 */
oslFileHandle handle;
@@ -295,7 +295,7 @@ Bootstrap_Impl::Bootstrap_Impl( OUString const & rIniName )
OString name_tmp = OUStringToOString(sName, RTL_TEXTENCODING_ASCII_US);
OString value_tmp = OUStringToOString(sValue, RTL_TEXTENCODING_UTF8);
OSL_TRACE(
- __FILE__" -- pushing: name=%s value=%s\n",
+ "pushing: name=%s value=%s",
name_tmp.getStr(), value_tmp.getStr() );
#endif /* OSL_DEBUG_LEVEL > 1 */
@@ -308,7 +308,7 @@ Bootstrap_Impl::Bootstrap_Impl( OUString const & rIniName )
else
{
OString file_tmp = OUStringToOString(_iniName, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE( __FILE__" -- couldn't open file: %s", file_tmp.getStr() );
+ OSL_TRACE( "couldn't open file: %s", file_tmp.getStr() );
}
#endif /* OSL_DEBUG_LEVEL > 1 */
}
More information about the Libreoffice-commits
mailing list