[Libreoffice-commits] .: 4 commits - cppuhelper/source javaunohelper/source stoc/source ure/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Wed Aug 8 09:38:01 PDT 2012


 cppuhelper/source/defaultbootstrap.cxx |   31 +++++++++------
 javaunohelper/source/bootstrap.cxx     |    2 -
 javaunohelper/source/javaunohelper.cxx |    6 +--
 javaunohelper/source/javaunohelper.map |   26 -------------
 javaunohelper/source/preload.cxx       |    8 ++--
 stoc/source/javaloader/javaloader.cxx  |    3 +
 ure/source/uretest/Makefile            |   15 +++----
 ure/source/uretest/Makefile.pln        |   65 +++++++++++++++------------------
 ure/source/uretest/cppmain.cc          |   11 ++---
 ure/source/uretest/cppserver.cc        |    2 -
 ure/source/uretest/cpptest.cc          |    2 -
 ure/source/uretest/version.map         |   31 ---------------
 12 files changed, 72 insertions(+), 130 deletions(-)

New commits:
commit 9fc870fc33c2872aa93477523da4a54c841cf9b5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Aug 8 18:27:11 2012 +0200

    ServiceManager::createInstanceWithContext needs to honor given Context
    
    ...in loadImplementation (instead of using the context the ServiceManager itself
    was created with).  Otherwise, the handcrafted context containing a fake
    theJavaVirtualMachine singleton in install_vm_singleton
    (javaunohelper/source/vm.cxx) would not be honored, so that if a Java process
    bootstraps native (binary) UNO and from there tries to obtain that singleton, it
    would erroneously try to instantiate another JVM instead of using the existing
    one.  This was a regression introduced with the new ServiceManager and could be
    witnessed by test-javanative in ure/source/uretest/Makefile failing.
    
    Change-Id: I58cfbc8cdaea7ee4ab80fac728ea3e85676d69e1

diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx
index 078ee29..151a36e 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -611,6 +611,7 @@ public:
     Data const & getData() const { return data_; }
 
     void loadImplementation(
+        css::uno::Reference< css::uno::XComponentContext > const & context,
         boost::shared_ptr< ImplementationInfo > const & info,
         css::uno::Reference< css::lang::XSingleComponentFactory > * factory1,
         css::uno::Reference< css::lang::XSingleServiceFactory > * factory2);
@@ -784,6 +785,7 @@ private:
     void removeImplementation(rtl::OUString name);
 
     boost::shared_ptr< Implementation > findServiceImplementation(
+        css::uno::Reference< css::uno::XComponentContext > const & context,
         rtl::OUString const & specifier);
 
     css::uno::Reference< css::uno::XComponentContext > context_;
@@ -834,7 +836,8 @@ private:
     virtual css::uno::Sequence< rtl::OUString > SAL_CALL
     getSupportedServiceNames() throw (css::uno::RuntimeException);
 
-    void loadImplementation();
+    void loadImplementation(
+        css::uno::Reference< css::uno::XComponentContext > const & context);
 
     rtl::Reference< ServiceManager > manager_;
     boost::shared_ptr< ImplementationInfo > info_;
@@ -846,6 +849,7 @@ private:
 };
 
 void ServiceManager::loadImplementation(
+        css::uno::Reference< css::uno::XComponentContext > const & context,
         boost::shared_ptr< ImplementationInfo > const & info,
         css::uno::Reference< css::lang::XSingleComponentFactory > * factory1,
         css::uno::Reference< css::lang::XSingleServiceFactory > * factory2)
