[Libreoffice-commits] core.git: desktop/Library_sofficeapp.mk sal/inc sal/Library_sal.mk sal/Module_sal.mk sal/osl vcl/Module_vcl.mk

Tor Lillqvist tml at iki.fi
Fri Feb 22 13:38:07 PST 2013


 desktop/Library_sofficeapp.mk |    9 ---------
 sal/Library_sal.mk            |    2 +-
 sal/Module_sal.mk             |    8 ++++++--
 sal/inc/sal/main.h            |   20 +-------------------
 sal/osl/unx/process_impl.cxx  |   24 ++++--------------------
 vcl/Module_vcl.mk             |    5 +++--
 6 files changed, 15 insertions(+), 53 deletions(-)

New commits:
commit fd56eb98e63b4aac12c9633d5847a3fb964f326d
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Feb 22 23:19:22 2013 +0200

    Not using NativeActivity means no lo_main() stuff used either
    
    Hopefully also fixes build for iOS by re-introducing checks for DESKTOP.
    
    Also this commit partially reverts 52a8744afee2cd589813f0377d93f821fce7aedd.
    
    Change-Id: Ie94c771b72ba138bb0481b054285916618baf6eb

diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 4687b5d..2a635b5 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -94,13 +94,4 @@ ifeq ($(ENABLE_TELEPATHY),TRUE)
 $(eval $(call gb_Library_use_libraries,sofficeapp,tubes))
 endif
 
-#
-# We need the lo_main symbol for our boostrap loader
-#
-ifeq ($(OS),ANDROID)
-$(eval $(call gb_Library_add_cobjects,sofficeapp,\
-    desktop/source/app/main \
-))
-endif
-
 # vim: set ts=4 sw=4 et:
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index 1d88460..62f9ce3 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -181,7 +181,7 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
 	sal/osl/unx/module \
 	sal/osl/unx/process \
 	sal/osl/unx/process_impl \
-	sal/osl/unx/salinit \
+        $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \
 	sal/osl/unx/uunxapi \
 ))
 $(eval $(call gb_Library_add_cobjects,sal,\
diff --git a/sal/Module_sal.mk b/sal/Module_sal.mk
index af97e48..7d20fa3 100644
--- a/sal/Module_sal.mk
+++ b/sal/Module_sal.mk
@@ -31,7 +31,8 @@ $(eval $(call gb_Module_Module,sal))
 $(eval $(call gb_Module_add_targets,sal,\
 	CustomTarget_generated \
 	CustomTarget_sal_allheaders \
-	Executable_cppunittester \
+	$(if $(filter DESKTOP,$(BUILD_TYPE)), \
+		Executable_cppunittester) \
 	$(if $(filter $(OS),ANDROID), \
 		Library_lo-bootstrap) \
 	Library_sal \
@@ -45,13 +46,14 @@ $(eval $(call gb_Module_add_targets,sal,\
 ))
 
 ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
+
 $(eval $(call gb_Module_add_targets,sal,\
 		Executable_osl_process_child \
 ))
+
 $(eval $(call gb_Module_add_check_targets,sal,\
 		CppunitTest_sal_osl_process \
 ))
-endif
 
 $(eval $(call gb_Module_add_check_targets,sal,\
 	$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,CppunitTest_Module_DLL) \
@@ -88,6 +90,8 @@ $(eval $(call gb_Module_add_check_targets,sal,\
 	CppunitTest_sal_rtl_math \
 ))
 
+endif
+
 # CppunitTest_sal_osl_pipe has circular dependency on unotest
 # $(eval $(call gb_Module_add_subsequentcheck_targets,sal,\
 	CppunitTest_sal_osl_pipe \
diff --git a/sal/inc/sal/main.h b/sal/inc/sal/main.h
index 7cdc9bc..8648e38 100644
--- a/sal/inc/sal/main.h
+++ b/sal/inc/sal/main.h
@@ -38,25 +38,7 @@ SAL_DLLPUBLIC void SAL_CALL sal_detail_deinitialize();
 
 #if defined IOS || defined ANDROID
 
-#ifdef __cplusplus
-extern "C" SAL_DLLPUBLIC_EXPORT void lo_main(int argc, char **argv);
-#endif
-
-#define SAL_MAIN_WITH_ARGS_IMPL \
-SAL_DLLPUBLIC_EXPORT void lo_main(int argc, char **argv) \
-{ \
-    sal_detail_initialize(argc, argv); \
-    sal_main_with_args(argc, argv); \
-    sal_detail_deinitialize(); \
-}
-
-#define SAL_MAIN_IMPL \
-SAL_DLLPUBLIC_EXPORT void lo_main(int argc, char **argv) \
-{ \
-    sal_detail_initialize(argc, argv); \
-    sal_main(); \
-    sal_detail_deinitialize(); \
-}
+#error No code that includes this should be built for iOS or Android
 
 #else
 
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx
index 4a10af5..723d10b 100644
--- a/sal/osl/unx/process_impl.cxx
+++ b/sal/osl/unx/process_impl.cxx
@@ -104,26 +104,10 @@ oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl (
 {
     oslProcessError result = osl_Process_E_NotFound;
 
-#if defined(ANDROID) && !defined(DISABLE_DYNLOADING)
-    /* On Android we in theory want the address of the "lo_main()"
-     * function, as that is what corresponds to "main()" in
-     * LibreOffice programs on normal desktop OSes.
-     *
-     * But that is true only for apps with a "native activity", using
-     * <sal/main.h> and the org.libreoffice.android.Bootstrap
-     * mechanism. For more normal (?) Android apps that just use
-     * LibreOffice libraries (components) where the main program is in
-     * Java, that just use LibreOffice libraries, there is no
-     * lo_main(). (Note that we don't know for sure yet how
-     * complicated it might be to write such Android apps...)
-     *
-     * Maybe best to just pick some function in liblo-bootstrap.so
-     * which also such Java apps *must* load as the very first
-     * LibreOffice native library. We store all LibreOffice native
-     * shared libraries an app uses in the same folder anyway, so it
-     * doesn't really matter.
-     */
-    void * addr = (void *) &lo_dlopen;
+#ifdef ANDROID
+    /* Now with just a single DSO, this one from lo-bootstrap.c is as good as
+     * any */
+    void * addr = dlsym (RTLD_DEFAULT, "JNI_OnLoad");
 #else
     /* Determine address of "main()" function. */
     void * addr = dlsym (RTLD_DEFAULT, "main");
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index f340800d..116e815 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -24,8 +24,9 @@ $(eval $(call gb_Module_add_targets,vcl,\
     CustomTarget_afm_hash \
     Library_vcl \
     Package_inc \
-    StaticLibrary_vclmain \
-	Executable_ui-previewer \
+    $(if $(filter DESKTOP,$(BUILD_TYPE)), \
+		StaticLibrary_vclmain \
+		Executable_ui-previewer) \
     UI_vcl \
 ))
 


More information about the Libreoffice-commits mailing list