[Libreoffice-commits] .: 4 commits - README.cross sal/cppunittester sal/inc sal/Module_sal.mk solenv/gbuild

Tor Lillqvist tml at kemper.freedesktop.org
Wed Feb 22 12:36:22 PST 2012


 README.cross                               |   34 +++++++++++++++++++++++------
 sal/Module_sal.mk                          |    6 ++---
 sal/cppunittester/cppunittester.cxx        |   18 ++++++++++++++-
 sal/inc/cppunittester/protectorfactory.hxx |    4 +++
 solenv/gbuild/platform/IOS_ARM_GCC.mk      |    4 +--
 5 files changed, 53 insertions(+), 13 deletions(-)

New commits:
commit 21aec7e5d724042773d9d5ea39f477113ace0c39
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Feb 22 20:41:58 2012 +0200

    Updates for iOS, and Xcode 4.3

diff --git a/README.cross b/README.cross
index d2a8b14..a1edd27 100644
--- a/README.cross
+++ b/README.cross
@@ -278,21 +278,19 @@ CC_FOR_BUILD=ccache /Xcode3/usr/bin/gcc-4.0 -mmacosx-version-min=10.4
 CXX_FOR_BUILD=ccache /Xcode3/usr/bin/g++-4.0 -mmacosx-version-min=10.4
 --with-distro=LibreOfficeiOS
 --with-external-tar=/Volumes/ooo/git/master/src
---with-num-cpus=1
---with-max-jobs=1
+--with-system-nss
 --without-help
 --without-helppack-integration
 --without-myspell-dicts
 
-And here for the iOS simulator:
-CXX=ccache /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++ -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
-CC=ccache /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
+And here for the iOS simulator, using Xcode 4.2:
+CXX=ccache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
+CC=ccache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
 CC_FOR_BUILD=ccache /Xcode3/usr/bin/gcc-4.0 -mmacosx-version-min=10.4
 CXX_FOR_BUILD=ccache /Xcode3/usr/bin/g++-4.0 -mmacosx-version-min=10.4
 --with-distro=LibreOfficeiOS
 --with-external-tar=/Volumes/ooo/git/master/src
---with-num-cpus=1
---with-max-jobs=1
+--with-system-nss
 --enable-debug
 --without-help
 --without-helppack-integration
@@ -302,6 +300,28 @@ It seems that with the latest iOS SDK one has to do:
 sudo ln -s i686-apple-darwin10 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/include/c++/4.2.1/i686-apple-darwin11
 or g++ won't find its headers like <bits/c++config.h>
 
+The --with-system-nss doesn't mean that any Mozilla NSS would be used,
+it's just a trick to bypass some tests in the configure script.
+
+For the iOS simulator, using Xcode 4.3:
+
+CXX=ccache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
+CC=ccache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
+CC_FOR_BUILD=ccache /Xcode3/usr/bin/gcc-4.0 -mmacosx-version-min=10.4
+CXX_FOR_BUILD=ccache /Xcode3/usr/bin/g++-4.0 -mmacosx-version-min=10.4
+--enable-werror
+--with-distro=LibreOfficeiOS
+--with-external-tar=/Users/tml/lo/10.4/src
+--with-system-nss
+--without-help
+--without-helppack-integration
+--without-myspell-dicts
+
+Note that you will have to install autoconf and automake yourself
+before running autogen.sh. They are no longer included in Xcode 4.3
+(not even in the add-on "command line tools").
+
+
 Android
 -------
 
commit 59dfa5518097138f1c1864cd3b6d7f5072572e74
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Feb 22 14:04:28 2012 +0200

    cppunittester hacks for iOS, intermediate commit
    
    For iOS cppunit plugins aren't really "plugins" (shared libraries),
    but just static archives. In the real main program of a cppunit app
    (such are not yet written), which calls the lo_main() (the
    SAL_IMPLEMENT_MAIN() in cppunittester.cxx) we specifically will call
    the initialize methods of the CppUnitTestPlugIns that we statically
    link to the app executable. Hopefully that will work out as expected.

diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index d422613..a34ea61 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -128,9 +128,17 @@ public:
     }
     bool run() const
     {
+#ifdef IOS
+        // 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
+        // the SAL_IMPLEMENT_MAIN() below expands to, we specifically
+        // call the initialize methods of the CppUnitTestPlugIns that
+        // we statically link to the app executable.
+#else
         CppUnit::PlugInManager manager;
         manager.load(testlib, args);
-
+#endif
         CppUnit::TestRunner runner;
         runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
 
@@ -198,10 +206,18 @@ SAL_IMPLEMENT_MAIN() {
         if (rtl_getAppCommandArgCount() - index < 3) {
             usageFailure();
         }
+#ifndef IOS
         rtl::OUString lib(getArgument(index + 1));
         rtl::OUString sym(getArgument(index + 2));
         modules.push_back(new osl::Module(lib, SAL_LOADMODULE_GLOBAL));
         oslGenericFunction fn = modules.back().getFunctionSymbol(sym);
+#else
+        // The only "protector" we ever use is the unoexceptionprotector...
+        // Oh the joys of over-engineering.
+        rtl::OUString lib(RTL_CONSTASCII_USTRINGPARAM("<static>"));
+        rtl::OUString sym(RTL_CONSTASCII_USTRINGPARAM("unoexceptionprotector"));
+        oslGenericFunction fn = (oslGenericFunction) unoexceptionprotector;
+#endif
         throw_protector = fn == 0
             ? 0
             : (*reinterpret_cast< cppunittester::ProtectorFactory * >(fn))();
diff --git a/sal/inc/cppunittester/protectorfactory.hxx b/sal/inc/cppunittester/protectorfactory.hxx
index ed9d365..a6e1d2e 100644
--- a/sal/inc/cppunittester/protectorfactory.hxx
+++ b/sal/inc/cppunittester/protectorfactory.hxx
@@ -50,6 +50,10 @@ namespace cppunittester
     extern "C" typedef LibreOfficeProtector * SAL_CALL ProtectorFactory();
 }
 
+#ifdef IOS
+extern "C" CppUnit::Protector *unoexceptionprotector();
+#endif
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 6239540d7d1ea0c9fa83fede64c6ce10f00dba71
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Feb 22 14:01:40 2012 +0200

    We don't want to build real executables for iOS using gbuild
    
    Our current <sal/main.h> doesn't produce any main() anyway, but a
    lo_main(). Just like for Android, except that for iOS we don't produce
    a shared library for gbuildified "executables", but a static library
    even. Compiling actual main programs and linking with all necessary
    (static) LO libraries will be managed (for now) outside gbuild.

diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk
index e72c20d..5c8dde6 100644
--- a/solenv/gbuild/platform/IOS_ARM_GCC.mk
+++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk
@@ -255,8 +255,8 @@ gb_StaticLibrary_StaticLibrary_platform =
 
 # Executable class
 
-gb_Executable_EXT :=
-gb_Executable_TARGETTYPEFLAGS := -dead_strip
+gb_Executable_EXT := .a
+gb_Executable_TARGETTYPEFLAGS := 
 
 gb_Executable_LAYER := \
 	$(foreach exe,$(gb_Executable_UREBIN),$(exe):OOO) \
commit 5241f06f93d0455b3e8a974a4939ad816fe33db0
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Feb 22 13:59:49 2012 +0200

    Do build cppunittester and don't build osl_process_child for iOS

diff --git a/sal/Module_sal.mk b/sal/Module_sal.mk
index d9b5ffb..ad64c85 100644
--- a/sal/Module_sal.mk
+++ b/sal/Module_sal.mk
@@ -29,9 +29,9 @@
 $(eval $(call gb_Module_Module,sal))
 
 $(eval $(call gb_Module_add_targets,sal,\
-	Executable_osl_process_child \
-	$(if $(filter $(OS),IOS),,\
-		Executable_cppunittester) \
+	$(if $(filter $(OS),IOS),, \
+		Executable_osl_process_child) \
+	Executable_cppunittester \
 	$(if $(filter $(OS),ANDROID), \
 		Library_lo-bootstrap) \
 	Library_sal \


More information about the Libreoffice-commits mailing list