@@ -887,8 +891,8 @@ void ServiceManager::loadImplementation(
             smgr = css::uno::Reference< css::lang::XMultiComponentFactory >(
                 ctxt->getServiceManager(), css::uno::UNO_SET_THROW);
         } else {
-            assert(context_.is());
-            ctxt = context_;
+            assert(context.is());
+            ctxt = context;
             smgr = this;
         }
         css::uno::Reference< css::loader::XImplementationLoader > loader(
@@ -982,7 +986,7 @@ ServiceManager::createInstanceWithContext(
     throw (css::uno::Exception, css::uno::RuntimeException)
 {
     boost::shared_ptr< Implementation > impl(
-        findServiceImplementation(aServiceSpecifier));
+        findServiceImplementation(Context, aServiceSpecifier));
     if (impl.get() == 0) {
         return css::uno::Reference< css::uno::XInterface >();
     }
@@ -1005,7 +1009,7 @@ ServiceManager::createInstanceWithArgumentsAndContext(
     throw (css::uno::Exception, css::uno::RuntimeException)
 {
     boost::shared_ptr< Implementation > impl(
-        findServiceImplementation(ServiceSpecifier));
+        findServiceImplementation(Context, ServiceSpecifier));
     if (impl.get() == 0) {
         return css::uno::Reference< css::uno::XInterface >();
     }
@@ -1819,6 +1823,7 @@ void ServiceManager::removeImplementation(rtl::OUString name) {
 }
 
 boost::shared_ptr< Implementation > ServiceManager::findServiceImplementation(
+    css::uno::Reference< css::uno::XComponentContext > const & context,
     rtl::OUString const & specifier)
 {
     boost::shared_ptr< Implementation > impl;
@@ -1851,7 +1856,7 @@ boost::shared_ptr< Implementation > ServiceManager::findServiceImplementation(
     if (!loaded) {
         css::uno::Reference< css::lang::XSingleComponentFactory > f1;
         css::uno::Reference< css::lang::XSingleServiceFactory > f2;
-        loadImplementation(impl->info, &f1, &f2);
+        loadImplementation(context, impl->info, &f1, &f2);
         osl::MutexGuard g(rBHelper.rMutex);
         if (!(isDisposed() || impl->loaded)) {
             impl->loaded = true;
@@ -1867,7 +1872,7 @@ FactoryWrapper::createInstanceWithContext(
     css::uno::Reference< css::uno::XComponentContext > const & Context)
     throw (css::uno::Exception, css::uno::RuntimeException)
 {
-    loadImplementation();
+    loadImplementation(Context);
     return factory1_.is()
         ? factory1_->createInstanceWithContext(Context)
         : factory2_->createInstance();
@@ -1879,7 +1884,7 @@ FactoryWrapper::createInstanceWithArgumentsAndContext(
     css::uno::Reference< css::uno::XComponentContext > const & Context)
     throw (css::uno::Exception, css::uno::RuntimeException)
 {
-    loadImplementation();
+    loadImplementation(Context);
     return factory1_.is()
         ? factory1_->createInstanceWithArgumentsAndContext(Arguments, Context)
         : factory2_->createInstanceWithArguments(Arguments);
@@ -1888,7 +1893,7 @@ FactoryWrapper::createInstanceWithArgumentsAndContext(
 css::uno::Reference< css::uno::XInterface > FactoryWrapper::createInstance()
     throw (css::uno::Exception, css::uno::RuntimeException)
 {
-    loadImplementation();
+    loadImplementation(manager_->getContext());
     return factory1_.is()
         ? factory1_->createInstanceWithContext(manager_->getContext())
         : factory2_->createInstance();
@@ -1899,7 +1904,7 @@ FactoryWrapper::createInstanceWithArguments(
     css::uno::Sequence< css::uno::Any > const & Arguments)
     throw (css::uno::Exception, css::uno::RuntimeException)
 {
-    loadImplementation();
+    loadImplementation(manager_->getContext());
     return factory1_.is()
         ? factory1_->createInstanceWithArgumentsAndContext(
             Arguments, manager_->getContext())
@@ -1944,7 +1949,9 @@ css::uno::Sequence< rtl::OUString > FactoryWrapper::getSupportedServiceNames()
     return names;
 }
 
-void FactoryWrapper::loadImplementation() {
+void FactoryWrapper::loadImplementation(
+    css::uno::Reference< css::uno::XComponentContext > const & context)
+{
     {
         osl::MutexGuard g(mutex_);
         if (loaded_) {
@@ -1956,7 +1963,7 @@ void FactoryWrapper::loadImplementation() {
     //TODO: There is a race here, as the relevant service factory can already
     // have been removed and loading can thus fail, as the entity from which to
     // load can disappear once the service factory is removed:
-    manager_->loadImplementation(info_, &f1, &f2);
+    manager_->loadImplementation(context, info_, &f1, &f2);
     if (!(f1.is() || f2.is())) {
         throw css::uno::DeploymentException(
             "Implementation " + info_->name + " does not provide a factory",
commit e7a02843e54e1b64e2078549af110beaccf50348
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Aug 8 18:20:49 2012 +0200

    Export JNI functions from juh, juhx libs
    
    ...this had been broken with gbuild'ification of javaunohelper and caused
    java.lang.UnsatisfiedLinkError from
    com.sun.star.comp.helper.Bootstrap.cppuhelper_bootstrap, as could be witnessed
    by test-javanative in ure/source/uretest/Makefile failing.
    
    Change-Id: I8a76e1195c713895bfb8eae5070b0f73beb2b897

diff --git a/javaunohelper/source/bootstrap.cxx b/javaunohelper/source/bootstrap.cxx
index 2e9fff1..5c6ac0a 100644
--- a/javaunohelper/source/bootstrap.cxx
+++ b/javaunohelper/source/bootstrap.cxx
@@ -66,7 +66,7 @@ inline ::rtl::OUString jstring_to_oustring( jstring jstr, JNIEnv * jni_env )
 }
 
 //==================================================================================================
-extern "C" JNIEXPORT jobject JNICALL Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
+extern "C" SAL_DLLPUBLIC_EXPORT jobject JNICALL Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
     JNIEnv * jni_env, SAL_UNUSED_PARAMETER jclass, jstring juno_rc, jobjectArray jpairs,
     jobject loader )
 {
diff --git a/javaunohelper/source/javaunohelper.cxx b/javaunohelper/source/javaunohelper.cxx
index 498a556..a36cf58 100644
--- a/javaunohelper/source/javaunohelper.cxx
+++ b/javaunohelper/source/javaunohelper.cxx
@@ -52,7 +52,7 @@ using ::rtl::OUString;
  * Method:    component_writeInfo
  * Signature: (Ljava/lang/String;Lcom/sun/star/lang/XMultiServiceFactory;Lcom/sun/star/registry/XRegistryKey;)Z
  */
-extern "C" JNIEXPORT jboolean JNICALL
+extern "C" SAL_DLLPUBLIC_EXPORT jboolean JNICALL
 Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
     JNIEnv * pJEnv, SAL_UNUSED_PARAMETER jclass, jstring jLibName, jobject jSMgr,
     jobject jRegKey, jobject loader )
@@ -132,7 +132,7 @@ Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
  * Method:    component_getFactory
  * Signature: (Ljava/lang/String;Ljava/lang/String;Lcom/sun/star/lang/XMultiServiceFactory;Lcom/sun/star/registry/XRegistryKey;)Ljava/lang/Object;
  */
-extern "C" JNIEXPORT jobject JNICALL
+extern "C" SAL_DLLPUBLIC_EXPORT jobject JNICALL
 Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
     JNIEnv * pJEnv, SAL_UNUSED_PARAMETER jclass, jstring jLibName, jstring jImplName,
     jobject jSMgr, jobject jRegKey, jobject loader )
@@ -228,7 +228,7 @@ Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
  * Method:    createRegistryServiceFactory
  * Signature: (Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/Object;
  */
-extern "C" JNIEXPORT jobject JNICALL
+extern "C" SAL_DLLPUBLIC_EXPORT jobject JNICALL
 Java_com_sun_star_comp_helper_RegistryServiceFactory_createRegistryServiceFactory(
     JNIEnv * pJEnv, SAL_UNUSED_PARAMETER jclass, jstring jWriteRegFile,
     jstring jReadRegFile, jboolean jbReadOnly, jobject loader )
diff --git a/javaunohelper/source/javaunohelper.map b/javaunohelper/source/javaunohelper.map
deleted file mode 100644
index c89f0bc..0000000
--- a/javaunohelper/source/javaunohelper.map
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-UDK_3_0_0 {
-    global:
-    Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo;
-    Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory;
-    Java_com_sun_star_comp_helper_RegistryServiceFactory_createRegistryServiceFactory;
-    Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap;
-    local:
-    *;
-};
diff --git a/javaunohelper/source/preload.cxx b/javaunohelper/source/preload.cxx
index a4774be..c188d82 100644
--- a/javaunohelper/source/preload.cxx
+++ b/javaunohelper/source/preload.cxx
@@ -105,7 +105,7 @@ static bool inited_juhx( JNIEnv * jni_env )
 }
 
 //==================================================================================================
-JNIEXPORT jboolean JNICALL
+SAL_DLLPUBLIC_EXPORT jboolean JNICALL
 Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
     JNIEnv * pJEnv, jclass jClass, jstring jLibName, jobject jSMgr,
     jobject jRegKey, jobject loader )
@@ -116,7 +116,7 @@ Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
     return JNI_FALSE;
 }
 //==================================================================================================
-JNIEXPORT jobject JNICALL
+SAL_DLLPUBLIC_EXPORT jobject JNICALL
 Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
     JNIEnv * pJEnv, jclass jClass, jstring jLibName, jstring jImplName,
     jobject jSMgr, jobject jRegKey, jobject loader )
@@ -127,7 +127,7 @@ Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
     return 0;
 }
 //==================================================================================================
-JNIEXPORT jobject JNICALL
+SAL_DLLPUBLIC_EXPORT jobject JNICALL
 Java_com_sun_star_comp_helper_RegistryServiceFactory_createRegistryServiceFactory(
     JNIEnv * pJEnv, jclass jClass, jstring jWriteRegFile,
     jstring jReadRegFile, jboolean jbReadOnly, jobject loader )
@@ -140,7 +140,7 @@ Java_com_sun_star_comp_helper_RegistryServiceFactory_createRegistryServiceFactor
     return 0;
 }
 //==================================================================================================
-JNIEXPORT jobject JNICALL
+SAL_DLLPUBLIC_EXPORT jobject JNICALL
 Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
     JNIEnv * jni_env, jclass jClass, jstring juno_rc, jobjectArray jpairs,
     jobject loader )
commit f98379816411f932ccdafede5f9b25c260c17361
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Aug 8 18:11:34 2012 +0200

    Make ure/source/uretest work again
    
    ...at least, Makefile (to be run from within an SDK environment) works again; I
    reflected all the relevant changes in Makefile.pln (to be run from no specific
    environment) too, but did not actually check the latter
    
    Change-Id: Ie2012d26b3bd59335a0f872bbfc1414cc4f5edc5

diff --git a/ure/source/uretest/Makefile b/ure/source/uretest/Makefile
index 5e6f8f2..051bcdc 100644
--- a/ure/source/uretest/Makefile
+++ b/ure/source/uretest/Makefile
@@ -107,8 +107,7 @@ clean:
 	$(DELRECURSIVE) $(subst /,$(PS),out.sdk)
 
 
-out.sdk/cppmain.uno.$(SHAREDLIB_EXT): out.sdk/cppmain.$(OBJ_EXT) version.map | \
-            out.sdk
+out.sdk/cppmain.uno.$(SHAREDLIB_EXT): out.sdk/cppmain.$(OBJ_EXT) | out.sdk
 	$(LINK) $(COMP_LINK_FLAGS) $(link_output_switch)$@ $< $(LINK_LIBS) \
             $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(SALHELPERLIB) \
             $(link_std_libs)
@@ -120,8 +119,7 @@ out.sdk/cppmain.$(OBJ_EXT): cppmain.cc out.sdk/cpputypes.cppumaker.flag \
             $(CC_DEFINES) $<
 
 
-out.sdk/cpptest.uno.$(SHAREDLIB_EXT): out.sdk/cpptest.$(OBJ_EXT) version.map | \
-            out.sdk
+out.sdk/cpptest.uno.$(SHAREDLIB_EXT): out.sdk/cpptest.$(OBJ_EXT) | out.sdk
 	$(LINK) $(COMP_LINK_FLAGS) $(link_output_switch)$@ $< $(LINK_LIBS) \
             $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(link_std_libs)
 
@@ -132,8 +130,7 @@ out.sdk/cpptest.$(OBJ_EXT): cpptest.cc out.sdk/cpputypes.cppumaker.flag \
             $(CC_DEFINES) $<
 
 
-out.sdk/cppserver.uno.$(SHAREDLIB_EXT): out.sdk/cppserver.$(OBJ_EXT) \
-            version.map | out.sdk
+out.sdk/cppserver.uno.$(SHAREDLIB_EXT): out.sdk/cppserver.$(OBJ_EXT) | out.sdk
 	$(LINK) $(COMP_LINK_FLAGS) $(link_output_switch)$@ $< $(LINK_LIBS) \
             $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(link_std_libs)
 
@@ -147,11 +144,11 @@ out.sdk/cppserver.$(OBJ_EXT): cppserver.cc out.sdk/cpputypes.cppumaker.flag \
 out.sdk/cpputypes.cppumaker.flag: | out.sdk
 	$(CPPUMAKER) -O./out.sdk/include/cpputypes \
             "-Tcom.sun.star.lang.DisposedException;com.sun.star.lang.EventObject;com.sun.star.lang.XMain;com.sun.star.lang.XMultiComponentFactory;com.sun.star.lang.XMultiServiceFactory;com.sun.star.lang.XSingleComponentFactory;com.sun.star.lang.XSingleServiceFactory;com.sun.star.lang.XTypeProvider;com.sun.star.registry.XRegistryKey;com.sun.star.uno.DeploymentException;com.sun.star.uno.Exception;com.sun.star.uno.RuntimeException;com.sun.star.uno.XAggregation;com.sun.star.uno.XComponentContext;com.sun.star.uno.XCurrentContext;com.sun.star.uno.XInterface;com.sun.star.uno.XWeak" \
-            -B/UCR "$(URE_TYPES)"
+            -BUCR "$(URE_TYPES)"
 	touch $@
 
 out.sdk/types.cppumaker.flag: out.sdk/types.rdb | out.sdk
-	$(CPPUMAKER) -O./out.sdk/include/types -B/UCR $< "-X$(URE_TYPES)"
+	$(CPPUMAKER) -O./out.sdk/include/types -BUCR $< "-X$(URE_TYPES)"
 	touch $@
 
 
@@ -274,7 +271,7 @@ out.sdk/types.mf: types.mf.template | out.sdk
 
 out.sdk/types.javamaker.flag: out.sdk/types.rdb | out.sdk out.sdk/class
 	- $(DELRECURSIVE) $(subst /,$(PS),out.sdk/class/types)
-	$(JAVAMAKER) -O./out.sdk/class/types -B/UCR $< "-X$(URE_TYPES)"
+	$(JAVAMAKER) -O./out.sdk/class/types -BUCR $< "-X$(URE_TYPES)"
 	touch $@
 
 
diff --git a/ure/source/uretest/Makefile.pln b/ure/source/uretest/Makefile.pln
index 15d5b4b..6f2832c 100644
--- a/ure/source/uretest/Makefile.pln
+++ b/ure/source/uretest/Makefile.pln
@@ -79,62 +79,60 @@ clean:
 	rm -rf out.pln
 
 
-out.pln/cppmain.uno.so: out.pln/cppmain.o version.map | out.pln \
-            out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
-            out.pln/lib/libuno_sal.so out.pln/lib/libuno_salhelpergcc3.so \
-            out.pln/lib/libstlport_gcc.so
-	g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \
-            -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \
-            -luno_cppuhelpergcc3 -luno_sal -luno_salhelpergcc3 -lstlport_gcc
+out.pln/cppmain.uno.so: out.pln/cppmain.o | out.pln out.pln/lib/libuno_cppu.so \
+            out.pln/lib/libuno_cppuhelpergcc3.so out.pln/lib/libuno_sal.so \
+            out.pln/lib/libuno_salhelpergcc3.so
+	g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
+            -luno_cppu -luno_cppuhelpergcc3 -luno_sal -luno_salhelpergcc3
 
 out.pln/cppmain.o: cppmain.cc out.pln/cpputypes.cppumaker.flag \
             out.pln/types.cppumaker.flag | out.pln
-	g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \
-            -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
-            -I out.pln/include/types -DCPPU_ENV=gcc3 \
-            -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $<
+	g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
+            -I $(SDK_HOME)/include/stl -I $(SDK_HOME)/include \
+            -I out.pln/include/cpputypes -I out.pln/include/types \
+            -DCPPU_ENV=gcc3 -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX \
+            -DUNX $<
 
 
-out.pln/cpptest.uno.so: out.pln/cpptest.o version.map | out.pln \
-            out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
-            out.pln/lib/libuno_sal.so
-	g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \
-            -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \
-            -luno_cppuhelpergcc3 -luno_sal
+out.pln/cpptest.uno.so: out.pln/cpptest.o | out.pln out.pln/lib/libuno_cppu.so \
+            out.pln/lib/libuno_cppuhelpergcc3.so out.pln/lib/libuno_sal.so
+	g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
+            -luno_cppu -luno_cppuhelpergcc3 -luno_sal
 
 out.pln/cpptest.o: cpptest.cc out.pln/cpputypes.cppumaker.flag \
             out.pln/types.cppumaker.flag | out.pln
-	g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \
-            -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
-            -I out.pln/include/types -DCPPU_ENV=gcc3 \
-            -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $<
+	g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
+            -I $(SDK_HOME)/include/stl -I $(SDK_HOME)/include \
+            -I out.pln/include/cpputypes -I out.pln/include/types \
+            -DCPPU_ENV=gcc3 -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX \
+            -DUNX $<
 
 
-out.pln/cppserver.uno.so: out.pln/cppserver.o version.map | out.pln \
+out.pln/cppserver.uno.so: out.pln/cppserver.o | out.pln \
             out.pln/lib/libuno_cppu.so out.pln/lib/libuno_cppuhelpergcc3.so \
             out.pln/lib/libuno_sal.so
-	g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings \
-            -Wl,--version-script=version.map $< -Lout.pln/lib -luno_cppu \
-            -luno_cppuhelpergcc3 -luno_sal
+	g++ -shared -o $@ -Wl,-z,defs -Wl,--fatal-warnings $< -Lout.pln/lib \
+            -luno_cppu -luno_cppuhelpergcc3 -luno_sal
 
 out.pln/cppserver.o: cppserver.cc out.pln/cpputypes.cppumaker.flag \
             out.pln/types.cppumaker.flag | out.pln
-	g++ -c -o $@ -fpic -Wall -Wno-ctor-dtor-privacy -I $(SDK_HOME)/include/stl \
-            -I $(SDK_HOME)/include -I out.pln/include/cpputypes \
-            -I out.pln/include/types -DCPPU_ENV=gcc3 \
-            -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX -DUNX $<
+	g++ -c -o $@ -fpic -fvisibility=hidden -Wall -Wno-ctor-dtor-privacy \
+            -I $(SDK_HOME)/include/stl -I $(SDK_HOME)/include \
+            -I out.pln/include/cpputypes -I out.pln/include/types \
+            -DCPPU_ENV=gcc3 -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) -DLINUX \
+            -DUNX $<
 
 
 out.pln/cpputypes.cppumaker.flag: | out.pln
 	LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \
             -O./out.pln/include/cpputypes \
             '-Tcom.sun.star.lang.DisposedException;com.sun.star.lang.EventObject;com.sun.star.lang.XMain;com.sun.star.lang.XMultiComponentFactory;com.sun.star.lang.XMultiServiceFactory;com.sun.star.lang.XSingleComponentFactory;com.sun.star.lang.XSingleServiceFactory;com.sun.star.lang.XTypeProvider;com.sun.star.registry.XRegistryKey;com.sun.star.uno.DeploymentException;com.sun.star.uno.Exception;com.sun.star.uno.RuntimeException;com.sun.star.uno.XAggregation;com.sun.star.uno.XComponentContext;com.sun.star.uno.XCurrentContext;com.sun.star.uno.XInterface;com.sun.star.uno.XWeak' \
-            -B/UCR $(URE_HOME)/share/misc/types.rdb
+            -BUCR $(URE_HOME)/share/misc/types.rdb
 	touch $@
 
 out.pln/types.cppumaker.flag: out.pln/types.rdb | out.pln
 	LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/cppumaker \
-            -O./out.pln/include/types -B/UCR $< \
+            -O./out.pln/include/types -BUCR $< \
             -X$(URE_HOME)/share/misc/types.rdb
 	touch $@
 
@@ -258,7 +256,7 @@ out.pln/types.mf: types.mf.template | out.pln
 out.pln/types.javamaker.flag: out.pln/types.rdb | out.pln out.pln/class
 	rm -rf out.pln/class/types
 	LD_LIBRARY_PATH=$(URE_HOME)/lib $(SDK_HOME)/bin/javamaker \
-            -O./out.pln/class/types -B/UCR $< -X$(URE_HOME)/share/misc/types.rdb
+            -O./out.pln/class/types -BUCR $< -X$(URE_HOME)/share/misc/types.rdb
 	touch $@
 
 
@@ -292,9 +290,6 @@ out.pln/lib/libuno_sal.so: | out.pln/lib
 out.pln/lib/libuno_salhelpergcc3.so: | out.pln/lib
 	ln -fs $(URE_HOME)/lib/libuno_salhelpergcc3.so.3 $@
 
-out.pln/lib/libstlport_gcc.so: | out.pln/lib
-	ln -fs $(URE_HOME)/lib/libstlport_gcc.so $@
-
 
 out.pln:
 	mkdir $@
diff --git a/ure/source/uretest/cppmain.cc b/ure/source/uretest/cppmain.cc
index f458b11..3cc496c 100644
--- a/ure/source/uretest/cppmain.cc
+++ b/ure/source/uretest/cppmain.cc
@@ -102,11 +102,8 @@ private:
     }
     static char const * const services[] = {
         "com.sun.star.beans.Introspection",
-        "com.sun.star.bridge.Bridge",
         "com.sun.star.bridge.BridgeFactory",
-        "com.sun.star.bridge.IiopBridge",
         "com.sun.star.bridge.UnoUrlResolver",
-        "com.sun.star.bridge.UrpBridge",
         "com.sun.star.connection.Acceptor",
         "com.sun.star.connection.Connector",
         "com.sun.star.io.DataInputStream",
@@ -152,10 +149,10 @@ private:
             static_cast< ::cppu::OWeakObject * >(this));
     }
     for (::std::size_t i = 0; i < SAL_N_ELEMENTS(services); ++i) {
+        ::rtl::OUString name(::rtl::OUString::createFromAscii(services[i]));
         ::css::uno::Reference< ::css::uno::XInterface > instance;
         try {
-            instance = manager->createInstanceWithContext(
-                ::rtl::OUString::createFromAscii(services[i]), context_);
+            instance = manager->createInstanceWithContext(name, context_);
         } catch (::css::uno::RuntimeException &) {
             throw;
         } catch (::css::uno::Exception &) {
@@ -166,7 +163,7 @@ private:
         }
         if (!instance.is()) {
             throw ::css::uno::RuntimeException(
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("no instance")),
+                "no instance: " + name,
                 static_cast< ::cppu::OWeakObject * >(this));
         }
     }
@@ -243,7 +240,7 @@ namespace CppMain {
 
 }
 
-extern "C" ::sal_Bool SAL_CALL component_writeInfo(
+extern "C" SAL_DLLPUBLIC_EXPORT ::sal_Bool SAL_CALL component_writeInfo(
     void * serviceManager, void * registryKey)
 {
     return ::cppu::component_writeInfoHelper(
diff --git a/ure/source/uretest/cppserver.cc b/ure/source/uretest/cppserver.cc
index 2b85db0..8d6e9a9 100644
--- a/ure/source/uretest/cppserver.cc
+++ b/ure/source/uretest/cppserver.cc
@@ -95,7 +95,7 @@ namespace CppServer {
 
 }
 
-extern "C" ::sal_Bool SAL_CALL component_writeInfo(
+extern "C" SAL_DLLPUBLIC_EXPORT ::sal_Bool SAL_CALL component_writeInfo(
     void * serviceManager, void * registryKey)
 {
     return ::cppu::component_writeInfoHelper(
diff --git a/ure/source/uretest/cpptest.cc b/ure/source/uretest/cpptest.cc
index ed71581..d8fc624 100644
--- a/ure/source/uretest/cpptest.cc
+++ b/ure/source/uretest/cpptest.cc
@@ -95,7 +95,7 @@ cppu::ImplementationEntry entries[] = {
 
 }
 
-extern "C" sal_Bool SAL_CALL component_writeInfo(
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
     void * serviceManager, void * registryKey)
 {
     return cppu::component_writeInfoHelper(
diff --git a/ure/source/uretest/version.map b/ure/source/uretest/version.map
deleted file mode 100644
index e1a2c19..0000000
--- a/ure/source/uretest/version.map
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-UDK_3_0_0 {
-    global:
-        component_getFactory;
-        component_writeInfo;
-
-        _ZTI*;
-        _ZTS*;
-
-        _ZN4_STL7num_put*; # for STLport
-
-    local:
-        *;
-};
commit 151c8d49e9a2b4d1445f4947b73250eab2d78ded
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Aug 8 16:44:57 2012 +0200

    Better error reporting
    
    Change-Id: I36c6dc025d0094c0b1666e13b25d78931392f768

diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 7291328..7bfe440 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -169,13 +169,16 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL
         rtl::Reference< jvmaccess::UnoVirtualMachine > xVirtualMachine(
             reinterpret_cast< jvmaccess::UnoVirtualMachine * >(nPointer));
         if (!xVirtualMachine.is())
+        {
             //throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM(
             //   "javaloader error - JavaVirtualMachine service could not provide a VM")),
             //   css::uno::Reference<XInterface>());
             // We must not throw a RuntimeException, because this might end the applications.
             // It is ok if java components
             // are not working because the office can be installed without Java support.
+            SAL_WARN("stoc", "getJavaVM returned null");
             return m_javaLoader; // null-ref
+        }
 
         try
         {


More information about the Libreoffice-commits mailing list